How Veritas vxsnap commands may be used to obtain a point-in-time snap copy of database data structure volumes for offhost backup.
book
Article ID: 100029755
calendar_today
Updated On:
Resolution
Snap Copy Procedures for a Database: Point-in-TimeSnap Copy for Off-host Backup RecoveryOperations
Description: These procedures demonstrates howVeritas vxsnap commands (FastResynch license required) may be used to obtainpoint-in-time snap copy of database data structure volumes for off-host backup.This involves using a second equivalent volume(s) --known as the snap volume--to obtain a fully synchronized point-in-time copy of a database can be quiesced(write I/O suspend) briefly followed by snap volume disk group deport-import(Disk Group Split-Join license required) for off-host tape backupoperation. This example operation assumes the database can be "suspended"and "resumed" and is using file containers (rather than raw devices) fordatabase storage structures under the management of Veritas-Veritas VolumeManager and VxFS. Also simulated is the vxsnap command operation for databasestructures recovery from off-host restoration from backup.
Prepare forDatabase Point-in-time Snap Copy Operation----
1. Create a databasevolume (note specific disk/LUNs used for primary volume)
HostA: #vxassist -g dg_db4prod make vol_db4prod1 20g layout=stripe stripeunit=128ncolumn=4 alloc=t21lun0,t21lun1,t31lun0,t31lun1
HostA: #vxprint -htgdg_db4prod
2. Add DCO (data change object) logging to the databasevolume (note disk/LUNs allocated)
HostA: # vxsnap -gdg_db4prod prepare vol_dbprod1 regionsize=64kalloc=t21lun0,t21lun1,t31lun0,t31lun1
HostA: #vxprint -htgdg_db4prod
3. Create a mirror (or plex) of the databasevolume (note specific disk/LUNs allocated for snap volume)
HostA: #vxsnap -b -g dg_db4prod addmirvol_db4prod1 alloc=t41lun0,t41lun1,t42lun2,t42lun3
[SF 5.0: #vxsnap -b -g dg_db4prod mirrorvol_db4prod1 alloc=t41lun0,t41lun1,t42lun2,t42lun3 ]
--monitor forcompletion: synchronization task
HostA: # vxtask -l list
HostA:#vxprint -htg dg_db4prod
Cyclic Database Point-in-time Snap Copyfor Off Host Tape Backup Operation----
4. Create the snapvolume with its DCO (note the targeted plex follows new snap volume)
Host A:# vxsnap -g dg_db4prod makesource=vol_db4prod1/newvol=snapvol_db4prod1/plex=vol_db4prod1-02
HostA:#vxprint -ht
5. Snap copy pre-synchronization
HostA:# vxsnap -b -g dg_db4prod refreshsnapvol_db4prod1 source=vol_db4prod1
--monitor forcompletion: synchronization task
HostA: #vxtask -llist
(Note: If substantial time has passed since step 4, you may need torepeat this command to reduce the synchronization for the limited databasequiesce time)
6. Make Database Quiescent: suspend writeIO
7. Snap copy point-in-time synchronization (synchronizevolumes during database suspend)
HostA: # vxsnap -b -g dg_db4prodrefresh snapvol_db4prod1 source=vol_db4prod1
--monitor forcompletion: synchronization task
HostA:# vxtask -llist
8. Cause the database to resume: resume writeIO
9. Split off the snap volume with its own diskgroup for deport to the backup host
HostA: #vxdg list
HostA: # vxdg splitdg_db4prod dgSnap4prod snapvol_db4prod1
HostA: #vxdglist
10. Deport the snap disk group from the databasehost
HostA: # vxdg deport dg_Snap4prod
HostA: #vxdisk -o alldgslist
11. Import the disk group into the backup host
HostC: #vxdg import dg_Snap4prod
HostC: #vxdisk -o alldgslist
12. Restart volumes after the import
HostC: #vxprint-htg dg_Snap4pord
HostC: # vxrecover -s -g dg_Snap4prod
HostC: #vxprint-htg dg_Snap4pord
13. Mount read-only the file system of thevolume
HostC: # mount -r -F vxfs -o ro,largefiles,suid/dev/vx/dsk/dg_Snap4prod/snapvol_db4prod1 /db4prod1
14. IssueBackup Operation to copy file system /db4prod1 to tape
Forexample:
Netbackup Master: /usr/openv/netbackup/bin/bpbackup -i -cdomainc_dbpbib01_snap
15. Monitor tape backup operation forcompletion
----Return thevolume to the database server host ----
16. Unmount the filesystem
(Normally "-f" is not recommended; in this case it is nota problem for read-only file system)
HostC: # umount-f /db4prod1
17. Deport the snap disk group from the backuphost
HostC: #vxdg list
HostC: # vxdg deport dg_Snap4prod
HostC: #vxdglist
18. Import the snap disk group into the database serverhost
HostA: # vxdisk -o alldgs list
HostA: # vxdg importdg_Snap4prod
19. Merge imported disk group into the production diskgroup.
HostA: # vxdg join dg_Snap4prod dg_db4prod
HostA: # vxprint -htgdg_db4prod
20. Restart the snap volume after disk group import
HostA: # vxprint -htg dg_db4prod
HostA: # vxrecover -s -gdg_db4prod
HostA: # vxprint -htg dg_db4prod
21. Re-attach thesnap volume as an additional plex to the primary volume
HostA: # vxsnap -gdg_db4prod reattach snapvol_db4prod1 source=vol_db4prod1
--monitor forcompletion: synchronization task
HostA: # vxprint -htgdg_db4prod
#vxprint -g -F%incomplete
(SF5.0 nowsupports #vxsnap -g snapwait as follow-oncommand)
22. To begin a future Snap Copy Backup Operation return tostep 4 above.
Database Recovery: Restorefrom backup tape or current snap volume----
a. Netbackuprestore from tape : /db4prod1 file system
d. Unmountthe file system
HostC: # umount -f /db4prod1
b. Deport thesnap disk group from the backup host
HostC: # vxdgdeport dg_Snap4prod
c. Import the snap disk group into thedatabase server host
HostC: # vxdg import dg_Snap4prod
d. Mergethe snap disk group with the primary disk group
HostA: # vxdg joindg_Snap4prod dg_db4prod
e. Restart the snap volumes
HostA: #vxrecover -s -g dg_db4prod
f. Stop the database for restore andrecovery
g. Unmount thedatabase file system
HostA: #umount /db4prod1
(Caution: you might use "-f";make sure users or applications are not writing to the filesystem)
h. Synchronize from snap copy volume to the primarydatabase volume
HostA:# vxsnap -g dg_db4prod restore vol_db4prod1source=snapvol_db4prod1 syncing=yes
--monitor forcompletion: synchronization task
HostA: # vxtask -llist
j. Mount the database file system
HostA: # mount -F vxfs -orw,largefiles,suid /dev/vx/dsk/dg_db4prod/vol_db4prod1 /db4prod1
k. Startdatabase with appropriate database log "rollforward"
Created by Wes Ramirez, 09July07
Issue/Introduction
How Veritas vxsnap commands may be used to obtain a point-in-time snap copy of database data structure volumes for offhost backup.
Was this article helpful?
thumb_up
Yes
thumb_down
No