RMAN-06217: not connected to auxiliary database with a net service name

背景:

基于Oracle19c搭建Oracle Data Guard在执行rman步骤时报错

报错:

rman target sys/test123$@test AUXILIARY  sys/test123$@test_stby

RMAN> duplicate target database for standby from active database dorecover nofilenamecheck;
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 
RMAN-05501: aborting duplication of target database
RMAN-06217: not connected to auxiliary database with a net service name

解决:

搜遍了RMAN-06217帖子,都没能解决我的问题,后来观察rman target sys/test123 @ t e s t a u x i l i a r y s y s / t e s t 123 @test auxiliary sys/test123 @testauxiliarysys/test123@test_stby这一步的信息:

[oracle@localhost ~]$ rman TARGET sys/test123$@test AUXILIARY sys/test123$@test_stby

Recovery Manager: Release 19.0.0.0.0 - Production on 
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: test (DBID=1111111111)
connected to auxiliary database: test (DBID=1111111111)

很明显这一步的connected to auxiliary database: test (DBID=1111111111)和正常的信息是有区别的,理论上备库是nomount启动的应该是(not mounted),在确认tnsnames.ora没问题并且tnsping test_stby能正常返回的情况下,依然报这个错,十分无解,通过观察DBID一致并且报错是连接不到备库这点信息,便怀疑备库配置连接到了主库,便单独修改备库sys的密码准备测试,但后续报错需要保持主备的密码一致,主库也得修改密码,改完后十分巧合的解决了这个问题。

# 主备库密码全修改保持一致
sqlplus / as sysdba
SQL> alter user sys identified by "test123";
[oracle@localhost ~]$ rman TARGET sys/test123@test AUXILIARY sys/test123@test_stby

Recovery Manager: Release 19.0.0.0.0 - Production on 
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: test (DBID=1111111111)
connected to auxiliary database: test (not mounted)

问题就出在密码上:$ , 密码不要加奇怪的字符!

你可能感兴趣的:(数据库)