以只读模式打开备库:
SQL> alter database open read only;
alter database open read only
*
ERROR at line 1:
ORA-10458: standby database requires recovery
ORA-01152: file 2 was not restored from a sufficiently old backup
ORA-01110: data file 2: '+DATA/test2/datafile/sysaux01.dbf'
查看主库:
Error 12154 received logging on to the standby
FAL[server, ARC3]: Error 12154 creating remote archivelog file 'test1'
FAL[server, ARC3]: FAL archive failed, see trace file.
ARCH: FAL archive failed. Archiver continuing
ORACLE Instance test1 - Archival Error. Archiver continuing.
Thu Dec 18 15:52:42 2014
Error 12154 received logging on to the standby
FAL[server, ARC3]: Error 12154 creating remote archivelog file 'test1'
FAL[server, ARC3]: FAL archive failed, see trace file.
ARCH: FAL archive failed. Archiver continuing
ORACLE Instance test1 - Archival Error. Archiver continuing.
Thu Dec 18 15:53:02 2014
Error 12154 received logging on to the standby
Suppressing further error logging of LOG_ARCHIVE_DEST_2.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
--------------------
FAILED DESTINATION
SQL> show parameter LOG_ARCHIVE_DEST_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2 string service=test1 async valid_for=
(online_logfile,primary_role)
db_unique_name=test2
SQL> select error from v$archive_dest;
ERROR
-----------------------------------------------------------------
ORA-12154: TNS:could not resolve the connect identifier specified
原因是log_archive_dest_2中service 要等于tnsnames.ora中net service name test21
test21 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.205.0.30)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test1)
)
)
SQL> alter system set log_archive_dest_2 = 'service=test21 async valid_for=(online_logfile,primary_role) db_unique_name=test2';
System altered.
注意要重启主库才能生效