Sunday, May 24, 2009

Solution 215981 : Cold Backup of Oracle using Volume Manager Snapshot

Here is the procedure to create a snapshot of a volume containing an Oracle
database. This assumes the database is built on a file system :

1) vxassist -g snapstart

2) When the snapstart operation is complete and the mirror is in the SNAPDONE
state for the newly created plex (this can be determined through vxprint -ht
), find a time to complete the snapshot operation. This is the
point where you would bring down the oracle db and kick the users out. When
Oracle is down, execute this command:

# vxassist -g snapshot

3) When this operation is finished, you can bring Oracle online and then perform
an fsck of the snapshot:

# fsck -y /dev/vx/rdsk//

4) Next, backup the snapshot volume using your data backup utility and then the
snapshot can be removed using:

# vxedit -g -rf rm

Look at the following example:

bigwillie# vxprint -g bigdg -ht oracle
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE

v oracle fsgen ENABLED ACTIVE 102400 SELECT -
pl oracle-01 oracle ENABLED ACTIVE 104139 CONCAT - RW
sd bigdg13-01 oracle-01 bigdg13 0 104139 0 c2t26d0 ENA
pl oracle-02 oracle ENABLED ACTIVE 104139 CONCAT - RW
sd bigdg11-02 oracle-02 bigdg11 64638 104139 0 c2t24d0 ENA
bigwillie# vxassist -g bigdg snapstart oracle
bigwillie# df -k /oraclemnt
Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/bigdg/oracle
51200 1117 46960 3% /oraclemnt
bigwillie# umount /oraclemnt
bigwillie# vxprint -g bigdg -ht oracle
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE

v oracle fsgen ENABLED ACTIVE 102400 SELECT -
pl oracle-01 oracle ENABLED ACTIVE 104139 CONCAT - RW
sd bigdg13-01 oracle-01 bigdg13 0 104139 0 c2t26d0 ENA
pl oracle-02 oracle ENABLED ACTIVE 104139 CONCAT - RW
sd bigdg11-02 oracle-02 bigdg11 64638 104139 0 c2t24d0 ENA
pl oracle-03 oracle ENABLED SNAPDONE 104139 CONCAT - WO
sd bigdg05-02 oracle-03 bigdg05 208278 104139 0 c2t19d0 ENA
bigwillie# vxassist -g bigdg snapshot oracle oraclesnap
bigwillie# vxprint -g bigdg -ht oracle oraclesnap
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE

v oracle fsgen ENABLED ACTIVE 102400 SELECT -
pl oracle-01 oracle ENABLED ACTIVE 104139 CONCAT - RW
sd bigdg13-01 oracle-01 bigdg13 0 104139 0 c2t26d0 ENA
pl oracle-02 oracle ENABLED ACTIVE 104139 CONCAT - RW
sd bigdg11-02 oracle-02 bigdg11 64638 104139 0 c2t24d0 ENA

v oraclesnap fsgen ENABLED ACTIVE 102400 ROUND -
pl oraclesnap-01 oraclesnap ENABLED ACTIVE 104139 CONCAT - RW
sd bigdg05-02 oraclesnap-01 bigdg05 208278 104139 0 c2t19d0 ENA
bigwillie# mount /dev/vx/dsk/bigdg/oracle /oraclemnt
bigwillie# fsck -y /dev/vx/rdsk/bigdg/oraclesnap
file system is clean - log replay is not required
bigwillie#

-Backup up the /dev/vx/rdsk/bigdg/oracle device-

bigwillie# vxedit -g bigdg -rf rm oraclesnap

No comments:

Post a Comment