Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rman script with parameters

Tags:

shell

oracle

rman

I was trying to pass the backup location to the rman script dynamically as below. But it fails with syntax errors. Is there a way to pass the "/backup/folder/folder/" to the rman script? If I just pass string without "/" it works but with "/" it fails.

rman @${rmanbasepath}rman_replication_from_backups.rcv USING ${dbname} ${backupdir}

backup.rcv

CONNECT AUXILIARY /
run {
allocate auxiliary channel a1 device type disk;
allocate auxiliary channel a2 device type disk;
allocate auxiliary channel a3 device type disk;
allocate auxiliary channel a4 device type disk;
DUPLICATE TARGET DATABASE TO &1
BACKUP LOCATION '&2'
NOFILENAMECHECK;
}
EXIT;
like image 899
user1595858 Avatar asked Mar 19 '15 21:03

user1595858


1 Answers

Found solution from https://community.oracle.com/thread/3514298 . solution is to use single quotes around the double quotes for the substitution parameter

like this:

$ rman @'config.cmd' using "'/rman_backup'"
like image 185
user1595858 Avatar answered Nov 08 '22 16:11

user1595858