Read Oracle RMAN 11g Backup and Recovery Online
Authors: Robert Freeman
*****************************************************************
* *
* Sample Client System Options file for UNIX (dsm.sys.smp) *
*****************************************************************
* using TSM. Copy dsm.sys.smp to dsm.sys. In the dsm.sys file,
* enter the appropriate values for each option listed below and
* remove the leading asterisk (*) for each one.
* If your client node communicates with multiple TSM servers, be
* sure to add a stanza, beginning with the SERVERNAME option, for
* each additional server.
******************************************************************
Chapter 9: RMAN and Tivoli Storage Manager
197
SErvername SERVER1
COMMmethod TCPip
TCPPort 1500
TCPServeraddress 192.168.2.69
Passwordaccess prompt
The IP address 192.168.2.69 is the address of the server tsm01. To avoid manually entering a password for every backup, you will use the
tdpoconf
utility later in this chapter to create a password file that TDPO will use to authenticate with the TSM server.
Step 5.
Create dsm.opt. The file dsm.opt defines the TSM server name you will use for backups on this node. In the directory /opt/tivoli/tsm/client/oracle/bin, create a file with one line, as follows: SERVERNAME SERVER1
Step 6.
Register the TDPO node. To register the Oracle server with TSM, use this command on the TSM console:
reg node oc1 oracle orabakpw maxnummp 2 passexp 0
To enable the RMAN catalog’s archiving and expiration settings to control backup retention on the TSM server, update the configuration for node oc1_oracle on the TSM node by using this console command:
update node oc1 oracle backdelete yes
Step 7.
Configure TSM copy group options. Since RMAN creates different backup filenames for each backup file it creates, all backup objects saved to the TSM backup storage pool have unique filenames, and therefore they will never expire. As a result, you must set the copy group attribute
verdeleted
to
0
so that TDPO can remove unwanted backup objects from the TSM backup storage pool when an RMAN command or policy sets the backup object to an inactive or expired state.
The parameter
verdeleted
specifies the maximum number of backup versions to retain for files that have been deleted from the client; therefore, setting this value to
0
ensures that the expired backup files on the TSM server are deleted the next time expiration processing occurs.
In this example, you are using the default copy group for your TDPO backups, so you set the option
verdeleted
as follows:
TSM:SERVER1> update copygroup standard standard standard verdeleted 0
ANR2017I Administrator SERVER CONSOLE issued command:
UPDATE COPYGROUP standard standard standard verdeleted 0
ANR1532I Backup copy group STANDARD updated in policy domain
STANDARD, set STANDARD, management class STANDARD.
TSM:SERVER1>
Step 8.
Generate the tdpo password file. To ensure that you do not have to interactively specify a password for every RMAN backup to the TSM server, use the
tdpoconf
utility as follows:
[root@oc1 bin]#
tdpoconf password
198
Part II: Setup Principles and Practices
IBM Tivoli Storage Manager for Databases:
Data Protection for Oracle
Version 5, Release 2, Level 0.0
(C) Copyright IBM Corporation 1997, 2003. All rights reserved.
**********************************************************
* Password file initialization/update program *
* ROOT privilege needed to update value *
**********************************************************
Please enter new password:
Please reenter new password for verification:
ANU0260I Password successfully changed.
[root@oc1 bin]#
The
tdpoconf
utility creates or updates an encrypted password file called /opt/tivoli/tsm/client/
oracle/bin/TDPO.oc1_oracle.
Step 9.
In addition to the links created during the installation of the package TDP-Oracle.i386.
rpm, you need to create a symbolic link to the TSM library functions in Oracle’s default library directory, as follows:
ln /opt/Tivoli/tsm/client/oracle/bin/libobk.so
$ORACLE HOME/lib/libobk.so
The RPM utility has no way of knowing where your Oracle executables and libraries are stored, thus you must define this link manually. If you have multiple Oracle homes, you need to create the link in each home that you want to be able to use TDPO in.
Libobk is the generic name for the library file. Each backup vendor that wants to interface with RMAN will provide a library file that is linked to the libobk file.
Step 10.
Test TDPO connectivity. To ensure that you can establish a connection to the TSM
server, use the sbttest utility. You can find sbttest in the directory $ORACLE_HOME/bin. To run sbttest, set the environment variable TDPO_OPTFILE to point to the tdpo.opt configuration file you created earlier, and then run the
sbttest test
command, as in this example:
[oracle@oc1 bin]$ export
TDPO OPTFILE /opt/tivoli/tsm/client/oracle/bin/tdpo.opt
[oracle@oc1 bin]$ 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
[oracle@oc1 bin]$
The output—sbtinit—succeeded and a return code of
–
1 from the command indicates that the test ran successfully.
Chapter 9: RMAN and Tivoli Storage Manager
199
Performing an RMAN Backup Using TDPO
Now that the TDPO setup is complete, you’re ready to perform your first RMAN backup. You’ll use the
allocate channel
command in an RMAN session to define the backup location; even though your channel type is always
sbt_tape
, the actual backup device on the TSM server could be a disk, a writable DVD, or a physical tape drive; RMAN doesn’t know and you don’t care what physical device will contain the backup, as long as you can recover the database when disaster strikes!
In this first example, you back up just the USERS tablespace to TSM:
[oracle@oc1 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Jan 26 11:17:01 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: RAC (DBID 2170964680)
RMAN> run
2> { allocate channel tdpo type 'sbt tape' parms
3> 'ENV (TDPO OPTFILE
4> /opt/tivoli/tsm/client/oracle/bin/tdpo.opt)';
5> backup tablespace users;
6> release channel tdpo;
7> }
using target database control file instead of recovery catalog
allocated channel: tdpo
channel tdpo: sid 293 instance rac1 devtype SBT TAPE
channel tdpo: Tivoli Data Protection for
Oracle: version 5.5.1.0
Starting backup at 22-JUL-06
channel tdpo: starting full datafile backupset
channel tdpo: specifying datafile(s) in backupset
input datafile fno 00004
name +DATA/rac/datafile/users.259.582982545
channel tdpo: starting piece 1 at 26-JAN-2010
channel tdpo: finished piece 1 at 26-JAN-2010
piece handle 02horjvc 1 1 tag TAG20060722T212604
comment API Version 2.0,MMS Version 5.2.0.0
channel tdpo: backup set complete, elapsed time: 00:00:03
Finished backup at 25-JAN-2010
released channel: tdpo
RMAN>
200
Part II: Setup Principles and Practices
The only bit of extra work you need to do to back up to TSM is to specify the location of the TDPO options file in the RMAN
env
parameter. In this second example, you back up the entire database:
RMAN> run
2> { allocate channel tdpo type 'sbt tape' parms
3> 'ENV (TDPO OPTFILE
4> /opt/tivoli/tsm/client/oracle/bin/tdpo.opt)';
5> backup database;
6> release channel tdpo;
7> }
allocated channel: tdpo
channel tdpo: sid 293 instance rac1 devtype SBT TAPE
channel tdpo: Tivoli Data Protection for Oracle: version 5.5.1.0
Starting backup at 26-JAN-2010
channel tdpo: starting full datafile backupset
channel tdpo: specifying datafile(s) in backupset
input datafile fno 00003 name +DATA/rac/datafile/sysaux.257.582982545
input datafile fno 00001 name +DATA/rac/datafile/system.256.582982545
input datafile fno 00002 name +DATA/rac/datafile/undotbs1.258.582982545
input datafile fno 00005 name +DATA/rac/datafile/example.264.582982703
input datafile fno 00006 name +DATA/rac/datafile/undotbs2.265.582982943
input datafile fno 00007 name +DATA/rac/datafile/undotbs3.266.582983003
input datafile fno 00004 name +DATA/rac/datafile/users.259.582982545
channel tdpo: starting piece 1 at 26-JAN-2010
channel tdpo: finished piece 1 at 26-JAN-2010
piece handle 03hork9s 1 1 tag TAG20060722T213140 comment API
Version 2.0,MMS Version 5.5.1.0
channel tdpo: backup set complete, elapsed time: 00:03:26
channel tdpo: starting full datafile backupset
channel tdpo: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel tdpo: starting piece 1 at 26-JAN-2010
channel tdpo: finished piece 1 at 26-JAN-2010
piece handle 04horkga 1 1 tag TAG20060722T213140 comment API
Version 2.0,MMS Version 5.5.1.0
channel tdpo: backup set complete, elapsed time: 00:00:06
Finished backup at 26-JAN-2010
released channel: tdpo
RMAN>
Note that you do not have to specify where the backup goes or what disk device to use. TSM
automatically puts the backup files into one or more of the storage pool’s volumes.
By querying the RMAN catalog, you can see both of the backups you just created: RMAN> list backup;
using target database control file instead of recovery catalog
Chapter 9: RMAN and Tivoli Storage Manager
201
List of Backup Sets
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 2.00M SBT TAPE 00:00:02 26-JAN-2010
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: