You can use Database FlashSnap to create a clone of a database by performing the steps outlined inFigure 15-3.
151 Administering third-mirror break-off snapshots Creating a clone of a database by using Database FlashSnap
Figure 15-3 Creating a Clone - Workflow Setdefaults
(create configuration
file)
Clone Mount
Snap Validate
See“vxsfadm command reference”on page 282.
See“FlashSnap configuration parameters”on page 286.
See“FlashSnap supported operations”on page 288.
For details, refer tovxsfadm-flashsnap(1M) andvxsfadm-oracle-flashsnap(1M) man pages.
152 Administering third-mirror break-off snapshots Creating a clone of a database by using Database FlashSnap
To create a clone of an Oracle database by using FlashSnap 1 Create a configuration file.
$ /opt/VRTS/bin/vxsfadm -s flashsnap \
-o setdefaults -a oracle --oracle_sid sfaedb \ --oracle_home /ora_base/db_home -c TEST1 Written config file TEST1
This command creates a default configuration file at the location mentioned by the argument given to the -c option. If a path is not specified, then the configuration file is created in the present working directory with all the parameters and default values. You can change the parameters, if required.
Note: If a configuration file with the specified name already exists, then specify a unique configuration name, different path, or remove the existing configuration file. Also, the delete operation does not delete this configuration file.
153 Administering third-mirror break-off snapshots Creating a clone of a database by using Database FlashSnap
2 Validate the setup.
$ /opt/VRTS/bin/vxsfadm -s flashsnap \ -o validate -a oracle --oracle_sid sfaedb \ --oracle_home /ora_base/db_home --flashsnap_name \ TEST1 --app_mode online
Validating database configuration for third-mirror-break-off snapshot:
ORACLE_SID = sfaedb
ORACLE_HOME = /ora_base/db_home APP_MODE = online
SNAPSHOT_ARCHIVE_LOG = yes REVERSE_RESYNC_ARCHIVE_LOG = no REVERSE_RESYNC_RECOVERY = auto ARCHIVELOG_DEST = /arch/sfaedb Database validation successful.
Validating database volume layout for third-mirror-break-off snapshot:
Data volumes ready for snapshot:
Volume/volume-set datavol of diskgroup datadg mounted on /data.
Archivelog volume ready for snapshot:
Volume/volume-set archvol of diskgroup datadg mounted on /arch.
Storage units to be used for snapshot from diskgroup datadg:
vmdk0_25 vmdk0_27
SNAPSHOT_VOL_PREFIX = SNAP_
SNAPSHOT_DG_PREFIX = SNAP_
Database volume layout validated successfully.
This command validates the configuration file and the database environment.
In case of any problem, appropriate error messages are displayed that you can use to correct the problem and then retry.
154 Administering third-mirror break-off snapshots Creating a clone of a database by using Database FlashSnap
3 Create a snapshot of the database.
$ /opt/VRTS/bin/vxsfadm -s flashsnap \
-o snap -a oracle --oracle_sid sfaedb --oracle_home \ /ora_base/db_home --flashsnap_name TEST1 \
--app_mode online
Validating database configuration for third-mirror-break-off snapshot:
ORACLE_SID = sfaedb
snapshot started at Mon Aug 26 10:33:35 2013.
Putting database in backup mode ... Done
Validating database volume layout for third-mirror-break-off snapshot:
Data volumes ready for snapshot:
Volume/volume-set datavol of diskgroup datadg mounted on /data.
Archivelog volume ready for snapshot:
Volume/volume-set archvol of diskgroup datadg mounted on /arch.
Storage units to be used for snapshot from diskgroup datadg:
emc0_7 emc0_5
SNAPSHOT_VOL_PREFIX = SNAP_
SNAPSHOT_DG_PREFIX = SNAP_
Database volume layout validated successfully.
Creating snapshot volumes for data volumes ... Done Taking database out of backup mode ... Done
Flushing online redo logs ... Done
Creating snapshot volume for archivelog volume ... Done Copying snapshot information to snapshot volume ... Done Creating snapshot diskgroups ... Done
Deporting snapshot diskgroups ... Done SNAP_datadg
snapshot ended at Tue Aug 27 00:33:54 2013.
This command breaks the user-specified mirror ( parameterSNAPSHOT_PLEX_TAG ) from the primary volumes and creates a new disk group with the name starting with the string defined in thesnap_dg_prefixparameter. The default value of this parameter is SNAP_.
When you create a snapshot, the broken-off mirrors are split off into a different disk group that is referred to as the snapshot disk group. The mirrors are the
155 Administering third-mirror break-off snapshots Creating a clone of a database by using Database FlashSnap
only components that are present in the snapshot disk group. If additional objects, such as cache objects, must be moved from the original disk group to the snapshot disk group, you can use the EXTRA_OBJECTS parameter to specify these additional objects.
See“FlashSnap configuration parameters”on page 286.
Note: At the validation stage, all the parameters, including the mandatory parameters--oracle_sidand--flashsnap_name, are read and stored in the repository.
If you need to change any parameter, change the configuration file and specify it with the-coption.
156 Administering third-mirror break-off snapshots Creating a clone of a database by using Database FlashSnap
4 Mount the snapshot.
$ /opt/VRTS/bin/vxsfadm -s flashsnap \ -o mount -a oracle --oracle_sid sfaedb \
--oracle_home /ora_base/db_home --flashsnap_name TEST1
Retrieving snapshot information ... Done
Importing snapshot diskgroups ... Done
Mounting snapshot volumes ... Done
Note: This command mounts the snapshot on the host to which storage is attached. The secondary host is the system defined in the SECONDARY_HOST parameter of the configuration file.
By default, volumes are mounted under the/var/tmpfile system.
If you need to specify an alternate location for mounting snapshot volumes, either provide CLONE_PATH on the command line or from the configuration file.
For performing off-host operations, specify the SFDB repository host using the -roption of thevxsfadmcommand.
$ vxsfadm -s flashsnap -a oracle -o mount \
--oracle_sid sfaedb --flashsnap_name TEST1 --clone_path /cloneoracle
Note: Ensure that the Oracle user has the required permissions to create the /cloneoracledirectory, if it does not exist.
157 Administering third-mirror break-off snapshots Creating a clone of a database by using Database FlashSnap
5 Clone the database based on the snapshot.
$ /opt/VRTS/bin/vxsfadm -s flashsnap -o clone \
-a oracle --oracle_sid sfaedb --oracle_home /ora_base/db_home \ --flashsnap_name TEST1 --clone_name clone1
Retrieving snapshot information ... Done Importing snapshot diskgroups ... Done Mounting snapshot volumes ... Done
Preparing parameter file for clone database ... Done Mounting clone database clone1 ... Done
Starting database recovery ...
Clone database clone1 is open.
If you have not specified clone_name, it is automatically generated.
Note: If you have already specified the clone_name and the clone_path parameters in the configuration file that was used during the validate operation, the clone_name parameter is not required on the command line.
If you need to change a memory tuning parameter of the database clone such as memory_target , you can specify a modified pfile during the clone operation.