rman备份密码报错-转义
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了rman备份密码报错-转义相关的知识,希望对你有一定的参考价值。
同事备份遇到了一个报错,提示用户密码拒绝。经过确认用户和密码都没有问题,那可能是什么问题呢!1、现象
<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin>$
<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin>$sh rman.sh
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Feb 13 22:12:56 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1483481154)
RMAN> 2> 3>
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-12001: could not open channel t1
RMAN-10008: could not create channel context
RMAN-10003: unable to connect to target database
ORA-01017: invalid username/password; logon denied
RMAN>
2、部分脚本内容
<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin>$vi rman.sh
$ORACLE_HOME/bin/rman target / <<EOF
run{
allocate channel t1 device type disk connect ‘sys/[email protected]‘;
#发现这个密码里有特殊符号$
}
exit
EOF
3、解决方法
<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin>$
<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin>$cat rman.sh
$ORACLE_HOME/bin/rman target / <<EOF
run{
allocate channel t1 device type disk connect ‘sys/xxxx\[email protected]‘;
}
exit
EOF
shell 脚本中特殊符号需要使用\转义处理一下。
再次执行
<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin>$sh rman.sh
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Feb 13 22:13:20 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1483481154)
RMAN> 2> 3>
using target database control file instead of recovery catalog
allocated channel: t1
channel t1: SID=46 device type=DISK
released channel: t1
RMAN>
小结:
当我们在shell脚本里执行相关命令,一定要关注特殊符号的转义问题。
以上是关于rman备份密码报错-转义的主要内容,如果未能解决你的问题,请参考以下文章
Oracle数据库误删文件导致rman备份报错RMAN-06169解决办法
ORACLE rman备份报错之RMAN-03009&ORA-19587&ORA-27072
使用rman备份到挂载的NFS目录,提示ORA-19504-27054报错
使用rman备份到挂载的NFS目录,提示ORA-19504-27054报错