How to configure IBM Tivoli Data Protection for Oracle (TDPO) and take the oracle database backup to TSM Server storage ?

If you want to configure IBM Tivoli Data Protection for Oracle to protect your Oracle database, TDP for Oracle must be first installed on your system and a Tivoli Storage Manager server must be available to communicate with Data Protection for Oracle. You can perform full or partial, offline or online backups with Oracle. Once you identify which database to back up, Oracle locates all necessary files and sends them to the Tivoli Storage Manager server through Data Protection for Oracle. As a result, Data Protection for Oracle provides an interface between Oracle Media Management API calls and Tivoli Storage Manager API routines.

You must first register the Oracle machine as a client node in Tivoli Storage Manager Server with appropriate policy settings. The you need to configure the important TDPO configuration files such as tdpo.opt, dsm.opt and dsm.sys files in the Client side in order to start protecting the backup. In this post we will see how to register and define policy settings for TDP oracle node on TSM server end and then see how to configure those important configuration files from client end.

Also Read: How TDPO works with RMAN

On Tivoli Storage Manager Server

1) Define Tivoli Storage Manager Policy Settings for TDP for Oracle node
Data Protection for Oracle requires special Tivoli Storage Manager policy domain settings. TDP for oracle uses RMAN utility to take the database backup. RMAN uses the format parameter in the RMAN script to generate unique backup file names. Because all backup objects inserted into the Tivoli Storage Manager backup storage pool have unique file names, they never expire on the Tivoli Storage Manager server.

While defining copy group parameters for TDP Oracle node, the recommended values for verdeleted and retonly is 0 because when Data Protection for Oracle marks a backup object inactive, that object is deleted from the Tivoli Storage Manager server the next time expiration processing occurs. A backup object is marked for immediate expiration when you delete it through RMAN using the Data Protection for Oracle interface or with the tdposync utility. The tdposync utility is used to remove unwanted backup objects from the Tivoli Storage Manager server. Remember that the inactive backup object cannot be restored through RMAN using the Data Protection for Oracle interface.

Also Read: Steps to take MS SQL DB backup and Restore using TDP for SQL

The following backup copy group options are not applicable to Data Protection for Oracle. Data Protection for Oracle accepts default values for these options.
  • frequency
  • verexists
  • retextra
  • mode
  • serialization
If you choose to define a new management class within an existing policy domain (not the default management class for that domain), then you must add an include statement to the Data Protection for Oracle options file to bind all objects to that management class. It is recommended to define a new policy for TDP for oracle backup.

2) Register TDP Oracle node on TSM Server
The Data Protection for Oracle node name and password must be registered to the Tivoli Storage Manager server before you can begin requesting backup and restore services.

Also Read: TDPO installation & Configuration Steps

You should register TDP Oracle node by specifying backdelete=yes in order for backup objects to be deleted. If it is not specified and a deletion request is made, the request fails and an error message displays.
register node tdponode tdpopasswd domain=domainname backdelete=yes maxnummp=2

ON TSM Client side

1) Link library files
After successful installation of TDP for Oracle on your system, make sure you link these both files as shown below.
$ORACLE_HOME/lib/libobk.a -> /usr/lib/libobk64.a

2) Configure Data Protection for Oracle tdpo.opt file
You must define options to control the way Data Protection for Oracle backs up and restores data. The Data Protection for Oracle options file, tdpo.opt, contains options that determine the behavior and performance of Data Protection for Oracle. The only environment variable Data Protection for Oracle Version 6.3 recognizes within an RMAN script is the fully qualified path name to the tdpo.opt file. For example
allocate channel t1 type ’sbt_tape’ parms
                              ’ENV=(TDPO_OPTFILE=/home/rman/scripts/tdpo.opt)’

The TDPO_OPTFILE variable must be specified in upper case characters only. If a fully qualified path name is not provided, Data Protection for Oracle uses the tdpo.opt file located in the Data Protection for Oracle default installation directory. If this file does not exist, Data Protection for Oracle fails. By default, the tdpo.opt file is located in the directory where Data Protection for Oracle is installed.

Change to the /usr/tivoli/tsm/client/oracle/bin64 directory and copy the tdpo.opt.smp file to tdpo.opt. Edit the tdpo.opt file to include these options
dsmi_orc_config  /usr/tivoli/tsm/client/oracle/bin64/dsm.opt 
dsmi_log  /usr/tivoli/tsm/client/oracle/bin64 (directory with write permissions)

On Windows
dsmi_orc_config C:\Program Files\Tivoli\TSM\AgentOBA\dsm.opt 
dsmi_log C:\Program Files\Tivoli\TSM\AgentOBA

optional parameters in this file are tdpo_owner, tdpo_pswdpath, tdpo_node, tdpo_mgmt_class2, tdpo_mgmt_class3.

3) Configure TSM client option (dsm.sys & dsm.opt) files
You must define some Tivoli Storage Manager options after the Data Protection for Oracle node is registered to the Tivoli Storage Manager server
  • These options are defined in the Tivoli Storage Manager client system options file (dsm.sys by default) and client user options file (dsm.opt by default).
  • Note that the Tivoli Storage Manager client user options file (dsm.opt by default) that you must edit for Data Protection for Oracle is located in the directory specified by the dsmi_orc_config option. If this option is not specified, Data Protection for Oracle looks for this options file in the Data Protection for Oracle installation directory.
  • The Tivoli Storage Manager client system options file (dsm.sys by default) must be located in the directory where the Tivoli Storage Manager API is installed.
  • Data Protection for Oracle provides sample Tivoli Storage Manager options files that you can modify for this purpose. These sample files are located in the Data Protection for Oracle installation directory.
  • You can also include other Tivoli Storage Manager client options  when configuring Data Protection for Oracle like compression, reduplication and enablelanfree parameters. Remember that The enablelanfree and deduplication options are mutually exclusive. Therefore, you can only use either one option or the other, but not both options together.
