RMAN configuration with Tivoli Data Protection for Oracle (TDPO)

Preamble

The configuration and testing described in this document have been done on Red Hat Enterprise Linux Server release 5.5 (Tikanga) 64 bits with Oracle 11gR2 (11.2.0.2.0) and 10gR2 (10.2.0.5.0).

First let your preferred system administrator install the product for you, you should find it in:

[root@oracleserver.domainname /]# ll /opt/tivoli/tsm/client
total 20
drwxr-xr-x 4 root bin  4096 Jun  7 15:28 api
drwxr-xr-x 3 root bin  4096 Jun  7 15:27 icc32
drwxr-xr-x 3 root bin  4096 Jun  7 15:28 icc64
drwxr-xr-x 3 root bin  4096 Jun  7 15:27 lang
drwxr-xr-x 5 root root 4096 Jun  7 15:29 oracle

The Tivoli Storage Manager (TSM) server configuration part is in:

[root@oracleserver.domainname /]#  ll /opt/tivoli/tsm/client/api/bin64
total 4044
-rwxr-xr-x 1 root root     810 Jul 13 06:33 dsm.opt
-r--r--r-- 1 root bin      782 Dec  5  2006 dsm.opt.smp
-rwxr-xr-x 1 root root    1194 Jul 13 12:17 dsm.sys
-r--r--r-- 1 root bin      971 Dec  5  2006 dsm.sys.smp
-rwsr-xr-x 1 root bin  1832042 Nov 28  2006 dsmtca
lrwxrwxrwx 1 root bin       16 Jun  7 15:28 en_US -> ../../lang/en_US
-r-xr-xr-x 1 root bin  2274183 Nov 28  2006 libApiTSM64.so
drwxr-xr-x 2 root bin     4096 Jun  7 15:28 sample

The TSM client configuration (TDPO) part is in:

[root@oracleserver.domainname /]# ll /opt/tivoli/tsm/client/oracle/bin64
total 1536
-rwxrw-rw- 1 root root     67 Mar 21  2007 agent.lic
-rwxrwxr-x 1 root root     29 Jul 13 06:31 dsm.opt
drwxr-xr-x 2 root root   4096 Jun  7 15:29 en_US
-rwxr-xr-x 1 root root 575528 Mar 21  2007 libobk.so
-rwxr-xr-x 1 root root 491744 Mar 21  2007 tdpoconf
-rw-rw---- 1 root dba     279 Jul 13 12:18 tdpoerror.log
-rw-r--r-- 1 root root     48 Jul 13 08:37 TDPO.oracleserver.domainname
-rwxrwxr-- 1 root root    412 Jul 13 06:34 tdpo.opt
-rwxr-xr-x 1 root root    693 Mar 21  2007 tdpo.opt.smp
-rwxr-xr-x 1 root root    693 Jun  7 15:54 tdpo.optyd11072011
-rwx--x--x 1 root root 442632 Mar 21  2007 tdposync

TSM/TDPO configuration

Configuration is made of four files:

[root@oracleserver.domainname /]# cat /opt/tivoli/tsm/client/api/bin64/dsm.opt
Servername tsmserver.domain.com
[root@oracleserver.domainname /]# cat /opt/tivoli/tsm/client/api/bin64/dsm.sys
SErvername  tsmserver.domain.com
   COMMMethod         TCPip
   TCPPort            1511
   TCPServeraddress   tsmserver.domain.com
NODENAME    oracleserver.domainname
PASSWORDACCESS PROMPT
PASSWORDDIR /opt/tivoli/tsm
SCHEDLOGNAME "/var/log/tsm/dsmsched.log"
SCHEDLOGRETENTION  3
ERRORLOGNAME  "/var/log/tsm/dsmerror.log"
ERRORLOGRETENTION 5
[root@oracleserver.domainname /]# cat /opt/tivoli/tsm/client/oracle/bin64/tdpo.opt
DSMI_ORC_CONFIG    /opt/tivoli/tsm/client/oracle/bin64/dsm.opt
DSMI_LOG           /opt/tivoli/tsm/client/oracle/bin64
 
TDPO_FS            /adsmorc
TDPO_NODE          oracleserver.domainname
TDPO_OWNER         root
TDPO_PSWDPATH      /opt/tivoli/tsm/client/oracle/bin64
 
TDPO_DATE_FMT      1
TDPO_NUM_FMT       1
TDPO_TIME_FMT      1
 
