RMAN scripts & variables/parameters
567987Mar 20 2007 — edited Mar 22 2007Hi
We are using RMAN with TSM. There are a number of 9i and 8i databases. I tried to set the environment up to with as few scripts as possible to cover the variety of databases. I provide various variables/parameters to handle the differences between the various databases.
In the 9i environment I "CONFIGURE" as much as possible to avoid setting changes in the actual backup script. That gives me a fairly clean generic backup script which also avoids manual channel allocations ie :
run
{
backup incremental level=0
not backed up since time='SYSDATE-(8/24)'
check logical
filesperset=4
format='/LVL0_%d_%T_%U'
(database include current controlfile)
plus archivelog format '/ARC_%d_%T_%U' delete all input;
}
However due to the lack of "CONFIGURE" in 8i I cannot configure automatic channels. Therefor my script has to change to :
run
{
allocate channel ch01 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
allocate channel ch02 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
allocate channel ch03 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
allocate channel ch04 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
backup incremental level=0
check logical
filesperset=4
format='/LVL0_%d_%T_%U'
(database include current controlfile)
(archivelog all format '/ARC_%d_%T_%U' delete input);
release channel ch01;
release channel ch02;
release channel ch03;
release channel ch04;
}
I have multiple database instances on the same server & would like to have a single generic script with a variable/parameter to change the "tdpo.opt" file for each instance. The alternate is to have a complete set of scripts for each DB instance with everything hard coded.
The question is : Can I pass variables/parameters to a RMAN script? If yes, how do I go about it?
Maybe there are other ideas out there to do this. The key to me in this whole execise is to reduce maintenance & increase flexibility.
Your responses will be appreciated
CM