oracle – 带参数的rman脚本

前端之家收集整理的这篇文章主要介绍了oracle – 带参数的rman脚本前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图动态地将备份位置传递给rman脚本,如下所示.但它失败了语法错误.有没有办法将“/ backup / folder / folder /”传递给rman脚本?如果我只是传递没有“/”的字符串它可以工作,但是“/”它会失败.

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;

解决方法

https://community.oracle.com/thread/3514298找到解决方案.解决方案是在替换参数的双引号周围使用单引号

像这样:

$rman @'config.cmd' using "'/rman_backup'"

猜你在找的Oracle相关文章