Go to this directory /usr/tivoli/tsm/client/oracle/bin64 and edit the dsm.opt file to include the server stanza as shown below
servername tsmserv

Change to the /usr/tivoli/tsm/client/api/bin64 directory and create a symbolic link to /usr/tivoli/tsm/client/ba/bin/dsm.sys. Edit the dsm.sys file to include another server stanza with the following options:
SErvername tsmserv
COMMMethod TCPip 
TCPServeraddress x.x.x.x 
PASSWORDAccess generate 
passworddir /home/<oracle user> 
nodename TDPONodeName

Make sure the Oracle user has the following permissions
  • Read (r) permission to the /usr/tivoli/tsm/client/oracle/bin64 and /usr/tivoli/tsm/client/api/bin64 directories.
  • Read permission (r-) to the tdpo.opt, dsm.opt, and dsm.sys files located in the /usr/tivoli/tsm/client/oracle/bin and /usr/tivoli/tsm/client/api/ bin directories.
4) Initializing Password for TSM Server authentication
Finally, The administrator must run the tdpoconf utility program to set the password before using Data Protection for Oracle. The utility uses the tdpo.opt file in the installation directory to centralize information for setup purposes. This utility helps to authenticate TDPO node password with TSM server and also to check the connection settings between TDPO node and TSM server.

Also Read: 3 TDPO utilities to troubleshoot Oracle DB issues

Use the tdpoconf password command to create a new password or change an existing password on the Tivoli Storage Manager server. There are two different scenarios you can use this password command with passwordaccess parameter in dsm.sys file. For example 

passwordaccess prompt
Run the tdpoconf password command as the root user. This command creates an encrypted password file, TDPO.Nodename. This file is located in the directory specified by the tdpo_pswdpath option. If the tdpo_pswdpath option is not specified, the TDPO.Nodename file is placed in the Data Protection for Oracle installation directory. Make sure that the TDPO.Nodename file can be read by the Oracle user that performs the backup. The Nodename value will be the value specified by the tdpo_node option in the Data Protection for Oracle options file specified with the TDPO_OPTFILE variable.

passwordaccess generate
Run the tdpoconf password command as the Oracle user. The password is placed in the file, TSM.PWD, and is owned by the Oracle user. This TSM.PWD file is created in the directory specified by the passworddir option defined in the dsm.sys file. Do not specify the tdpo_node option in the tdpo.opt file. Data Protection for Oracle uses the value of the nodename option specified in the dsm.sys file. If the tdpo_pswdpath option is specified in the tdpo.opt file, it is ignored.

Change to the /usr/tivoli/tsm/client/oracle/bin64 directory and run the tdpoconf password command as Oracle user to generate the password file.
tdpoconf password 

Showenvironment command
Use the showenvironment command to query the Tivoli Storage Manager server using the options set in –TDPO_OPTFILE, the tdpo.opt file in the default installation directory, or the default values set by Data Protection for Oracle. The screen output displays information about the Tivoli Storage Manager API and Tivoli Storage Manager server. This command is useful when troubleshooting Data Protection for Oracle setup. If, for example, the password file is not initialized properly, tdpoconf showenvironment reports this error immediately and prevents complications that can arise if this error were to go undetected. 

Run the tdpoconf showenvironment command to confirm proper configuration.
tdpoconf show environment

5) Backup and Restore using TDP for Oracle
5.1) The Oracle user should invoke RMAN to back up and restore an Oracle database by using this command.
$>  rman target xxx/yyy@target rcvcat aaa/bbb@catalog
                         cmdfile bkdb.scr msglog bkdb.log

RMAN creates a log file (bkdb.log) in the current working directory. If an error occurs, you will see the error stack in the log file

Also Read: Deactivating TDP for Oracle obsolete backup versions without TDPOSYNC

5.2) To take the Oracle database backup as Oracle user, run your RMAN backup script with the ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt) parameter specified.

For example:
run {
        allocate channel t1 type ’sbt_tape’ parms
                 ’ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)’;
        allocate channel t2 type ’sbt_tape’ parms
                 ’ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt);
        backup
           filesperset 5
           format ’df_%t_%s_%p’
           (database);
}

This backup script allocates two parallel connections to the Tivoli Storage Manager server. The Tivoli Storage Manager server views these connections as two separate sessions.

5.3) To restore a backup, As Oracle user, run your RMAN restore script with the 
ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)
run
          {
          allocate channel t1 type ’sbt_tape’ parms
          ’ENV=(TDPO_OPTFILE=/home/oracle/tdpo.opt)’;
          allocate channel t2 type ’sbt_tape’ parms
          ’ENV=(TDPO_OPTFILE=/home/oracle/tdpo.opt)’;
          restore database;
          recover database;
          alter database open;
          }

On windows 
Instead of  /usr/tivoli/tsm/client/oracle/bin64/tdpo.opt use 
C:\Program Files\Tivoli\TSM\AgentOBA\tdpo.opt

Also Read: All Tivoli Data Protection (TDP) Installation & Configuration Steps



2 Responses to "How to configure IBM Tivoli Data Protection for Oracle (TDPO) and take the oracle database backup to TSM Server storage ?"

  1. After all, recovering data after a disaster is the reason for implementing a data migration plan in the first place.Self Storage

    ReplyDelete