Sie sind auf Seite 1von 6

RMAN configuration with Tivoli

Data Protection for Oracle (TDPO)


Jul14th
20113

CommentsWritten by Yannick

TableOfContents
1.

Preamble

2.

TSM Configuration

3.

Oracle Configuration

4.

RMAN backup

5.

References

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
total 20
drwxr-xr-x 4 root bin 4096 Jun 7
drwxr-xr-x 3 root bin 4096 Jun 7
drwxr-xr-x 3 root bin 4096 Jun 7
drwxr-xr-x 3 root bin 4096 Jun 7
drwxr-xr-x 5 root root 4096 Jun 7

/opt/tivoli/tsm/client
15:28
15:27
15:28
15:27
15:29

api
icc32
icc64
lang
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
TDPO_NODE
TDPO_OWNER
TDPO_PSWDPATH

/adsmorc
oracleserver.domainname
root
/opt/tivoli/tsm/client/oracle/bin64

TDPO_DATE_FMT
TDPO_NUM_FMT
TDPO_TIME_FMT

1
1
1

TDPO_MGMT_CLASS_2
TDPO_MGMT_CLASS_3
TDPO_MGMT_CLASS_4

mgmtclass2
mgmtclass3
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 Name:
Server Address:
Server Type:
Server Port:
Communication Method:

Server Information
tsmserver.sgp.st.com
tsmserver.sgp.st.com
Linux/x86_64
1511
TCP/IP

Session Information
Owner Name:
Node Name:
Node Type:
DSMI_DIR:
DSMI_ORC_CONFIG:
TDPO_OPTFILE:
Password Directory:
Compression:
License Information:

root
oracleserver.domainname
TDPO LinuxAMD64
/opt/tivoli/tsm/client/api/bin64
/opt/tivoli/tsm/client/oracle/bin64/dsm.opt
/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt
/opt/tivoli/tsm/client/oracle/bin64
FALSE
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
[root@oracleserver.domainname
[root@oracleserver.domainname
[root@oracleserver.domainname
[root@oracleserver.domainname

/]#
/]#
/]#
/]#
/]#

chmod a+r /opt/tivoli/tsm/client/oracle/bin64/tdpo.opt


chown root:dba /opt/tivoli/tsm/client/oracle/bin64/tdpoerror.log
chmod g+rw /opt/tivoli/tsm/client/oracle/bin64/tdpoerror.log
chown -R root:dba /var/log/tsm
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. Dont be too
generous while giving those rights
And thats 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
Im 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
allocate
allocate
allocate

channel
channel
channel
channel

sbt1
sbt2
sbt3
sbt4

type
type
type
type

sbt
sbt
sbt
sbt

parms
parms
parms
parms

'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
'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
release
release
release
}

channel
channel
channel
channel

sbt1;
sbt2;
sbt3;
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"

Das könnte Ihnen auch gefallen