TDPO_MGMT_CLASS_2   mgmtclass2
TDPO_MGMT_CLASS_3   mgmtclass3
TDPO_MGMT_CLASS_4   mgmtclass4
[root@oracleserver.domainname /]# cat /opt/tivoli/tsm/client/oracle/bin64/dsm.opt
Servername tsmserver.domain.com

Create the password file to be able to access to TSM server:

[root@oracleserver.domainname /]# ./tdpoconf passw
 
IBM Tivoli Storage Manager for Databases:
Data Protection for Oracle
Version 5, Release 4, Level 1.0
(C) Copyright IBM Corporation 1997, 2007. All rights reserved.
 
 
***************************************************************
*   IBM Tivoli Storage Manager for Databases Utility 
*   Password file initialization/update program 
***************************************************************
 
Please enter current password:
 
 
Please enter new password:
 
 
Please reenter new password for verification:
 
 
ANU0260I Password successfully changed.

This command create the following password file:

[root@server1 bin64]# ll /opt/tivoli/tsm/client/oracle/bin64/TDPO.oracleserver.domainname
-rw-r--r-- 1 root root 48 Jul 13 08:37 /opt/tivoli/tsm/client/oracle/bin64/TDPO.oracleserver.domainname

Verify all is fine with:

[root@oracleserver.domainname bin64]# ./tdpoconf SHOWENVironment
 
IBM Tivoli Storage Manager for Databases:
Data Protection for Oracle
Version 5, Release 4, Level 1.0
(C) Copyright IBM Corporation 1997, 2007. All rights reserved.
 
 
Data Protection for Oracle Information
 Version:              5
 Release:              4
 Level:                1
 Sublevel:             0
 Platform:             64bit TDPO LinuxAMD64
 
Tivoli Storage Manager Server Information
 Server Name:          tsmserver.domain.com
 Server Address:       tsmserver.domain.com
 Server Type:          Linux/x86_64
 Server Port:          1511
 Communication Method: TCP/IP
 
Session Information
 Owner Name:           root
 Node Name:            oracleserver.domainname
 Node Type:            TDPO LinuxAMD64
 DSMI_DIR:             /opt/tivoli/tsm/client/api/bin64
 DSMI_ORC_CONFIG:      /opt/tivoli/tsm/client/oracle/bin64/dsm.opt
 TDPO_OPTFILE:         /opt/tivoli/tsm/client/oracle/bin64/tdpo.opt
 Password Directory:   /opt/tivoli/tsm/client/oracle/bin64
 Compression:          FALSE
 License Information:  License file exists and contains valid license data.

Oracle Configuration

The Oracle configuration is quite simple, you just need to create a symbolic link on TDPO library in all your $ORACLE_HOME/lib directory:

[oracleg@oracleserver.domainname ~]$ ln -s /opt/tivoli/tsm/client/oracle/bin64/libobk.so $ORACLE_HOME/lib
[oracle@oracleserver.domainname ~]$ ll  $ORACLE_HOME/lib/libobk.so
lrwxrwxrwx 1 oraracle dba 45 Jul 13 12:00 /oracle/software/lib/libobk.so -> /opt/tivoli/tsm/client/oracle/bin64/libobk.so

Then ensure dba Unix group (better to provide access to DBA group in case you have multiple Oracle accounts on your server) is able to write in all log files you defined in all TSM configuration files and be able to read tdpo.opt configuration file.

With Unix commands it gives something like:

[root@oracleserver.domainname /]# chmod a+r /opt/tivoli/tsm/client/oracle/bin64/tdpo.opt
[root@oracleserver.domainname /]# chown root:dba /opt/tivoli/tsm/client/oracle/bin64/tdpoerror.log
[root@oracleserver.domainname /]# chmod g+rw /opt/tivoli/tsm/client/oracle/bin64/tdpoerror.log
[root@oracleserver.domainname /]# chown -R root:dba /var/log/tsm
[root@oracleserver.domainname /]# chmod g+rw /var/log/tsm

All errors I personally encountered were linked to missing rights on either log files (write permission) and read rights on configuration files. Don’t be too generous while giving those rights…

And that’s it ! You are done, you can test all is working with (even before starting RMAN):

[oracle@oracleserver.domainname admin]$ sbttest test
The sbt function pointers are loaded from libobk.so library.
-- sbtinit succeeded
Return code -1 from sbtinit, bsercoer = 0, bsercerrno = 0
Message 0 not found;  product=RDBMS; facility=SBT

