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 primary database. If the primary containers 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 containers before you can create a snapshot of the database.
Before creating a snapshot mirror, make sure the following conditions have been met:
To create a snapshot mirror of a volume
vxassist -g diskgroup make volume_name size disk_name
# vxassist -g PRODdg make snapvset_1 8g data01
Create a DCO and enable FastResync on the volume:
vxsnap -g diskgroup prepare volume_name [alloc=storage_attribute]
# vxsnap -g PRODdg prepare snapvset alloc="snap01"
Verify that a DCO and DCO log are attached to the volume:
vxprint -g diskgroup -F%fastresync volume_name vxprint -g diskgroup -F%hasdcolog volume_name
This command returns on if a DCO and DCO log are attached to the specified volume.
# vxprint -g PRODdg -F%fastresync snapdata on # vxprint -g PRODdg -F%hasdcolog snapdata on
Create a mirror of the volume:
vxsnap -g diskgroup addmir volume_name [alloc=storage_attribute]
# vxsnap -g PRODdg addmir snapdata alloc="data02"
List the available mirrored data plex for the volume:
vxprint -g diskgroup -F%name -e"pl_v_name in \"volume_name\""
# vxprint -g PRODdg -F%name -e"pl_v_name in\"snapdata\"" snapdata-01 snapdata-02
Set the dbed_flashsnap tag on the break-off data plex for the volume:
vxedit -g diskgroup set putil2=dbed_flashsnap plex_name
# vxedit -g PRODdg set putil2=dbed_flashsnap snapdata-02
Verify that the dbed_flashsnap tag has been set on the data plex for each volume in the volume set:
vxprint -g diskgroup -F%name -e"pl_v_name in \"volume_name\" \ && p2 in \"dbed_flashsnap\""
# vxprint -g PRODdg -F%name -e"pl_v_name in \"snapdata\" \ && p2 in \"dbed_flashsnap\"" snapdata-02
Verify the disk group configuration:
vxprint -g diskgroup
# vxprint -g PRODdg TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 dg PRODdg PRODdg - - - - - - dm data01 Disk_17 - 33483648 - - - - dm data02 Disk_24 - 33483648 - - - - v snapdata fsgen ENABLED 16777216 - ACTIVE - - pl snapdata-01 snapdata ENABLED 16777216 - ACTIVE - - sd data01-01 snapdata-01 ENABLED 16777216 0 - - - pl snapdata-02 snapdata ENABLED 16777216 - SNAPDONE - - sd data02-01 snapdata-02 ENABLED 16777216 0 - - - dc snapdata_dco snapdata - - - - - - v snapdata_dcl gen ENABLED 1696 - ACTIVE - - pl snapdata_dcl-01 snapdata_dcl ENABLED 1696 - ACTIVE - - sd data01-02 snapdata_dcl-01 ENABLED 1696 0 - - - pl snapdata_dcl-02 snapdata_dcl DISABLED 1696 - DCOSNP - - sd data02-02 snapdata_dcl-02 ENABLED 1696 0 - - - |
To create a snapshot mirror of a volume set
vxassist -g diskgroup make volume_name size disk_name
# vxassist -g PRODdg make snapvset_1 8g snap01 # vxassist -g PRODdg make snapvset_2 4g snap01
Create a volume set for use by VxFS:
vxvset -g diskgroup -t vxfs make vset_name volume_name
# vxvset -g PRODdg -t vxfs make snapvset snapvset_1
Add the volume to the volume set:
vxvset -g diskgroup addvol vset_name volume_name
# vxvset -g PRODdg addvol snapvset snapvset_2
Create a DCO and enable FastResync on the volume set:
vxsnap -g diskgroup prepare vset_name [alloc=storage_attribute]
# vxsnap -g PRODdg prepare snapvset alloc="snap01"
Verify that a DCO and DCO log are attached to each volume in the volume set:
vxprint -g diskgroup -F%fastresync volume_name vxprint -g diskgroup -F%hasdcolog volume_name
This command returns on if a DCO and DCO log are attached to the specified volume.
# vxprint -g PRODdg -F%fastresync snapvset_1 on # vxprint -g PRODdg -F%fastresync snapvset_2 on # vxprint -g PRODdg -F%hasdcolog snapvset_1 on # vxprint -g PRODdg -F%hasdcolog snapvset_2 on
Create a mirror of the volume set volumes:
vxsnap -g diskgroup addmir vset_name [alloc=storage_attribute]
# vxsnap -g PRODdg addmir snapvset alloc="snap02"
List the available mirrored data plex for each volume in the volume set:
vxprint -g diskgroup -F%name -e"pl_v_name in \"volume_name\""
# vxprint -g PRODdg -F%name -e"pl_v_name in\"snapvset_1\"" snapvset_1-01 snapvset_1-02 # vxprint -g PRODdg -F%name -e"pl_v_name in\"snapvset_2\"" snapvset_2-01 snapvset_2-02
Set the dbed_flashsnap tag on the break-off data plex for each volume in the volume set:
vxedit -g diskgroup set putil2=dbed_flashsnap plex_name
# vxedit -g PRODdg set putil2=dbed_flashsnap snapvset_1-02 # vxedit -g PRODdg set putil2=dbed_flashsnap snapvset_2-02
Verify that the dbed_flashsnap tag has been set on the data plex for each volume in the volume set:
vxprint -g diskgroup -F%name -e"pl_v_name in \"volume_name\" \ && p2 in \"dbed_flashsnap\""
# vxprint -g PRODdg -F%name -e"pl_v_name in \"snapvset_1\" \ && p2 in \"dbed_flashsnap\"" snapvset_1-02 # vxprint -g PRODdg -F%name -e"pl_v_name in \"snapvset_2\" \ && p2 in \"dbed_flashsnap\"" snapvset_2-02
Verify the snapshot volume configuration:
vxprint -g diskgroup
# vxprint -g PRODdg TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 dg PRODdg PRODdg - - - - - - dm snap01 Disk_9 - 33483648 - - - - dm snap02 Disk_11 - 33483648 - - - - vt snapvset - ENABLED - - ACTIVE - - v snapvset_1 snapvset ENABLED 16777216 - ACTIVE - - pl snapvset_1-01 snapvset_1 ENABLED 16777216 - ACTIVE - - sd snap01-01 snapvset_1-01 ENABLED 16777216 0 - - - pl snapvset_1-02 snapvset_1 ENABLED 16777216 - SNAPDONE - - sd snap02-01 snapvset_1-02 ENABLED 16777216 0 - - - dc snapvset_1_dco snapvset_1 - - - - - - v snapvset_1_dcl gen ENABLED 1696 - ACTIVE - - pl snapvset_1_dcl-01 snapvset_1_dcl ENABLED 1696 - ACTIVE - - sd snap01-03 snapvset_1_dcl-01 ENABLED 1696 0 - - - pl snapvset_1_dcl-02 snapvset_1_dcl DISABLED 1696 - DCOSNP - - sd snap02-02 snapvset_1_dcl-02 ENABLED 1696 0 - - - v snapvset_2 snapvset ENABLED 8388608 - ACTIVE - - pl snapvset_2-01 snapvset_2 ENABLED 8388608 - ACTIVE - - sd snap01-02 snapvset_2-01 ENABLED 8388608 0 - - - pl snapvset_2-02 snapvset_2 ENABLED 8388608 - SNAPDONE - - sd snap02-03 snapvset_2-02 ENABLED 8388608 0 - - - dc snapvset_2_dco snapvset_2 - - - - - - v snapvset_2_dcl gen ENABLED 1120 - ACTIVE - - pl snapvset_2_dcl-01 snapvset_2_dcl ENABLED 1120 - ACTIVE - - sd snap01-04 snapvset_2_dcl-01 ENABLED 1120 0 - - - pl snapvset_2_dcl-02 snapvset_2_dcl DISABLED 1120 - DCOSNP - - sd snap02-04 snapvset_2_dcl-02 ENABLED 1120 0 - - - |
This example shows the steps involved in creating a snapshot mirror for the volume data_vol belonging to the disk group PRODdg.
Prepare the volume data_vol for mirroring:
# vxsnap -g PRODdg prepare data_vol alloc=PRODdg01
Verify that FastResync is enabled:
# vxprint -g PRODdg -F%fastresync data_vol on
Verify that a DCO and a DCO log are attached to the volume:
# vxprint -g PRODdg -F%hasdcolog data_vol on
Create a snapshot mirror of data_vol:
# vxsnap -g PRODdg addmir data_vol alloc=PRODdg02
# vxprint -g PRODdg -F%name -e"pl_v_name in \"data_vol\"" data_vol-01 data_vol-02
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.
Decide which data plex you want to use and set the tag name tag for it:
# vxedit -g PRODdg set putil2=PRODtag data_vol-02
Verify that the PRODtag 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 \"PRODtag\"" data_vol-02
To verify that the snapshot volume was created successfully, use the vxprint -g disk_group command as follows:
# vxprint -g PRODdg
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 5600 - - - - pl data_vol_dcl-02 data_vol_dcl DISABLED 560 - DCOSNP - - sd PRODdg02-02 data_vol_dcl-02 ENABLED 5600 - - - - |
Identify that the specified plex is in the SNAPDONE state. In this example, it is data_vol-02.