Tivoli Data Protection for Oracle (TDPO)

From dbawiki
Revision as of 18:19, 4 June 2013 by Stuart (talk | contribs) (Troubleshooting)
Jump to: navigation, search

'work in progress'

Setting up RMAN to backup directly to tape

RMAN cannot backup directly to tape due to there being many different tape backup suppliers.
The solution is the TDPO interface to which tape suppliers supply parameters. RMAN then knows what to do.

Files involved

  • dsm.sys
  • dsm.opt
  • tdpo.opt

Setting up DataPump to backup directly to tape

Files involved

  • dsm.sys

DSM.SYS entry located at /usr/tivoli/tsm/client/api/bin64/dsm.sys


servername  TSM_SINTP1_TDPO
   COMMmethod         TCPIP
   TCPPort            1516
   TCPServeraddress   10.80.0.15
   TCPBuffsize             31
   TCPWindowsize           32
   LARGECOMMBUFFERS        YES
   TXNBytelimit            10000
   PASSWORDACCESS          PROMPT
   MAXCMDRETRIES           4
   INCLEXCL                /home/ibmtools/scripts/rman/inclexcl.lst
   QUERYSCHEDPERIOD        3
   RETRYPERIOD             30
   SCHEDLOGNAME            /home/ibmtools/logs/rman/dsmsched.log
   ERRORLOGNAME            /home/ibmtools/logs/rman/dsmerror.log
   SCHEDLOGRETENTION       15 D
   SCHEDMODE               POLLING
   MAILPROG                /usr/bin/mail root
   NODENAME                SO_U_SINTP1_ORA_X_SAF
   DIRMC                   D01NOS_T1


scrbdbsbeant311:root[/home/ibmtools/scripts/rman]# cat tdpo_SINTP1.opt
DSMI_ORC_CONFIG    /home/ibmtools/scripts/rman/dsm_SINTP1.opt
DSMI_LOG           /home/ibmtools/logs/rman/tdpoerror_SINTP1
TDPO_FS            tdpo_SINTP1
TDPO_NODE          SO_U_SINTP1_ORA_X_SAF
TDPO_PSWDPATH      /home/ibmtools/scripts/rman
*tdpo_trace_flags orclevel0 orclevel1 orclevel2
*tdpo_trace_file   /home/ibmtools/logs/rman/tdpo_SINTP1.out



From yannickjaquier.com

RMAN configuration with Tivoli Data Protection for Oracle (TDPO)

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 you preferred system administrator install the product for you, you should find it in:

[[email protected] /]# 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:

[[email protected] /]#  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:

[[email protected] /]# 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 Configuration

Configuration is made of four files:

[[email protected] /]# cat /opt/tivoli/tsm/client/api/bin64/dsm.opt
Servername tsmserver.sgp.st.com

[[email protected] /]# cat /opt/tivoli/tsm/client/api/bin64/dsm.sys
SErvername  tsmserver.sgp.st.com
   COMMMethod         TCPip
   TCPPort            1511
   TCPServeraddress   tsmserver.sgp.st.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

[[email protected] /]# 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

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

[[email protected] /]# ./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@eul3001 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:

[[email protected] 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.sgp.st.com
 Server Address:       tsmserver.sgp.st.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:

[[email protected] ~]$ ln -s /opt/tivoli/tsm/client/oracle/bin64/libobk.so $ORACLE_HOME/lib
[[email protected] ~]$ 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:

[[email protected] /]# chmod a+r /opt/tivoli/tsm/client/oracle/bin64/tdpo.opt
[[email protected] /]# chown root:dba /opt/tivoli/tsm/client/oracle/bin64/tdpoerror.log
[[email protected] /]# chmod g+rw /opt/tivoli/tsm/client/oracle/bin64/tdpoerror.log
[[email protected] /]# chown -R root:dba /var/log/tsm
[[email protected] /]# 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):

[[email protected] 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 OFF;
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"

Troubleshooting

  • Exports not working. Path to fix...

Check the password is ok by querying the archive:

beuxqsysesb99:root[/home/root]# dsmc q ar -se=so_u_`hostname`_orx_d_cab -su=y "/oracle/export/TIBQADM/*"
IBM Tivoli Storage Manager
Command Line Backup-Archive Client Interface
  Client Version 6, Release 2, Level 2.0
  Client date/time: 06/04/13   19:12:31
(c) Copyright by IBM Corporation and other(s) 1990, 2010. All Rights Reserved.

Node Name: SO_U_BEUXQSYSESB99_ORX_D_CAB
Session established with server TSMSRV1: AIX-RS/6000
  Server Version 5, Release 5, Level 7.0
  Server date/time: 06/04/13   19:12:31  Last access: 06/04/13   15:30:05

ANS1083E No files have previously been archived for '/oracle/export/TIBQADM/*'

This tells us 2 things:

  • the password must be ok
  • nothing has been sent to tape

Next step, run an export at the command line and watch for errors:

su - oracle -c "/home/ibmtools/scripts/rman/bin/backup_full_export.ksh       -s TIBQADM"

Ahaa, permissions trying to create log files. Why? I see it has been started as oracle. This is not right, it should have been started with oraibm.

su - oraibm -c "/home/ibmtools/scripts/rman/bin/backup_full_export.ksh       -s TIBQADM"

All working.

References

  • Installation de Tivoli Data Protection pour Oracle by albanlepunk
  • Tivoli Storage Manager client node lacks authority to delete backup copies
  • Oracle RMAN 11g Backup and Recovery
  • [Editing dsm.sys options]