5

我试图将备份位置动态传递给 rman 脚本,如下所示。但它因语法错误而失败。有没有办法将“/backup/folder/folder/”传递给rman脚本?如果我只传递没有“/”的字符串,它可以工作,但使用“/”它会失败。

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

备份文件

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;
4

1 回答 1

6

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

像这样:

$ rman @'config.cmd' using "'/rman_backup'"
于 2015-03-23T04:36:00.280 回答