duplicate database的时候,rman连接 auxiliary database的后状态不正确

时间:2023-11-25 21:02:14

duplicate database的时候,rman连接 auxiliary database的后状态不正确

auxiliary database 已经被startup nomount,但是rman连接后显示状态是not started

$ export ORACLE_SID=dupdb
$ sqlplus '/as sysdba'
SQL> startup nomount $ rman Recovery Manager: Release 11.2.0.1. - Production on Fri Jun :: Copyright (c) , , Oracle and/or its affiliates. All rights reserved. RMAN> connect target sys/oracle@ora11 connected to target database: ORA11 (DBID=) RMAN> connect auxiliary sys/oracle@dupdb connected to auxiliary database: DUPDB (not started)

#not started,说明我们连接到一个空闲例程,这种情况通常就是静态服务名中ORACLE_HOME配置不正确,或者SID配置不正确导致的。
检查监听文件,发现oracle_home路径最后多了一个'/'

SID_LIST_ORA11 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ora11)
(ORACLE_HOME = /u11/app/oracle/product/11.2./dbhome_1)
(SID_NAME =ora11)
)
(SID_DESC =
(GLOBAL_DBNAME = dupdb)
(ORACLE_HOME = /u11/app/oracle/product/11.2./dbhome_1/)
(SID_NAME =dupdb)
)
)

把上面代码中的'/'去掉即可。

另外我们通过sqlplus xxx/xxx@xxx as sysdba的方式也可以测试一下是否连接到启动实例的实例,还是连接上了空闲实例。