Previous  |  Next  >  
Product: Storage Foundation for Databases Guides   
Manual: Storage Foundation 4.1 for Oracle Administrator's Guide   

Creating a Snapplan (dbed_vmchecksnap)

The dbed_vmchecksnap command creates a snapplan that dbed_vmsnap uses to create a snapshot of an Oracle database. The snapplan specifies snapshot scenarios (such as online, offline, or instant).

You can name a snapplan file whatever you choose. Each entry in the snapplan file is a line in parameter=argument format.

When using dbed_vmchecksnap to create or validate a snapplan, the following parameters are set:

Parameter Value

SNAPSHOT_VERSION

Specifies the snapshot version for this major release of VERITAS Storage Foundation for Oracle.

PRIMARY_HOST

The name of the host where the primary database resides.

SECONDARY_HOST

The name of the host where the database will be imported.

PRIMARY_DG

The name of the VxVM disk group used by the primary database.

SNAPSHOT_DG

The name of the disk group containing the snapshot volumes.

The snapshot volumes will be put into this disk group on the primary host and deported. The secondary host will import this disk group to start a clone database.

ORACLE_SID

The name of the Oracle database. By default, the name of the Oracle database is not included in the snapplan.

ARCHIVELOG_DEST

The full path of the archive logs.

There are several archive log destinations that can be used for database recovery if you are muliplexing the archive logs. You must specify which archive log destination to use.

It is recommended that you have the archive log destination on a separate volume if SNAPSHOT_ARCHIVE_LOG is yes.

SNAPSHOT_ARCHIVE_LOG

yes or no

Specifies whether to create a snapshot of the archive log volumes. Specify yes to split the archive log volume mirrors and deport them to the secondary host. When using the Oracle remote archive log destination feature to send the archive logs to the secondary host, you can specify no to save some space.

Because the archive logs may not always be delivered to the secondary host reliably, it is recommended that you specify yes.

SNAPSHOT_MODE

online or offline or instant

Specifies whether the database snapshot should be online, offline, or instant.

If the snapshot is created while the database is online, the dbed_vmsnap command will put the tablespaces into backup mode. After dbed_vmsnap finishes creating the snapshot, it will take the tablespaces out of backup mode, switch the log files to ensure that the extra redo logs are archived, and create a snapshot of the archived logs.

If the database if offline, it is not necessary to put the tablespaces into backup mode. The database must be shut down before creating an offline snapshot.

If the database snapshot is instant, dbed_vmsnap will skip putting the tablespace into backup mode.



Note    If SNAPSHOT_MODE is set to offline or instant, a two-host configuration is required and the -r relocate_path option is not allowed.

SNAPSHOT_PLAN_FOR

The default value is database and cannot be changed.

Specifies the database object for which you want to create a snapshot.

SNAPSHOT_PLEX_TAG

Specifies the snapshot plex tag. Use this variable to specify a tag for the plexes to be snapshot. The maximum length of the plex_tag is 15 characters. The default plex tag is dbed_flashsnap.

SNAPSHOT_VOL_PREFIX

Specifies the snapshot volume prefix. Use this variable to specify a prefix for the snapshot volumes split from the primary disk group. A volume name cannot be more than 32 characters. You should consider the length of the volume name when assigning the prefix.

ALLOW_REVERSE_RESYNC

yes or no

By default, reverse resynchronization is off (set equal to no). If it is set to yes, data from the snapshot volume can be used to update the primary volume.

SNAPSHOT_MIRROR

Specifies the number of plexes to be snapshot. The default value is 1.

When you first run dbed_vmchecksnap, use the -o setdefaults option to create a snapplan using default values for variables. You may then edit the file manually to set the variables for different snapshot scenarios.


Note   Note    You cannot access Database FlashSnap commands (dbed_vmchecksnap, dbed_vmsnap, and dbed_vmclonedb) with the VxDBA menu utility.

