SQL> select PROTECTION_MODE,OPEN_MODE,DB_UNIQUE_NAME,DATABASE_ROLE,SWITCHOVER_STATUS from v$database;
PROTECTION_MODE OPEN_MODE DB_UNIQUE_NAME DATABASE_ROLE SWITCHOVER_STATUS
-------------------- -------------------- ------------------------------ ---------------- --------------------
MAXIMUM PERFORMANCE READ ONLY PRIMARY PHYSICAL STANDBY TO PRIMARY
主库:
SQL> select PROTECTION_MODE,OPEN_MODE,DB_UNIQUE_NAME,DATABASE_ROLE,SWITCHOVER_STATUS from v$database;
PROTECTION_MODE OPEN_MODE DB_UNIQUE_NAME DATABASE_ROLE SWITCHOVER_STATUS
-------------------- -------------------- ------------------------------ ---------------- --------------------
MAXIMUM PERFORMANCE READ WRITE
STANDBY PRIMARY SESSIONS ACTIVE
主库alert文件:
ARC1: All Archive destinations made inactive due to error 394
ARC1: Failed to archive thread 1 sequence 1 (394)
ARCH: Archival stopped, error occurred. Will continue retrying
Wed Oct 30 10:25:54 2013
Errors in file c:\oracle\product\10.2.0\admin\orcl\bdump\orcl_arc1_1236.trc:
ORA-16038: log 2 sequence# 1 cannot be archived
ORA-00394: online log reused while attempting to archive it
ORA-00312: online log 2 thread 1: 'C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\STANDBY\ONLINELOG\O1_MF_2_96YY5JSW_.LOG'
ARC1: All Archive destinations made inactive due to error 394
*** 2013-10-30 10:25:54.796 58942 kcrr.c
kcrrfail: dest:1 err:394 force:0 blast:1
*** 2013-10-30 10:25:54.828 20146 kcrr.c
ORA-16038: log 2 sequence# 1 cannot be archived
ORA-00394: online log reused while attempting to archive it
ORA-00312: online log 2 thread 1: 'C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\STANDBY\ONLINELOG\O1_MF_2_96YY5JSW_.LOG'
*** 2013-10-30 10:27:54.734
*** 2013-10-30 10:27:54.734 20146 kcrr.c
*** 2013-10-30 10:28:54.765
kcrrwkx: work to do 0x1 (start)
*** 2013-10-30 10:28:54.781 20146 kcrr.c
这个时候导致主库不再向备库传送日志了,我们只需要重建STANDBY控制文件就行
SQL> alter database create standby controlfile as 'c:\control01.ctl';。
其中当真正主库出现故障的Failovers的时候
一.查看是否有日志GAP,没有应用的日志: -
SQL> SELECT UNIQUE THREAD#, MAX(SEQUENCE#) OVER(PARTITION BY THREAD#) LAST FROM V$ARCHIVED_LOG;
SQL> SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
如果有,则拷贝过来并且注册
SQL> ALTER DATA