Previous  |  Next  >  
Product: Storage Foundation Guides   
Manual: Storage Foundation 4.1 FlashSnap Point-In-Time Copy Solutions Administrator's Guide   

Making a Backup of an Online Database on the Same Host

As illustrated in Example System Configuration for Database Backup on the Primary Host, the primary database volumes to be backed up, dbase_vol and dbase_logs, are configured on disks attached to controllers c1 and c2, and the snapshots are created on disks attached to controllers c3 and c4.

Example System Configuration for Database Backup on the Primary Host

Example System Configuration for Database Backup on the Primary Host

Click the thumbnail above to view full-sized image.


Note   Note    It is assumed that you have already prepared the volumes containing the file systems for the datafiles to be backed up as described in Setting up Volumes for Instant Snapshots. For an Oracle database, it is not necessary to create snapshots of the volumes containing the file systems for the redo log volumes or archived logs.

To make a backup of an online database on the same host:

  1. Use the following command to make a full-sized snapshot, snapvol, of the tablespace volume by breaking off plexes from the original volume:
    vxsnap -g volumedg make source=volume/newvol=snapvol/nmirror=N

    The nmirror attribute specifies the number of mirrors, N, in the snapshot volume.

    If the volume does not have any available plexes, or its layout does not support plex break-off, use the procedure described in Creating a Volume for Use as a Full-Sized Instant Snapshot to prepare an empty volume for the snapshot, and then use the following command to create the snapshot:


    vxsnap -g volumedg make source=volume/snapvol=snapvol

    If a database spans more than one volume, specify all the volumes and their snapshot volumes as separate tuples on the same line, for example:


    # vxsnap -g dbasedg make source=vol1/newvol=svol1 \
    source=vol2/newvol=svol2 source=vol3/newvol=svol3

    If you want to save disk space, you can use the following command to create a space-optimized snapshot instead:


    # vxsnap -g volumedg make \
    source=
    volume/newvol=snapvol/cache=cacheobject

    The argument cacheobject is the name of a pre-existing cache that you have created in the disk group for use with space-optimized snapshots. See Creating a Shared Cache Object for more information.

    If several space-optimized snapshots are to be created at the same time, these can all specify the same cache object as shown in this example:


    # vxsnap -g dbasedg make source=vol1/newvol=svol1/cache=dbaseco \
    source=vol2/newvol=svol2/cache=dbaseco \
    source=vol3/newvol=svol3/cache=dbaseco

    Note   Note    This step sets up the snapshot volumes ready for the backup cycle, and starts tracking changes to the original volumes. When you are ready to make a backup, proceed to step 2.
  2. If the volumes to be backed up contain database tables in file systems, suspend updates to the volumes:

    • DB2 provides the write suspend command to temporarily suspend I/O activity for a database. As the DB2 database administrator, use a script such as that shown in Script to Suspend I/O for a DB2 Database. Note that to allow recovery from any backups taken from snapshots, the database must be in LOGRETAIN RECOVERY mode.
    • Oracle supports online backup by temporarily suspending updates to the datafiles of the tablespaces, provided that the database is running in archive mode and the tablespaces are online. As the Oracle database administrator, put each tablespace into hot backup mode using a script such as that shown in Script to Put Oracle Database into Hot Backup Mode.
    • Sybase ASE from version 12.0 onward provides the Quiesce feature to allow temporary suspension of writes to a database. As the Sybase database administrator, put the database in quiesce mode by using a script such as that shown in Script to Quiesce Sybase ASE Database.

  3. Refresh the contents of the snapshot volumes from the original volume using the following command:
    vxsnap -g volumedg refresh snapvol source=vol \
      [snapvol2 source=vol2]... 

    For example, to refresh the snapshots svol1, svol2 and svol3:


    # vxsnap -g dbasedg refresh svol1 source=vol1 svol2 source=vol2 \
    svol3 source=vol3
  4. If you temporarily suspended updates to volumes in step 1, release all the tablespaces or databases from suspend, hot backup or quiesce mode:

  5. 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 -F vxfs /dev/vx/rdsk/snapvoldg/snapvol
    mount -F vxfs /dev/vx/dsk/snapvoldg/snapvol mount_point
    Note   Note    On Linux, use the -t option, and on AIX, use the -V option, instead of the -F option for both commands.

    Back up the file system at this point using a command such as bpbackup in VERITAS NetBackup. After the backup is complete, use the following command to unmount the file system.


    unmount mount_point

Repeat steps 2 through 5 each time that you need to back up the volume.

In some instances, such as recovering the contents of a corrupted volume, it may be useful to resynchronize a volume from its snapshot volume (which is used as a hot standby):


vxsnap -g diskgroup restore volume source=snapvol destroy=yes|no

The destroy attribute specifies whether the plexes of the snapshot volume are to be reattached to the original volume. For example, to resynchronize the volume dbase_vol from its snapshot volume snap2_dbase_vol without removing the snapshot volume:


# vxsnap -g dbasedg restore dbase_vol source=snap2_dbase_vol \
destroy=no

Note   Note    You must shut down the database and unmount the file system that is configured on the original volume before attempting to resynchronize its contents from a snapshot.
 ^ Return to Top Previous  |  Next  >  
Product: Storage Foundation Guides  
Manual: Storage Foundation 4.1 FlashSnap Point-In-Time Copy Solutions Administrator's Guide  
VERITAS Software Corporation
www.veritas.com