Prerequisites

  • Storage must be configured as specified in Preparing Hosts and Storage for Database FlashSnap.
  • You must be the Oracle database administrator.
  • The disk group must be version 110 or later. For more information on disk group versions, see the vxdg(1M) manual page.
  • Be sure that a DCO and DCO volume are associated with the volume for which you are creating the snapshot.
  • Snapshot plexes and their associated DCO logs should be on different disks than the original plexes, and should be configured correctly for creating snapshots by the system administrator.
  • Persistent FastResync must be enabled on the existing database volumes and disks must be assigned for the snapshot volumes.
  • The database must be running in archive log mode. Archive log mode is set in the Oracle initialization parameter file (init.ora).
  • The Oracle database must have at least one mandatory archive destination. For further details, see Establishing a Mandatory Archive Destination.
  • ORACLE_HOME cannot reside on disk which will be used for snapshot.


Usage Notes

  • The snapplan must be created on the primary host.
  • After creating the snapplan using the dbed_vmchecksnap command, you can use a text editor to review and update the file, if necessary.
  • It is recommended that you create a local working directory to store your snapplans in.
  • See the dbed_vmchecksnap(1M) online manual page for more information.
  • If the SNAPSHOT_MODE for the database is set to online, the primary and secondary hosts can be the same. If the SNAPSHOT_MODE is set to offline or instant, the primary and secondary hosts must be different.

  To create a snapplan

  1. Change directories to the working directory you want to store your snapplan in.
    cd /working_directory
  2. Create a snapplan with default values using the dbed_vmchecksnap command:
    $ /opt/VRTS/bin/dbed_vmchecksnap -S ORACLE_SID \
    -H ORACLE_HOME -f SNAPPLAN -o setdefaults -t host_name \
    [-p PLEX_TAG]
  3. Open the snapplan file in a text editor and modify it as needed.

For information on creating a snapplan using the GUI, see Using the VERITAS Storage Foundation for Oracle Graphical User Interface.


Example

In this example, a snapplan, snap1, is created for a snapshot image in a single-host configuration and default values are set. The host is named host1 and the working directory is /export/snap_dir.


cd /export/snap_dir
$ /opt/VRTS/bin/dbed_vmchecksnap -S PROD \
-H /oracle/product/9i -f snap1 -o setdefaults -t host1

Snapplan snap1 for PROD.
=====================================================
SNAPSHOT_VERSION=4.0
PRIMARY_HOST=host1
SECONDARY_HOST=host1
PRIMARY_DG=PRODdg
SNAPSHOT_DG=SNAP_PRODdg
ORACLE_SID=PROD
ARCHIVELOG_DEST=/prod_ar
SNAPSHOT_ARCHIVE_LOG=yes
SNAPSHOT_MODE=online
SNAPSHOT_PLAN_FOR=database
SNAPSHOT_PLEX_TAG=dbed_flashsnapSNAPSHOT_VOL_PREFIX=SNAP_
ALLOW_REVERSE_RESYNC=no
SNAPSHOT_MIRROR=1

Example

In the following example, a snapplan, snap2, is created for a snapshot image in a two-host configuration, and default values are set. The primary host is host1, the secondary host is host2, and the working directory is /export/snap_dir.


cd /export/snap_dir
$ /opt/VRTS/bin/dbed_vmchecksnap -S PROD \
-H /oracle/product/9i -f snap2 -o setdefaults -t host2

Snapplan snap2 for PROD.
=====================================================
SNAPSHOT_VERSION=4.0
PRIMARY_HOST=host1
SECONDARY_HOST=host2
PRIMARY_DG=PRODdg
SNAPSHOT_DG=SNAP_PRODdg
ORACLE_SID=PROD
ARCHIVELOG_DEST=/mytest/arch
SNAPSHOT_ARCHIVE_LOG=yes
SNAPSHOT_MODE=online
SNAPSHOT_PLAN_FOR=database
SNAPSHOT_PLEX_TAG=dbed_flashsnap
SNAPSHOT_VOL_PREFIX=SNAP_
ALLOW_REVERSE_RESYNC=no
SNAPSHOT_MIRROR=1

By default, a snapplan's SNAPSHOT_PLEX_TAG value is set as dbed_flashsnap. You can use the -p option to assign a different tag name. Make use of the -p option when creating the snapplan with the setdefaults option.


