Table Of Contents
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 you 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 Configuration
Configuration is made of four files:
[root@oracleserver.domainname /]# cat /opt/tivoli/tsm/client/api/bin64/dsm.opt Servername tsmserver.sgp.st.com |
[root@oracleserver.domainname /]# 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 |
[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.sgp.st.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@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:
[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.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:
[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
- 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
excellent material, Thanks
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.
Hi,
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmcncpt.htm#i1025065
So for me, no, not possible even if I would also like to do it….
The only options I see are:
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…
Hi Yannick,
I find the blog truly useful for TDP backup configuration. Its a small guide to start with TDP backup in few minutes.