Loading...

Multi-Instance Snap Optimization

Table of Contents

Overview

During a SnapProtect backup, snapshots will be created for each LUN associated with a database. Snapshots will be created even when multiple database instances share one or more LUNs. In such a case, the shared LUNs will be backed up multiple times - once as part of every instance using the LUN. When you enable the optimization and group all instances that share a set of LUNs into a single schedule policy, each shared LUN will be backed up only once. This will reduce the number of snapshots on the storage, thus saving time and storage resources.

Since multiple databases use one set of snapshots for backup, you can revert all the LUNs and databases in a single revert job. Without this optimization, reverting one database may corrupt data files of another database that shares the LUN(s).

Configuring Multiple Instances Using Shared Storage on a Client

Follow the steps given below to configure multiple instances using a shared storage on a client:

  1. Ensure that you have installed the Oracle iDataAgent and MediaAgent on all the source and proxy clients. See Oracle iDataAgent and MediaAgent deployment for step-by-step procedure on how to install the oracle iDataAgent and MediaAgent.
  2. Configure the client and instance using the steps described in Getting Started - Oracle Configuration. Ensure that you perform a manual discovery of instances.
  3. Create a storage policy to perform SnapProtect operations. Create a Snapshot Copy to enable a snapshot on the copy.
  4. Create an agent-specific schedule policy to perform SnapProtect operations. See Creating Data Protection Schedule Policies for step-by-step instructions.
  5. Create and configure a new subclient manually as follows:
    • From the CommCell Browser, navigate to Client Computers | <Client>| Oracle.
    • Right-click the <Instance>, point to All Tasks, and then click New Subclient.
    • In the Subclient Name box, type the subclient name.
    • Click the SnapProtect Operations tab.
    • Click SnapProtect option to enable SnapProtect backup for the selected subclient.
    • Select the storage array from the Available Snap Engine drop-down list.
    • By default, the system will perform a File System backup copy. Select Use RMAN for backup copy if you want to use RMAN backup copy.

      If you are using NoArchiveLog mode Database, do not select Use RMAN for backup copy.

    • Select the proxy client from the Use Proxy drop-down list.

      See Configuring Proxy for RMAN Backup Copy, if you want to use a proxy for RMAN backup copy.

  6. Select the storage policy from the storage device tab of the subclient created for snaps.
    • From the CommCell Browser, navigate to Client Computers | <Client>| Oracle | <Instance>. 
    • Right-click the subclient created for snaps and then click Properties
    • Click the Storage Device tab.
    • In the Data Storage Policy list, select a Storage Policy name.
    • Click OK to convert the next backup as a full backup.
    • Click OK.
  7. You must create and configure a subclient as shown above for all the instances included in the shared storage on a client.

    Once the subclients for snaps are created for other instances, you must assign a storage policy as shown above to them.

  8. Add all the subclients that are included in this shared storage environment to the schedule policy. See Automatic Subclient Creation and Configuration to automatically create and configure subclients using the qscripts.
  9. Ensure that all the following additional requirements are satisfied on all the clients for successful snap or clone operations in a shared LUN environment:

    To add or edit an additional setting, follow the steps in Add or Modify an Additional Setting.

    • All the subclients of a client in the same schedule policy should use the same storage policy.
    • All the subclients of a client in the same schedule policy should use the same proxy client.
    • Use the sMULTIAPPCONSISTENTSNAP additional setting set to Y on all the clients to perform a snap for multiple databases in the same job.
    • Configure the nDECLUSTER_LVM additional setting on all the nodes and Proxy machine if cluster is configured and set it to 1.
    • If the storage array is EMC clariion or EMC Symmetrix, use the SYMAPI_HOME_DIR additional setting to the directory where the Symmetrix SYMAPI library is present on all the clients and restart the SnapProtect services. In case of EMC Symmetrix, all the source devices should be in the same device group for consistency.
    • REDO Log for No archive log database should be on the volume for which snap should be supported.
    • Data and log volumes should not be shared and each database should have unique paths on the volumes like /data/db1, /data/db2, /log/db1, /log/db2 etc.
    • Enable the multi-instance snap optimization.
      • On the CommServe computer, add the EnableOracleMultiInstanceSnap additional setting  and configure the following values:
        Property Value
        Name EnableOracleMultiInstanceSnap
        Category CommServDB.GxGlobalParam
        Type Integer
        Value

        1 - to enable multi-instance snap optimization

        0 - to disable multi-instance snap optimization

        For instructions on how to add additional settings from the CommCell Console, see Add or Modify an Additional Setting.

  10. For clone operations, perform the following in addition to the above configuration:
    • While creating a new subclient, select the clone engine from the Available Snap Engine drop-down list in the SnapProtect Operations tab.
    • Create a separate schedule policy for clone operations.

