Home » Infrastructure » Linux » rman scripting in linux
rman scripting in linux [message #161894] Tue, 07 March 2006 14:46 Go to next message
renichols
Messages: 1
Registered: March 2006
Location: Central Illinois
Junior Member
I am trying to create a script that will use parameters to clone my db. However, when I use the rman create script below in my linux shell script it creates my db files incorrectly. I want them to look like "devel_AUXILIARY_SID_01.dbf" but as below they turn out "devel_.dbf" . if I put a \ before _01 ('/u02/oradata/$AUXILIARY_SID/devel_$AUXILIARY_SID\_01.dbf) then it stores it as "devel_PPRD\_01.dbf.

ANY IDEAS?

...
TARGET_SID=$1
AUXILIARY_SID=$2

#CONNECT TO TARGET, CATALOG, AND AUXILIARY
rman target sys/$PSWD@$TARGET_SID catalog rman/$RMAN_PSWD@oemrep auxiliary sys/$PSWD@$AUXILIARY_SID <<EOF

#CREATE NEW CLONE SCRIPT
CREATE SCRIPT clone_db
{
allocate auxiliary channel aux1 device type disk;
set newname for datafile 3 to '/u02/oradata/$AUXILIARY_SID/devel_$AUXILIARY_SID_01.dbf';
set newname for datafile 1 to '/u02/oradata/$AUXILIARY_SID/system_$AUXILIARY_SID_01.dbf';
set newname for datafile 2 to '/u02/oradata/$AUXILIARY_SID/undotbs_$AUXILIARY_SID_01.dbf';
set newname for datafile 8 to '/u02/oradata/$AUXILIARY_SID/banaq_$AUXILIARY_SID_01.dbf';
set newname for datafile 7 to '/u02/oradata/$AUXILIARY_SID/xdb_$AUXILIARY_SID_01.dbf';
set newname for datafile 4 to '/u02/oradata/$AUXILIARY_SID/indx_$AUXILIARY_SID_01.dbf';
set newname for datafile 6 to '/u02/oradata/$AUXILIARY_SID/users_$AUXILIARY_SID_01.dbf';
set newname for datafile 5 to '/u02/oradata/$AUXILIARY_SID/tools_$AUXILIARY_SID_01.dbf';
duplicate target database to $AUXILIARY_SID
logfile
group 1 ('/u02/oradata/$AUXILIARY_SID/redo_$AUXILIARY_SID_01.log') size 1m,
group 2 ('/u02/oradata/$AUXILIARY_SID/redo_$AUXILIARY_SID_02.log') size 1m,
group 3 ('/u02/oradata/$AUXILIARY_SID/redo_$AUXILIARY_SID_03.log') size 1m;
}

EOF
Re: rman scripting in linux [message #161946 is a reply to message #161894] Wed, 08 March 2006 00:05 Go to previous message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member


I think the problem is, AUXILIARY_SID is a variable declared at OS level and you are trying to call it inside RMAN.

If this is the case then you need to make few changes in your scripts. The script should be written at OS level.

You can have a look at few of the scripts on this website.

www.orafaq.com/scripts
Previous Topic: its urgent.......cant compile pro*c code.i have to submit immediatly
Next Topic: which linux distro for 9i release 2 ?
Goto Forum:
  


Current Time: Fri Mar 29 09:42:38 CDT 2024