Site icon UnixArena

How to use the mirror VXVM volume for backout reason

Normally Unix admin will come across the root volume back-out.Here we are going to see how to perform data volume back-out on veritas volume manager’s mirrored volume.For an example, database team wants to restore the DB but you want to preserve current copy of the volume before the restore starts.This can be done if you are using vxvm mirrored volume easily.

Last week,i had come across the same situation and i would like to share the information to overcome this.Here my data volume is oravol1. 
Current volume configuration:
v  oravol1         -  ENABLED  ACTIVE   40960    ROUND     -   gen
pl oravol1-01 oravol1 ENABLED ACTIVE 40960 CONCAT - RW
sd exam3-01 oravol1-01 exam3 0 40960 0 disk_3 ENA
pl oravol1-02 oravol1 ENABLED ACTIVE 40960 CONCAT - RW
sd exam1-02 oravol1-02 exam1 40960 40960 0 disk_1 ENA

Steps:

1.Detach the second plex for back-out .
bash-3.00# vxplex -g examdg dis  oravol1-02
bash-3.00# vxprint -hvt
v oravol1 - ENABLED ACTIVE 40960 SELECT - fsgen
pl oravol1-01 oravol1 ENABLED ACTIVE 40960 CONCAT - RW
sd exam3-01 oravol1-01 exam3 0 40960 0 disk_3 ENA
bash-3.00#
bash-3.00# vxprint -pl
Disk group: examdg
Plex: oravol1-01
info: len=40960
type: layout=CONCAT
state: state=ACTIVE kernel=ENABLED io=read-write
assoc: vol=oravol1 sd=exam3-01
flags: busy complete
mediatype: hdd
Plex: oravol1-02
info: len=40960
type: layout=CONCAT
state: state= kernel=DISABLED io=read-write
assoc: vol=(dissoc) sd=exam1-02
flags: busy recover iofail
2.Restore the DB on the volume 

3.If the restore goes well , attach the detached plex with primary plex.
bash-3.00# vxplex -g examdg att oravol1 oravol1-02
bash-3.00# vxprint -hvt
v oravol1 - ENABLED ACTIVE 40960 SELECT - fsgen
pl oravol1-01 oravol1 ENABLED ACTIVE 40960 CONCAT - RW
sd exam3-01 oravol1-01 exam3 0 40960 0 disk_3 ENA
pl oravol1-02 oravol1 ENABLED ACTIVE 40960 CONCAT - RW
sd exam1-02 oravol1-02 exam1 40960 40960 0 disk_1 ENA

Back-out plan:

1.In case the restore failed , you can roll back the change using the below method. unmount the volume
bash-3.00# vxedit -g examdg rename oravol1 oravol1_old
bash-3.00# vxprint -vht
v oravol1_old - ENABLED ACTIVE 40960 SELECT - fsgen
pl oravol1-01 oravol1_old ENABLED ACTIVE 40960 CONCAT - RW
sd exam3-01 oravol1-01 exam3 0 40960 0 disk_3 ENA

2.Create volume using the detached plex .

bash-3.00# vxmake -U gen vol oravol1 plex=oravol1-02
bash-3.00# vxprint -hvt
v oravol1 - DISABLED EMPTY 40960 ROUND - gen
pl oravol1-02 oravol1 DISABLED EMPTY 40960 CONCAT - RW
sd exam1-02 oravol1-02 exam1 40960 40960 0 disk_1 ENA

v oravol1_old - ENABLED ACTIVE 40960 SELECT - fsgen
pl oravol1-01 oravol1_old ENABLED ACTIVE 40960 CONCAT - RW
sd exam3-01 oravol1-01 exam3 0 40960 0 disk_3 ENA
bash-3.00# vxvol -g examdg start oravol1

3.Re-mirror the volume back to normal.

bash-3.00# vxplex -g examdg dis oravol1-01
VxVM vxplex ERROR V-5-1-16548 Plex oravol1-01, volume oravol1_old: Dissociating last plex requires use of -f
bash-3.00# vxplex -g examdg -f dis oravol1-01
bash-3.00# vxprint -hvt
v oravol1 - ENABLED ACTIVE 40960 ROUND - gen
pl oravol1-02 oravol1 ENABLED ACTIVE 40960 CONCAT - RW
sd exam1-02 oravol1-02 exam1 40960 40960 0 isk_1 ENA

v oravol1_old - ENABLED ACTIVE 40960 SELECT - fsgen

bash-3.00# vxedit -g examdg -rf rm oravol1_old
bash-3.00# vxplex -g examdg -f att oravol1 oravol1-01
bash-3.00# vxprint -hvt
v oravol1 - ENABLED ACTIVE 40960 ROUND - gen
pl oravol1-01 oravol1 ENABLED ACTIVE 40960 CONCAT - RW
sd exam3-01 oravol1-01 exam3 0 40960 0 disk_3 ENA
pl oravol1-02 oravol1 ENABLED ACTIVE 40960 CONCAT - RW
sd exam1-02 oravol1-02 exam1 40960 40960 0 disk_1 ENA
Now we are back to normal operation. 


Thank you for reading this article.Please leave a comment if you have any doubt ,i will get back to you as soon as possible.
Exit mobile version