Automatic Subclient Creation and Configuration

Once the instances are created or discovered, execute the following QScript to create and configure the subclients:

qoperation execscript -sn OraMultiDBCGSnapConfig -si <ClientComputerGroup> -si <hourly/snap schedule policy> -si <daily/clone schedule policy> -si <y/n>(FullScan)

Arguments

Client Computer Group Create one client group and add all the clients for which snap/clone jobs will be performed
Hourly/snap schedule policy Create hourly schedule policy which will be used to run snap jobs for every hour
Daily/clone schedule policy Create daily schedule policy which will be used to run clone jobs once for daily.
FullScan (Y/N) If the value is "n", then it is incremental scan and as part of incremental scan it will check only newly created/discovered instances. subclients will be created for them only. Otherwise it will check all the instances in that client group and create subclients if any instance do not have the required subclients.

When you execute the script, the system will check all the instances in that client group and perform the following steps:

  1. If the subclients are not already created, it will create the following two subclients for snap and clone correspondingly:

    <instancename>_snap

    <instancename>_clone

  2. It will assign EMC TimeFinder Snap Snap Engine to <instancename>_snap subclient and EMC TimeFInder Clone to <Instancename>_clone subclient. See Modify Snap Engine for a subclient section to change the Snap Engine.
  3. By default, the system will perform a File System backup copy. Use RMAN for backup copy is also selected for these subclients.

    If you are using NoArchiveLog mode Database, disable Use RMAN for backup copy.

  4. It will add all the snap subclients(<instancename>_snap) to hourly schedule policy and all clone subclients(<instancename>_clone) to daily schedule policy.

    If you want to exclude instances from creating subclients and associating them to shared schedule policy, update the instance description with exclude with cvsnap schedule. Then the above script will not create subclients for those instances. See Update instance description to change the instance description using command line.

Once you execute the script, assign the storage policy and proxy client to all the subclients using the CommCell Console or command line.

Example:

Executing configuration script:

[root@brahmani64 Base]# ./qoperation execscript -sn OraMultiDBCGSnapConfig -si CVLT -si hourly -si daily -si n
QScript[OraMultiDBCGSnapConfig] CS[commserve] DB[CommServ] Source[SQL File]

Qscript Output:

Changed database context to 'CommServ'.
Created snap subclients for:
Client [client1] Instance [par1]
Client [client1] Instance [par2]
OraMultiDBCGSnapConfig completed at Aug 8 2012 11:48PM. ErrorCode (0).
Qscript Execution Succeeded!

Modify Subclient Using Command Line

Download the update_subclient_template.xml file and save it on the computer from where the command will be executed.

Assign a Storage Policy to a Subclient

Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters and attributes.

qoperation execute -af update_subclient_template.xml -clientName client1 -instanceName par1 -subclientName par1_snap -storagePolicyName snapSP

Assign a Proxy to a Subclient

Make sure that the proxy is configured correctly before assigning a proxy to a subclient.

Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters and attributes.

qoperation execute -af update_subclient_template.xml -clientName client1 -instanceName par1 -subclientName par1_snap -storagePolicyName snapSP -snapToTapeProxyToUse/clientName dbcs

Disable Use RMAN for Backup Copy

You must disable RMAN for backup copy for NOARCHIVELOG databases.

Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters and attributes.

qoperation execute -af update_subclient_template.xml -clientName client1 -instanceName par1 -subclientName par1_snap -storagePolicyName snapSP -snapToTapeProxyToUse/clientName dbcs -isRMANEnableForTapeMovement false

Modify Snap Engine for a Subclient

Download the update_subclient_template.xml file and save it on the computer from where the command will be executed.

Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters and attributes.