RMAN backup

I’m not entering in all options of powerful RMAN command but below simple script will perform your first tape backup:

#!/bin/ksh
 
# Trapping errors -------------------------------------------------------------
 
trap 'STATUS=$?;set +x;echo;echo error $STATUS at line nb $LINENO executing :`sed -n "${LINENO}p" $0`;echo;exit $STATUS' ERR
 
# OS management ---------------------------------------------------------------
 
OSTYPE=$(uname -s)
case $OSTYPE in
"AIX" ) alias bdf="/usr/bin/df -Ik"
        alias ll="/usr/bin/ls -l" ;;
"SunOS") alias bdf="/usr/bin/df -k"
         alias ll="/usr/bin/ls -l"
         alias awk="/usr/xpg4/bin/awk"
         alias grep="/usr/xpg4/bin/grep" ;;
"Linux") alias bdf="/bin/df -k"
         alias grep=egrep
         alias echo="echo -e"
         alias ll="ls -l" ;;
esac
 
# Variables -------------------------------------------------------------------
JOB_NAME=$(basename $0)
TODAY=`date +'%Y%m%d_%H%M%S'`
LOG_FILE=/tmp/${JOB_NAME}_${TODAY}_$$.log
 
# Main Here -------------------------------------------------------------------
 
JOB_START=`date +%s`
echo "\nStarting at `date +'%Y%m%d_%H%M%S'`\n"
 
rman << EOF
connect target /
connect catalog rman/rman@rmanrepository
 
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 9 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
CONFIGURE CHANNEL DEVICE TYPE sbt PARMS 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
CONFIGURE DEVICE TYPE sbt PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
 
run
{
allocate channel sbt1 type sbt parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel sbt2 type sbt parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel sbt3 type sbt parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel sbt4 type sbt parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
 
backup as compressed backupset database include current controlfile tag '${TODAY}';
backup as compressed backupset archivelog all delete all input tag '${TODAY}';
 
release channel sbt1;
release channel sbt2;
release channel sbt3;
release channel sbt4;
}
 
EOF
 
JOB_END=`date +%s`
echo "\nEnding at `date +'%Y%m%d_%H%M%S'`"
 
echo "\nCompleted in $((($JOB_END - $JOB_START)/60)) minutes"
 
echo "\nNormal Exit"

References

About Post Author

