在Oracle Linux系統進行操作的時候,不小心將VG給刪除了,相信不少朋友有遇到這種情況,誤刪的VG其實是可以恢復的,下面小編就給大家介紹下Oracle Linux 6.4刪除VG的解決方法,一起來了解下吧。
一、項目背景描述
1、OSS現網測試數據庫因大量小事物頻繁提交運行非常緩慢。經分析為DS3950存儲所在磁盤I/O存在瓶頸,大量等待事件,性能受限。另外,開發同事沒有優化意識,沒將小事物做成批量提交方式。
2、在DS3950上,9塊600G硬盤(8塊+1塊熱備)做了RAID5陣列,lun01,lun02,lun03,lun04,均為200G,映射給OSS數據庫服務器使用。
3、在操作系統上,lun01,lun02構成了vg_ossdb卷組,vg_ossdb下只有一個LV--lvoradata掛載在/oradata上。最近因數據增長過快,又將lun03,lun04以vgextend方式擴到了vg_ossdb卷組中去,但尚未擴大lvoradata。
4、在數據庫上,Oracle軟件安裝在本地磁盤/oracle上,數據庫安裝在/oradata上。
二、項目改造計劃及步驟
1、停掉數據庫,將/oradata目錄全備份到另一台備用PC機器上。
2、由於DS3950存儲空閒空很大,可修改其陣列級別從RAID5變為RAID10。
3、由於lun03,lun04尚未使用,領導要求先從vg_ossdb中移除lun03,lun04,並在存儲上unmap掉,便於陣列級別變更。
4、由DBA優化SQL,將小事物盡量做到批量提交方式。
三、系統環境及數據版本說明
[root@ol64 /]# cat /etc/issue
Oracle Linux Server release 6.4
Kernel \r on an \m
[root@ol64 /]# uname -a
Linux ol64.com 2.6.39-400.17.1.el6uek.x86_64 #1 SMP Fri Feb 22 18:16:18 PST 2013 x86_64 x86_64 x86_64 GNU/Linux
SQL》 select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
四、改造過程中因誤用vgremove將vg_ossdb卷組刪除,而其本意是想用vgreduce移除/dev/sdd,/dev/sde的。
[root@ol64 /]# umount /oradata/ #卸載文件系統
[root@ol64 /]# vgchange -an /dev/vg_ossdb #將卷組置於非激活狀態
0 logical volume(s) in volume group “vg_ossdb” now active
[root@ol64 /]# vgremove vg_ossdb /dev/sdb /dev/sdc /dev/sdd /dev/sde #誤用vgremove命令刪除了vg_ossdb
Do you really want to remove volume group “vg_ossdb” containing 1 logical volumes? [y/n]: y
Do you really want to remove active logical volume lvoradata? [y/n]: y
Logical volume “lvoradata” successfully removed
Volume group “vg_ossdb” successfully removed
Volume group “sdb” not found
Volume group “sdc” not found
Volume group “sdd” not found
Volume group “sde” not found
##################################################################
正確的操作應該是用vgreduce命令從vg_ossdb中移除/dev/sdd和/dev/sde
[root@ol64 /]# vgreduce vg_ossdb /dev/sdd
Removed “/dev/sdd” from volume group “vg_ossdb”
[root@ol64 /]# vgreduce vg_ossdb /dev/sde
Removed “/dev/sde” from volume group “vg_ossdb”
#################################################################
再用pvremove命令移除/dev/sdd和/dev/sde
[root@ol64 ~]# pvremove /dev/sdd
Labels on physical volume “/dev/sdd” successfully wiped
[root@ol64 ~]# pvremove /dev/sde
Labels on physical volume “/dev/sde” successfully wiped
[root@ol64 ~]# pvdisplay #發現/dev/sdb和/dev/sdc所在VG Name為空,冒汗ing.
--- Physical volume ---
PV Name /dev/sda2
VG Name vg_ol64
PV Size 199.51 GiB / not usable 3.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 51074
Free PE 33660
Allocated PE 17414
PV UUID 0dyB8L-p7ZM-Mkcw-76ae-DXPh-U6zg-9kIQ8z
“/dev/sdb” is a new physical volume of “200.00 GiB”
--- NEW Physical volume ---
PV Name /dev/sdb
VG Name
PV Size 200.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID Ui9wea-II1q-KOx0-96pA-4epf-9hlc-4NFDJF
“/dev/sdc” is a new physical volume of “200.00 GiB”
上一頁12下一頁共2頁