qoperation execute -af update_subclient_template.xml -clientName client1 -instanceName par1 -subclientName par1_snap -storagePolicyName snapSP – snapShotEngineName “EMC CLARiiON Snapview Snap”

Update Instance Description

Execute the following command to change the instance description after substituting the parameters and attributes:

[root@brahmani64 Base]#./qoperation execscript -sn SetOracleInstanceProperties.sql -si client1 -si 'Q_ORACLE' -si par1 -si 'User Description' -si 'exclude from cvsnap schedule' -si 1

Configuring Proxy for RMAN Backup Copy

When you configure a proxy for RMAN backup copy, make sure to satisfy the following requirements:

  • Make sure that the data, log, diag, FRA and all the dump directories on the proxy are identical to the source.
  • Oracle gid and uid should match the source computer's oracle user.
  • Oracle instances on the proxy should be configured similar to those at source and should be in started mode. You need to configure the instances on the CommCell console.
  • You can also use sRMANDATAFILECOPY additional setting for RMAN backup copy. See RMAN Backup Copy Operations for more information.

SnapProtect Backup for Multiple Instances

A snap or clone operation is performed for all the instances at the same time in a shared LUN environment using the schedule policy created specifically for this purpose. You can perform a snap or clone operation immediately or at a scheduled time.

When you perform a SnapProtect backup or a clone operation, the system performs the following:

  • A single job among multiple jobs will be selected and this job becomes the master job.
  • Master job will collect all the data mount points for all the databases which are included in the schedule policy and performs the following:
    • If the database is in archive log mode and open, it will change it to a hot backup mode. This will be performed for all the archive log databases.
    • If the database is in noarchive log mode and open, it will completely depend on consistent option provided by the snap engine and will also take a snap for REDO log location.
    • If the database is noarchive log DB, it will not change the database to a hot backup mode..
    • If one of the databases is down or in started mode, it will skip that database for snap operation.
  • SnapProtect will be performed for all the data mount points at the same time. After Snap operation, the databases are changed from hot backup mode.
  • Master job switches the log for archive log DB and will take the backup of controlfile to archive log location or data file location for archive log DB and No archive log DB correspondingly.
  • Similar to data, all the mount points for log will be collected and snaps will be performed.
  • Once archive indexing is completed, the master job is marked as complete.
  • Once the master job is completed, all the other jobs will continue and verify whether the snaps are already taken. If they know that the snaps are already taken, they just clone the archive files, perform archive index and completes the job.

Use the following steps to perform a SnapProtect backup:

  1. From the CommCell Browser, navigate to Policies | Schedule Policies.
  2. Right-click the <Schedule Policy> in the right pane and click Run Immediately. You can track the progress of the job from the Job Controller window of the CommCell console.
  3. Once the job is complete, view the job details from the Backup History. Right-click the Schedule Policy and select View Jobs.
  4. Click OK.
  5. Right-click the job to:
    • Browse the databases that were backed up.
    • List Snaps
    • View RMAN Logs.
    • Resubmit the job.
    • View job details.
    • View media associated with the job.
    • View events associated with the job.
    • View or send the log file that is associated with the job.

Scheduling a SnapProtect Backup for All the Instances in a Shared LUN Environment

Use the following steps to schedule a SnapProtect backup for all the instances in a shared LUN environment:

  1. From the CommCell Browser, navigate to Policies | Schedule Policies.
  2. Right-click the <Schedule Policy> in the right pane and click Edit.
  3. Click Add button.
  4. Click the Backup Options tab.
  5. Click Full.
  6. Select the appropriate scheduling options. 

    For example:

    • Click Daily.
    • Check the days you want to run the SnapProtect backup job.
    • Change the Start Time to 9:00 PM.
    • Click Options.
  7. Select the appropriate advanced schedule options.

    For example:

    • Click Start date.
    • Select the end dates or times after which you want the stop the scheduled job.
    • Change the Repeat Times.
    • Specify the Time Zone for the schedule.
    • Click OK.
  8. Click OK to close the Backup Task Options dialog box.
  9. Click OK to close the Scheduled Policy dialog box.

    The SnapProtect backup job for instances in a shared storage will execute as per the schedule.

Restoring Database or Datafiles and Tablespaces