26 thoughts on “RMAN configuration with Tivoli Data Protection for Oracle (TDPO)

  1. Hi,
    Any idea about below error please:
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on T4 channel at 02/28/2024 20:55:33
    ORA-19506: failed to create sequential file, name=”1m2ka5a1_54_1_1″, parms=””
    ORA-27028: skgfqcre: sbtbackup returned error
    ORA-19511: non RMAN, but media manager or vendor specific failure, error text:
    ANS1331E (RC927) Only a IBM Spectrum Protect authorized user can perform this Action.

  2. Is there any method to retrieve the report for backup completion , via catlog server centrally , because most of the times we used crontab for scheduling .

  3. Hi Yannick,
    Is there a way to configure Oracle to archive the log files directly to TSM? Currently we have set it up to go to disk but we need them to go directly to TSM, just how it does for DB2. Any thoughts?

    Thanks in advance!
    Anvik

    • Hi Anvik,

      Unless you can mount a “TSM filesystem” on your Oracle server, no I don’t think it is possible. Location parameter of LOG_ARCHIVE_DEST_n is either a local disk or te Fast Recovery Area. Overall I think it is a bit against the Oracle strategy to have the latest archived log files on disk to be able to recover quickly in case of failure…

      Thanks, Yannick.

  4. Hi Yannick,
    Really a good blog.I have a Q. I am taking my oracle online full bcks to TSM tape library.How can I restore them into another node ( purpose to use for DR).Probably You should have realized or experienced it before.

    • Hi Cem,

      Thanks for nice comment I appreciate !

      No I have never done it but it’s a genuine request. To achieve it please refer to:
      How to achieve alternate client restore with RMAN and Tivoli (Doc ID 265595.1)

      In short you have to play with TDPO_NODE parameter in tdpo.opt file.

      Thanks, Yannick.

  5. Nishant Khurana says:

    Hi Yannick,

    Small and precise article. Great work man. It really cleared the funda of TDPO backup with TSM.

    Thanks a lot.

    Nishant Khurana

  6. I have configure RMAN backups through Tivoli. Rman backup is happing successfully and i am able to restore without any issue.But I want to delete rman backups from

    Tivoli. How do i achive this. Where i have set deletion policy? I have created seprate POOL and Management class in TSM.
    Is this RMAN backup is IMAGE or Arch format? If image format then i have to Version and If it archive format then i have to set Number of Days.

    As per my company policy i have keep rman backups for 3 sets/days.

    Please advice me.

    Please find below rman backup script and Management class details.

    Rman backup script:

    rman target /@RMAN_${ORACLE_SID} catalog /@RCAT  log=/shcilbin/RMAN_out/OfflineSHCILDW.$3$2$6.out APPEND  <<Eof
    run{
    sql 'alter system archive log current';
    allocate channel dev1 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)";
    allocate channel dev2 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)";
    backup incremental level = 0 database format 'full_lvl0_DAILY_%T_%d_%u_%s_%p' filesperset 8;
    backup current controlfile format 'bkpcontrol_%d_%T_%u_%s_%p.ctl' ;
    }
    Eof
     
    rman target /@RMAN_${ORACLE_SID} catalog /@RCAT  log=/shcilbin/RMAN_out/OfflineSHCILDW.$3$2$6.out APPEND  <SELECT domain_name,set_name,class_name,verexists,verdeleted,retextra,retonly,destination FROM bu_copygroups where class_name='RMAN_BKP' ;
     
    DOMAIN_NAME: SHCILMHP_DOM
       SET_NAME: ACTIVE
     CLASS_NAME: RMAN_BKP
      VEREXISTS: 3
     VERDELETED: 1
       RETEXTRA: 0
        RETONLY: 0
    DESTINATION: RMAN_POOL
     
    DOMAIN_NAME: SHCILMHP_DOM
       SET_NAME: SHCILMHP_SET
     CLASS_NAME: RMAN_BKP
      VEREXISTS: 3
     VERDELETED: 1
       RETEXTRA: 0
        RETONLY: 0
    DESTINATION: RMAN_POOL
    • For cost constraint reason we have finally decided not to purchase expensive TDPO option and are doing backup on disk then on tape with standard TSM client.

      Just to say that we do not have huge production return on experience on this part.

      What I anyway remember is that either using retention policies (CONFIGURE RETENTION POLICY and CONFIGURE ARCHIVELOG DELETION POLICY) or using standard DELETE command was providing expected results during my testing even when working with tapes.

  7. Hi Yannick,

    Is there any reason you set the SBT configuration twice ?
    A first time in the default RMAN configuration (CONFIGURE CHANNEL DEVICE TYPE sbt PARMS ‘ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)’;)
    and then again in the run block (allocate channel sbt1 type sbt parms ‘ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)’;)
    Why don’t you just run “allocate channel sbt1 type sbt” in the run block ?

    Regards,

  8. ashish sharma says:

    Hi Yannick,

    I find the blog truly useful for TDP backup configuration. Its a small guide to start with TDP backup in few minutes.

  9. Hello Yannick

    One thing which confuses me is that – You have switched off controlfile auto backu, then how will you restore your control files using TDPO & RMAN. The only way is to create new controlfiles, mount the DB and then go for rman restore. What say ?

    I tried restoring control file but it gives me the below message :-
    — RMAN-06563: control file or SPFILE must be restored using FROM AUTOBACKUP

    So i think we need to have a separate controlfile backup on disk somewhere ……

    • Hi Lodh,

      Good and tricky question !

      If no controlfile autobackup and a recovery catalog then connect to recovery catalog and issue:

      Startup force nomount
      restore controlfile;
      alter database mount;
      recover database;
      Alter database open resetlogs;

      If no controlfile autobackup and no recovery catalog then it’s even complex because you would need to play with CATALOG command and restore few backupset from tape to local database server disk to catalog them… Not a safe situation for sure !

      Reading further Oracle documentation I now think controlfile autobackup is a good idea and do not use that much disk/tape space, so modifying my script: happy ?

      Please note that even with controlfile autobackup and no FRA, restore process is not that simple…

  10. Ivan Acosta says:

    Hi
    First I want tell you that this articule is very usefull thank you for share your knowledge, but I have a question. Is possible that this backup save in 2 device in tivoli and disk…??? Thanks for your answer.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>