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脚本里执行相关命令,一定要关注特殊符号的转义问题。

原文地址:http://blog.51cto.com/roidba/2071596

时间: 2024-10-10 04:45:40

rman备份密码报错-转义的相关文章

修改mysql存储引擎备份数据库报错及解决方案

备份数据库报错 原因:由于监控服务器最近cpu负载比较高.(cpu4核心,负载2.7左右)感觉很奇怪,因为别的服务器mysql占用的资源并不多,因此我首先优化了数据库的配置文件.cpu稍微下降了一点,但是没有特别明显的变化. 于是,从mysql的存储引擎和日志考虑,结果发现默认用的引擎是myisam.好吧.换成innodb,(由于事先我没备份,就在配置文件修改了引擎,因为日志除了二进制其他并没有开启.所以没动它.重启数据库. ok 早就听说这两个引擎,区别,看来性能差别真大啊! 好吧.备份数据库

linux系统中修改密码报错的问题

1.mysql密码报错的原因 报错信息 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements 原因:原来MySQL5.6.6版本之后增加了密码强度验证插件validate_password,相关参数设置的较为严格.使用了该插件会检查设置的密码是否符合当前设置的强度规则,若不满足则拒绝设置. 解决:1.该问题其实与mysql的validate_password_policy的值有关. 2

xtrabackup备份MySQL报错:InnoDB: Error number 24 means &#39;Too many open files&#39;

xtrabackup备份MySQL报错:InnoDB: Error number 24 means 'Too many open files' 1.使用xtrabackup备份MySQL时出现如下报错: 190228 00:30:01 >> log scanned up to (88343615848) xtrabackup: Generating a list of tablespaces InnoDB: Allocated tablespace ID 2 for mysql/plugin,

MySQL 设置root密码报错:mysqladmin: connect to server at &#39;localhost&#39; failed

MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed 1.安装完MySQL设置root密码报错如下 [root@vm172-31-0-6 data]# mysqladmin -uroot password "linux@123" mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root

Mysql5.7.18.1修改用户密码报错ERROR 1054 (42S22):

mysql> update user set password=password("新密码") where user="用户名";执行后报错 ERROR 1054(42S22) Unknown column 'password' in 'field list' 错误的原因是 5.7版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string 所以请使用一下命令: mysql -u root

SharePoint 2013 PowerShell命令备份还原报错

错误截图: 文字描述: Restore-SPSite : <nativehr>0x80070003</nativehr><nativestack></nativestack> At line:1 char:1 + Restore-SPSite http://localhost/sites/test -Path D:\backup\DBT123 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DG环境RMAN删除归档报错RMAN-08137: archived log not deleted

Oracle 12C DG环境,备库归档目录告警,查看crontab脚本,发现有删除操作,保持两天的,后手动执行,查看具体报错原因: RMAN> delete noprompt expired archivelog all; released channel: ORA_DISK_1allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=5408 device type=DISKspecification does not match any ar

mysql5.7设置简单密码报错ERROR 1819 (HY000): Your password

[问题] 有时候,只是为了自己测试,不想密码设置得那么复杂,譬如只想设置root的密码为123456. SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456'); 但是会报错: mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123');ERROR 1819 (HY000): Your password does not satisfy the current policy re

CentOS8中执行mysqladmin重置密码报错问题

报错现象: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)' 解决方案: 1,执行/etc/init.d/mysqld stop停止mysql服务 2,新开一个终端执行:mysqld_safe --skip-grant-tables & 3,在原来的终端执行命令:/usr/bin/mysql -uroot -p 进行无密码