Re: Can I pass a parameter into an RMAN Script?

From: Robert Freeman <robertgfreeman_at_yahoo.com>
Date: Mon, 25 Feb 2008 11:59:02 -0800 (PST)
Message-ID: <554673.81495.qm@web38902.mail.mud.yahoo.com>


I doubt you are running 11g, but I thought I'd throw this in ...

11g RMAN offers substitution variables like SQL*Plus does.... So you can do something like this:

backup as compressed backupset database tag '&1' plus archivelog delete input; exit;

And start rman like this:

rman @backup.cmd using 'GOLD_COPY'

I
have not tested the format clause with a substitution (and I'm not around an 11g database just now) but I think it should work. So you can do something like this...

backup as compressed backupset database format '&1' plus archivelog delete input; exit;

and call it...
rman @backup.cmd using '/u01/rman/mydb_%U'

or something like that...
(again, untested so the syntax may not be perfect and the substitution variable may not work in the format clause).

RF  

Robert G. Freeman
Author:
Oracle Database 11g New Features (Oracle Press) Portable DBA: Oracle (Oracle Press)
Oracle Database 10g New Features (Oracle Press) Oracle9i RMAN Backup and Recovery (Oracle Press) Oracle9i New Feature
Blog: http://robertgfreeman.blogspot.com (Oracle Press)

  • Original Message ---- From: Jared Still <jkstill_at_gmail.com> To: sbootsma_at_georgebrown.ca Cc: oracle-l_at_freelists.org Sent: Monday, February 25, 2008 11:50:43 AM Subject: Re: Can I pass a parameter into an RMAN Script?

On Mon, Feb 25, 2008 at 9:45 AM, Sam Bootsma <sbootsma_at_georgebrown.ca> wrote:

format '/san2/orabackup/AAA/CTRL_%d_%T_%p_%s%t';

The same lines for our BBB database looks like:

format '/san2/orabackup/BBB/CTRL_%d_%T_%p_%s%t';  

Try using 'here' documents:



MY_FORMAT='BBB' $ORACLE_HOME/bin/rman checksyntax << EOF run {
        allocate channel ch1 type disk;
        backup database format '/backup/oracle/$MY_FORMAT/DBF_%d_%T_%p_%s%t';
}
EOF
-- 
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist





--
http://www.freelists.org/webpage/oracle-l
Received on Mon Feb 25 2008 - 13:59:02 CST

Original text of this message