Oracle Linux 6.4 accidentally remove VG solution

  
                

When operating on the Oracle Linux system, I accidentally deleted the VG. I believe many of my friends have encountered this situation. The VG that was deleted by mistake can be recovered. The following small series will introduce you to Oracle. Linux 6.4 delete VG solution, let's get to know it.

I. Background description

1, OSS network test database due to the large number of small things frequently submitted to run very slowly. After analysis, there is a bottleneck in the disk I/O where the DS3950 storage is located, and a large number of waiting events have limited performance. In addition, the development colleagues did not optimize their consciousness and did not make small things into batch submission methods.

2, on the DS3950, 9 600G hard drives (8 + 1 hot standby) do RAID5 array, lun01, lun02, lun03, lun04, are 200G, mapped to the OSS database server.

3, on the operating system, lun01, lun02 constitutes the vg_ossdb volume group, vg_ossdb only one LV--lvoradata is mounted on /oradata. Recently, due to the rapid growth of data, lun03 and lun04 have been extended to the vg_ossdb volume group in vgextend mode, but lvoradata has not been expanded.

4, on the database, Oracle software is installed on the local disk /oracle, the database is installed on /oradata.

Second, the project transformation plan and steps

1, stop the database, the /oradata directory is fully backed up to another standby PC machine.

2, because the DS3950 storage space is very large, you can modify its array level from RAID5 to RAID10.

3, due to lun03, lun04 has not been used, the leadership requires to remove lun03, lun04 from vg_ossdb, and unmap on the storage, easy to change the array level.

4, DBA optimizes SQL, and tries to submit small things as batches.

Third, system environment and data version description

[root@ol64 /]# cat /etc/issue

Oracle Linux Server release 6.4

Kernel \ 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

Fourth, the vg_ossdb volume group was deleted by misuse of vgremove during the transformation process, and the intention was to remove /dev/sdd, /dev/sde with vgreduce.

[root@ol64 /]# umount /oradata/#Unmount File System

[root@ol64 /]# vgchange -an /dev/vg_ossdb #Place the volume group inactive

0 logical volume(s) in volume group “vg_ossdb” now active

[root@ol64 /]# vgremove vg_ossdb /dev/sdb /dev/sdc /dev/sdd /dev /sde #Use the vgremove command to remove 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< Br>

Volume group “sdc” not found

Volume group “sdd” not found

Volume group “sde” not found

### ############################################################################ #############

The correct operation should be to remove /dev/sdd and /dev/sde

from the vg_ossdb using the vgreduce command [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”

############################# ################################################################################################### The pvremove command removes /dev/sdd and /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 #Found /dev/sdb and /dev/sdc where VG Name is empty, sweating ing.< Br>

--- Physical volume ---

PV Name /dev/sda2

VG Name vg_ol64

PV Size 199.51 GiB /not usable 3.00 MiB< Br>

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

<quo;/dev/sdc” is a new physical volume Of “200.00 GiB”
Previous12Next Total 2 Pages

Copyright © Windows knowledge All Rights Reserved