This section describes a procedure for implementing off-host online backup for a volume in a private disk group. It outlines how to set up a regular backup cycle. It is beyond the scope of this guide to describe how to configure a database to use this procedure, or how to perform the backup itself.
To back up a volume in a private disk group
On the primary host, use the following command to see if the volume is associated with a version 20 data change object (DCO) and DCO volume that allow instant snapshots and Persistent FastResync to be used with the volume:
# vxprint -g volumedg -F%instant volume
If the volume can be used for instant snapshot operations, this command returns on; otherwise, it returns off.
If the volume was created under VxVM 4.0 or a later release, and it is not associated with a new-style DCO object and DCO volume, add a version 20 DCO and DCO volume.
See Preparing a volume for DRL and instant snapshots.
If the volume was created before release 4.0 of VxVM, and has any attached snapshot plexes, or is associated with any snapshot volumes, upgrade the volume to use a version 20 DCO.
On the primary host, use the following command to check whether FastResync is enabled on the volume:
# vxprint -g volumedg -F%fastresync volume
If FastResync is enabled, this command returns on; otherwise, it returns off.
If FastResync is disabled, enable it using the following command on the primary host:
# vxvol -g volumedg set fastresync=on volume
On the primary host, create a new volume in a separate disk group for use as the snapshot volume.
It is recommended that a snapshot disk group is dedicated to maintaining only those disks that are used for off-host processing.
On the primary host, link the snapshot volume in the snapshot disk group to the data volume. Enter the following:
# vxsnap -g volumedg -b addmir volume mirvol=snapvol \ mirdg=snapvoldg
You can use the vxsnap snapwait command to wait for synchronization of the linked snapshot volume to complete. Enter the following:
# vxsnap -g volumedg snapwait volume mirvol=snapvol \ mirdg=snapvoldg
This step sets up the snapshot volumes, and starts tracking changes to the original volumes.
When you are ready to create a backup, go to step 5.
On the primary host, suspend updates to the volume that contains the database tables. A database may have a hot backup mode that lets you do this by temporarily suspending writes to its tables.
On the primary host, create the snapshot volume, snapvol, by running the following command:
# vxsnap -g volumedg make \ source=volume/snapvol=snapvol/snapdg=snapvoldg
If a database spans more than one volume, you can specify all the volumes and their snapshot volumes using one command, as follows:
# vxsnap -g dbasedg make \ source=vol1/snapvol=snapvol1/snapdg=sdg \ source=vol2/snapvol=snapvol2/snapdg=sdg \ source=vol3/snapvol=snapvol3/snapdg=sdg
On the primary host, if you temporarily suspended updates to a volume in step 5, release all the database tables from hot backup mode.
On the primary host, deport the snapshot volume's disk group using the following command:
# vxdg deport snapvoldg
On the OHP host where the backup is to be performed, use the following command to import the snapshot volume's disk group:
# vxdg import snapvoldg
The snapshot volume is initially disabled following the import. On the OHP host, use the following commands to recover and restart the snapshot volume:
# vxrecover -g snapvoldg -m snapvol # vxvol -g snapvoldg start snapvol
On the OHP host, back up the snapshot volume. If you need to remount the file system in the volume to back it up, first run fsck on the volume. The following are sample commands for checking and mounting a file system:
# fsck -t vxfs /dev/vx/dsk/snapvoldg/snapvol # mount -t vxfs /dev/vx/dsk/snapvoldg/snapvol mount_point
At this point, back up the file system and use the following command to unmount it:
# umount mount_point
On the OHP host, use the following command to deport the snapshot volume's disk group:
# vxdg deport snapvoldg
On the primary host, re-import the snapshot volume's disk group using the following command:
# vxdg import snapvoldg
The snapshot volume is initially disabled following the import. Use the following commands on the primary host to recover and restart the snapshot volume:
# vxrecover -g snapvoldg -m snapvol # vxvol -g snapvoldg start snapvol
On the primary host, reattach the snapshot volume to its original volume using the following command:
# vxsnap -g snapvoldg reattach snapvol source=vol \ sourcedg=volumedg
For example, to reattach the snapshot volumes svol1, svol2 and svol3:
# vxsnap -g sdg reattach svol1 \ source=vol1 sourcedg=dbasedg \ svol2 source=vol2 sourcedg=dbasedg \ svol3 source=vol3 sourcedg=dbasedg
You can use the vxsnap snapwait command to wait for synchronization of the linked snapshot volume to complete:
# vxsnap -g volumedg snapwait volume mirvol=snapvol
Repeat steps 5 through 15 each time that you need to back up the volume.