With Database FlashSnap, you can mirror the volumes used by the database to a separate set of disks, and those mirrors can be used to create a snapshot of the database. These snapshot volumes can be split and placed in a separate disk group. This snapshot disk group can be imported on a separate host, which shares the same storage with the primary host. The snapshot volumes can be resynchronized periodically with the primary volumes to get recent changes of the datafiles. If the primary datafiles become corrupted, you can quickly restore them from the snapshot volumes. Snapshot volumes can be used for a variety of purposes, including backup and recovery, and creating a clone database.
You must create snapshot mirrors for all of the volumes used by the database datafiles before you can create a snapshot of the database. This section describes the procedure used to create snapshot mirrors of volumes.
Use the vxsnap
CLI command to create a snapshot mirror or synchronize a snapshot mirror.
Caution The procedure given in this section is for existing volumes without existing snapshot plexes or associated snapshot volumes.
To create a snapshot mirror of a volume or volume set
Note
In the following procedure, volume_name
is the name of either a volume or a volume set.
vxsnap prepare
command:
# vxsnap -g
diskgroup
prepare
volume
\
Note
The vxsnap
prepare command automatically creates a DCO and DCO volumes and associates them with the volume, and enables Persistent FastResync on the volume. Persistent FastResync is also set automatically on any snapshots that are generated from a volume on which this feature is enabled.
For enabling persistent FastResync on a volume in VxVM 5.0, either from the command line or from within a script, use the vxsnap prepare
command as described above.
vxprint
command:
# vxprint -g
diskgroup -F%fastresync
volume_name
This returns on
if FastResync is on. Otherwise, it returns off
.
# vxprint -g
diskgroup -F%hasdcolog
volume_name
This returns on
if a DCO and DCO log volume are attached to the volume. Otherwise, it returns off
.
# vxsnap -g
diskgroup addmir
volume_name alloc=
diskname
There is no option for creating multiple mirrors at the same time. Only one mirror can be created at a time.
# vxprint -g
diskgroup -F%name -e"pl_v_name in \"volume_name\""
Note The following two steps enable database FlashSnap to locate the correct mirror plexes when creating snapshots.
# vxedit -g
diskgroup set putil2=
dbed_flashsnap
plex_name
# vxprint -g
diskgroup -F%name -e"pl_v_name in \"volume_name\"
\ && p2 in \"
dbed_flashsnap
\""
If you require a backup of the data in the snapshot, use an appropriate utility or operating system command to copy the contents of the snapshot to tape or to some other backup medium.
This example shows the steps involved in creating a snapshot mirror for the volume data_vol
belonging to the disk group PRODdg
.
data_vol
for mirroring:
data_vol
:
# vxprint -g PRODdg -F%name -e"pl_v_name in \"data_vol\""
Note
Choose the plex that is in the SNAPDONE
state. Use the vxprint -g
diskgroup
command to identify the plex that is in the SNAPDONE
state.
dbed_flashsnap
tag for it:
dbed_flashsnap
tag has been set to the desired data plex, data_vol-02
:
# vxprint -g PRODdg -F%name -e"pl_v_name in \"data_vol\"
\&& p2 in \"
dbed_flashsnap
\""
vxprint -g <dg>
command as follows:
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
dm PRODdg01 c1t2d0s2 - 35358848 - - - -
dm PRODdg02 c1t3d0s2 - 17674896 - - - -
dm PRODdg03 c1t1d0s2 - 17674896 - - - -
v data_vol fsgen ENABLED 4194304 - ACTIVE - -
pl data_vol-01 data_vol ENABLED 4194304 - ACTIVE - -
sd PRODdg03-01 data_vol-01 ENABLED 4194304 0 - - -
pl data_vol-02 data_vol ENABLED 4194304 - SNAPDONE - -
sd PRODdg02-01 data_vol-02 ENABLED 4194304 0 - - -
dc data_vol_dco data_vol - - - - - -
v data_vol_dcl gen ENABLED 560 - ACTIVE - -
pl data_vol_dcl-01 data_vol_dcl ENABLED 560 - ACTIVE - -
sd PRODdg01-01 data_vol_dcl-01 ENABLED 560 0 - - -
pl data_vol_dcl-02 data_vol_dcl DISABLED 560 - DCOSNP - -
sd PRODdg02-02 data_vol_dcl-02 ENABLED 560 0 - - -
Identify that the specified plex is in the SNAPDONE
state. In this example, it is data_vol-02
.
The snapshot mirror is now ready to be used.