Example

In the following example, the -p option is used with setdefaults to assign my_tag as the SNAPSHOT_PLEX_TAG value.


# dbed_vmchecksnap -S $ORACLE_SID -H $ORACLE_HOME -O setdefaults \
-p my_tag -f snap1 -t PROD

Snapplan snap1 for PROD
=====================================================
SNAPSHOT_VERSION=4.0
PRIMARY_HOST=host1
SECONDARY_HOST=host2
PRIMARY_DG=PRODdg
SNAPSHOT_DG=SNAP_PRODdg
ORACLE_SID=PROD
ARCHIVELOG_DEST=/arch_data
SNAPSHOT_ARCHIVE_LOG=yes
SNAPSHOT_MODE=online
SNAPSHOT_PLAN_FOR=database
SNAPSHOT_PLEX_TAG=my_tag
SNAPSHOT_VOL_PREFIX=SNAP_
ALLOW_REVERSE_RESYNC=no
SNAPSHOT_MIRROR=1

Creating Multi-mirror Snapshots

To make Database Snapshots highly available, the snapped snapshot volume should contain more than one mirror. This makes the snapshot volumes available even if one of the mirrors gets disabled. Snapshot volumes can be mounted and the entire database snapshot is usable even if one of the mirror gets disabled. The multi-mirror snapshots are enabled via SNAPSHOT_MIRROR=<n> in the snapplan.


Note   Note    There are no changes to the Command Line usage or arguments for the Flashsnap tools.

Note   Note    Before taking the snapshot, make sure all tagged snapshot mirrors are in SNAPDONE state.

The following sample explains the setup and the procedure for taking multi-mirror snapshots:

  1. Add the second mirror and DCO log. When allocating storage for the second mirror and DCO logs, make sure the snap volumes are splittable. If snap volumes are not splittable, dbed_vmchecksnap fails with appropriate errors.

    Tag the newly added mirror with the same tag as that of the first mirror.

    Assume that the volume has fastresync = on, has dcolog = on, and already has one SNAPDONE mirror and is tagged with dbed_flashsnap.


      # vxsnap -g dg_a  addmir dg_a_vol1 alloc=dg_a03
      # vxedit -g dg_a set putil2=dbed_flashsnap dg_a_vol1-03
  2. Add keyword to the snapplan.Here is a sample snapplan.
      SNAPSHOT_VERSION=4.0
      PRIMARY_HOST=host1
      SECONDARY_HOST=host1
      PRIMARY_DG=PRODdg
      SNAPSHOT_DG=SNAP_PRODdg
      ORACLE_SID=PROD
      ARCHIVELOG_DEST=/prod_ar
      SNAPSHOT_ARCHIVE_LOG=yes
      SNAPSHOT_MODE=online
      SNAPSHOT_PLAN_FOR=database
      SNAPSHOT_PLEX_TAG=dbed_flashsnap
      SNAPSHOT_VOL_PREFIX=SNAP_
      ALLOW_REVERSE_RESYNC=no
      SNAPSHOT_MIRROR=2

Establishing a Mandatory Archive Destination

When cloning a database using Database FlashSnap (see Cloning a Database (dbed_vmclonedb) for details), the Oracle database must have at least one mandatory archive destination, otherwise dbed_vmchecksnap results in this error message:


SFORA dbed_vmchecksnap ERROR V-81-5677 Could not find a mandatory, primary and valid archive destination for database PROD.
Please review the LOG_ARCHIVE_DEST_n parameters and check v$archive_dest.

This example shows how to establish a mandatory archive destination using SQL*Plus:


alter system set log_archive_dest_1 = 'LOCATION=/ora_mnt/oracle/oradata/PROD/archivelogs MANDATORY [REOPEN]' [scope=both];

For more information about Oracle parameters for archiving redo logs, see your Oracle documentation.

 ^ Return to Top Previous  |  Next  >  
Product: Storage Foundation for Databases Guides  
Manual: Storage Foundation 4.1 for Oracle Administrator's Guide  
VERITAS Software Corporation
www.veritas.com