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.0 - Production on Fri Jun 26 14:16:14 2015

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

RMAN> connect  target sys/oracle@ora11

connected to target database: ORA11 (DBID=785451981)

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.0/dbhome_1)
                (SID_NAME =ora11)
                )
                (SID_DESC =
                        (GLOBAL_DBNAME = dupdb)
                        (ORACLE_HOME = /u11/app/oracle/product/11.2.0/dbhome_1/)
                        (SID_NAME =dupdb)
                )
        )

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

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