4.3,关闭oracle shutdown immediate 启动数据库 startup nomount; alter database mount standby database; alter database add standby logfile; alter database add standby logfile; alter database add standby logfile; alter database recover managed standby database using current logfile disconnect from session;
4.5,查看归档参数,重新设置下: alter system set log_archive_dest_2=‘SERVICE=pdunq_dg lgwr sync affirm VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=pdunq_dg‘; select open_mode , database_role from v$database;
Fatal NI connect error 12514, connecting to: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.121.218)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=pdunq_dg)(CID=(PROGRAM=oracle)(HOST=powerlong4)(USER=oracle))))
VERSION INFORMATION: TNS for Linux: Version 11.2.0.1.0 - Production TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production Time: 10-FEB-2015 16:11:34 Tracing not turned on. Tns error struct: ns main err code: 12564 TNS-12564: TNS:connection refused ns secondary err code: 0 nt main err code: 0 nt secondary err code: 0 nt OS err code: 0 Error 12514 received logging on to the standby Errors in file /oracle/app/oracle/diag/rdbms/pdunq/powerdes/trace/powerdes_arc3_6627.trc: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor PING[ARC3]: Heartbeat failed to connect to standby ‘pdunq_dg‘. Error is 12514.
4.6,去check standby库 ,查看name状况,发现db_unique_name没有设置对,如下所示 SQL> show parameter name;