You can restore each database or some of the datafiles/table spaces from one database on a client.

Use the following steps to restore a database:

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Oracle.
  2. Right-click the <Instance>, point to View and then click Backup History.
  3. In the Backup History Filter for <Instance> dialog box, click OK.
  1. Right-click the SnapProtect job you want to restore and click Browse and Restore.
  2. Click View Content.
  3. In the right pane of the Browse window, select the entire instance or the datafiles or tablespaces you want to restore and click Recover All Selected.
  1. In the Restore Options dialog box, click Advanced.
  2. Click the Options tab.
  3. Select None from the Reset Logs list.

    For No archive log database, select Yes from the Reset Logs list as the restore will always be Point-in-time restore and REDO logs which were existing in snap/clone will only be applied. You should perform a full database restore for no archive log database.

  4. Select Switch Database Mode for Restore check box.
  5. Click OK.

Reverting from SnapProtect Job

If you perform a revert from a SnapProtect job from a schedule policy, it will revert all the databases which were snapped in that SnapProtect backup job to the same point-in-time. Ensure that you have performed a SnapProtect backup for all the databases which share the same LUNs.

Ensure that both the data and log volumes are reverted for successful revert operation. By default, the data volumes only are reverted. Set the sREVERTARCHIVELOG additional setting to revert the log volumes also in addition to data volumes.

To add or edit an additional setting, follow the steps in Add or Modify an Additional Setting.

Use these arguments:

  • In the Name box, type sREVERTARCHIVELOG. The Category and Type keys are automatically populated.
  • In the Value box, type Y.

Use the following steps to revert an SnapProtect job:

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Oracle.
  2. Right-click the <Instance>, point to All Tasks and then click Browse and Restore.
  3. Click View Content.
  4. Select the data you want to revert and click Recover All Selected.

     Even if you select one instance, it will revert all the databases that are included in the SnapProtect job.

  1. From the Restore Options dialog box, select Restore Control File.
  2. Click Advanced.
  3. Select the Use hardware revert capability if available option.

    A warning message displaying that the oracle multi-instance snap optimization feature is enabled and selecting hardware revert option will result in restoring all the instances which are included in the shared SnapProtect backup. The message informs you that the hardware revert can only be performed in-place and it will be automatically selected. The message will also warn you that the selection of revert option will overwrite the entire disk and all the existing data will be lost. Select Yes if you still want to continue. Select No if you do not want to continue.

  4. Click Options tab.
  5. Select Yes from the Reset Logs list.
  6. Select Switch Database Mode for Restore.
  7. Click OK to confirm the revert operation.
  8. Click OK from the Advanced Restore Options dialog box.
  9. Click Script Preview to verify the instances that are being reverted in the current revert operation.
  10. Click OK to start the revert operation.

    if the database is in mount mode while taking a SnapProtect backup, then the same status is preserved even after the revert operation.

Once a revert is completed, resync the catalog using RMAN to register the new incarnation.

Example:

[oracle@brahmani64 ~]$ export ORACLE_SID=par2

[oracle@brahmani64 ~]$ rman target / catalog snap/snap@test

Recovery Manager: Release 10.2.0.4.0 - Production on Fri Jul 13 10:04:19 2012

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: PAR2 (DBID=1259990815)

connected to recovery catalog database

RMAN> resync catalog;

starting full resync of recovery catalog

full resync complete

RMAN>

Backup Copy for Multiple Instances Using Shared Storage on a Client

Once the SnapProtect jobs are completed, you can perform or schedule backup copy jobs. You can run parallel backup copy for all the SnapProtect jobs which are performed using a schedule policy in one operation. In case of parallel backup copy, mount all the snaps in the first backup copy job itself. The other jobs will use these mount points and backup their corresponding databases.

  1. From the CommCell Browser, navigate to Policies | Storage Policies.
  2. Right-click the <Storage Policy> in the right pane, point to All Tasks and click Run Backup Copy.
  3. Select Number of simultaneous jobs to run from the list.
  4. Click Job Initiation tab.
  5. Select Immediate to perform the backup copy job. You can also click Schedule to perform the job at a scheduled time.
  6. Click OK.

See Backup Copy Operations and Restoring Data from Backup Copy for more information on backup copy operations.