Creating space-optimized snapshots in a VVR setup

To use space-optimized snapshots in a Volume Replicator (VVR) based replication environment, you need to generate a snapshot configuration on the primary host and then use that configuration on the secondary host.

Figure: Space-Optimized Snapshots - Replicated Database Setup provides an overview of a replicated database setup where space-optimized snapshots can be used.

Figure: Space-Optimized Snapshots - Replicated Database Setup

Space-Optimized Snapshots - Replicated Database Setup

To create space-optimized snapshots in a VVR setup

  1. On the primary host, generate the snapshot configuration for the secondary host.
    $ opt/VRTSdbed/bin/vxsfadm -a oracle -o getvvrinfo
    Gathering offline data...                                Done
    
    ORACLE_SID           = sfaedb
    REPLICATION_ROLE     = secondary
    REPLICATION_DG_VOL   = orasecondarydg,orasecondarydg2:datavol
    SNAPSHOT_TIME        = Wed Feb 15 09:50:17 2012
    
    Configuration file /tmp/config1 is ready.
    Use this configuration file on replication
    secondary site for cloning application instance.

    Note:

    You do not need to specify the configuration name and the replication role. The same configuration file can be used on any secondary site for online mode or instant mode snapshots.

  2. Copy the newly generated snapshot configuration from the primary host to the secondary host.
  3. On the secondary host, validate the snapshot configuration, and then create the snapshot.
    $ /opt/VRTS/bin/vxsfadm -s sos -a oracle -o valid -c config1
    Validating database configuration for space-optimized snapshot:
    ORACLE_SID               = sfaedb
    ORACLE_HOME              = /ora_base/db_home
    APP_MODE                 = online
    Database validation successful.
    Validating database volume layout for space-optimized snapshot:
    REPLICATION_DG_VOL       = orasecondarydg,orasecondarydg2:datavol
    CACHE_OBJECT             = cacheobj
    Replicated data volumes ready for snapshot:
    Volume/volume-set datavol of diskgroup orasecondarydg.
    SNAPSHOT_VOL_PREFIX      = SNAP_
    Database volume layout validated successfully.
    $ opt/VRTS/bin/vxsfadm -s sos -a oracle  -o snap -c config1
    Creating snapshot volumes for data volumes ...                 Done

    After validating the snapshot configuration on the secondary host, you can perform operations such as clone and destroy, locally on the secondary host.

  4. On the secondary host, create a clone using the space-optimized snapshot.
    $ /opt/VRTS/bin/vxsfadm -s sos -a oracle -o clone -c config1
    Generated mount path: /var/tmp/az8EHWQpVe
    Mounting snapshot volumes ...                           Done
    Preparing parameter file for clone database ...         Done
    Mounting clone database ...                             Done
    Starting database recovery ...
    Clone database sfaHrtyd is open.
  5. On the secondary host, unmount and destroy the clone database, when you no longer need it.
    $ /opt/VRTS/bin/vxsfadm -s sos -a oracle -o unmount -c config1
    Shutting down clone database sfaHrtyd ...
    Database shut down.
    Unmounting snapshot volumes ...                         Done
    
    $ /opt/VRTS/bin/vxsfadm -s sos -a oracle -o destroy -c config2
    Destroying snapshot volumes ...                         Done
  6. Restart the clone database.
    bash-2.05b$ /opt/VRTS/bin/vxsfadm -s sos -a oracle -c config1\
    -o clone --clone_name clones --clone_path /tmp/clones
    Mounting snapshot volumes ...                                  Done
    Starting clone database clones ...
    Clone database started.

You can use the vxsfadm command after the replication role transfer.

See Considerations for using vxsfadm after replication role transfer.

More Information

vxsfadm command reference

Space-optimized snapshots configuration parameters

Space-optimized snapshots supported operations