通过duplicate方式搭建DG,用rman连接主备库的时候,会遇到ORA-12528: TNS:listener: all appropriate instances are blocking new connections。
出现这个错误的原因是备库的实例处于nomount阶段,所以没有被注册在监听里,当处于mount阶段时,PMON进程才会注册实例到监听,因此,从监听状态来看,实例为blocked状态。
结合MOS上的文章419440.1,下面给出常用的2个方案:
- 在备库的listener.ora中注册静态监听
格式为:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = <db_name>)
(ORACLE_HOME = <oracle_home>)
(SID_NAME = <oracle_sid>)
)
)
重启监听后,查看监听状态。
- 使用Oracle10G的特性,在tnsname文件中,在备库的连接串中加入(UR=A),但此方法不适用于ACTIVE DUPLICATE
格式为:
=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <host_name>)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = <service_name>)(UR=A)
)
)
测试连接方法:
- sqlplus sys/@ as sysdba
- startup nomount
- shutdown immediate;
- exit
- sqlplus sys/@ as sysdba
- startup nomount;