Creating a clone of an Oracle database by using space-optimized snapshots

You can use space-optimized snapshots to create a clone of an Oracle database by performing the following procedure.

For details, refer to vxsfadm-sos(1M) and vxsfadm-oracle-sos(1M) man pages.

To create a clone of an Oracle database by using space-optimized snapshots

  1. Create a configuration file.
    $ /opt/VRTSdbed/bin/vxsfadm -s sos -a oracle \
     -o setdefaults --oracle_sid sfaedb --oracle_home /ora_base/db_home \
     --sos_name TEST1 -c dailyconfig
    Written config file dailyconfig

    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 destroy operation does not delete a configuration file.

  2. Validate the setup.
    $ /opt/VRTSdbed/bin/vxsfadm -s sos -a oracle -o validate --oracle_sid \
    sfaedb --oracle_home /ora_base/db_home --sos_name TEST1
    Validating database configuration for space-optimized snapshot:
    ORACLE_SID = sfaedb
    ORACLE_HOME = /ora_base/db_home
    APP_MODE = online
    ARCHIVELOG_DEST = /arch/sfaedb
    SNAPSHOT_ARCHIVE_LOG = yes
    Database validation successful.
    Validating database volume layout for space-optimized 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.
    CACHE_OBJECT = datadg:cacheobj
    SNAPSHOT_VOL_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.

  3. Create a space-optimized snapshot of the database.
    $ /opt/VRTSdbed/bin/vxsfadm -s sos -a oracle \
    -o snap --oracle_sid sfaedb --oracle_home /ora_base/db_home \
    --sos_name TEST1
    Validating database configuration for space-optimized snapshot:
    ORACLE_SID = sfaedb
    ORACLE_HOME = /ora_base/db_home
    APP_MODE = online
    ARCHIVELOG_DEST = /arch/sfaedb
    SNAPSHOT_ARCHIVE_LOG = yes
    Database validation successful.
    Putting database in backup mode ... Done
    Validating database volume layout for space-optimized 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.
    CACHE_OBJECT = datadg:cacheobj
    SNAPSHOT_VOL_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

    This command creates space-optmized snapshot volumes from the primary volumes by using the specified cache objects.

    Note:

    At the validation stage, all the parameters, including the mandatory parameters --oracle_sid and --sos_name, are read and stored in the repository.

  4. Mount the snapshot.
    $ /opt/VRTSdbed/bin/vxsfadm -s sos -a oracle \
    -o mount --oracle_sid sfaedb --oracle_home /ora_base/db_home \
    --sos_name TEST1
    Mounting snapshot volumes ...                           Done

    If you need to specify the clone path, use the CLONE_PATH variable. If this variable is not specifed, the snapshot is mounted under the /var/tmp directory, by default.

    $ vxsfadm -s sos -a oracle -o mount --oracle_sid  sfaedb \
    --sos_name TEST1 --clone_path /cloneoracle

    Note:

    Ensure that the Oracle user has the required permissions to create the /cloneoracle directory, if it does not exist.

  5. Clone the database based on the snapshot.
    $ /opt/VRTSdbed/bin/vxsfadm -s sos -a oracle -o clone \
    --oracle_sid sfaedb --oracle_home /ora_base/db_home \
    --sos_name TEST1
    Preparing parameter file for clone database ...         Done
    Mounting clone database ...                             Done
    Starting database recovery ...
    Clone database sfaOjqwF is open.

    If you have not specified clone_name, it is automatically generated.

    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.

You can also use space-optimized snapshots in a replicated environment.

See Considerations for using volume snapshots with VVR.

See Creating space-optimized snapshots in a VVR setup.

More Information

vxsfadm command reference

Space-optimized snapshots configuration parameters

Space-optimized snapshots supported operations