主备库切换时有点小错误,记录如下:
主库:
select LOG_MODE,CONTROLFILE_TYPE,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database;
LOG_MODE CONTROL OPEN_MODE PROTECTION_MODE DATABASE_ROLE
------------ ------- ---------- -------------------- ----------------
SWITCHOVER_STATUS
--------------------
ARCHIVELOG CURRENT READ WRITE MAXIMUM PROTECTION PRIMARY
TO STANDBY
SQL> alter database commit to switchover to physical standby;
Database altered.
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup mount
select LOG_MODE,CONTROLFILE_TYPE,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database;
LOG_MODE CONTROL OPEN_MODE PROTECTION_MODE DATABASE_ROLE
------------ ------- ---------- -------------------- ----------------
SWITCHOVER_STATUS
--------------------
ARCHIVELOG STANDBY MOUNTED MAXIMUM PROTECTION PHYSICAL STANDBY
TO PRIMARY
备库:
select LOG_MODE,CONTROLFILE_TYPE,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database;
LOG_MODE CONTROL OPEN_MODE PROTECTION_MODE DATABASE_ROLE
------------ ------- ---------- -------------------- ----------------
SWITCHOVER_STATUS
--------------------
ARCHIVELOG STANDBY MOUNTED MAXIMUM PROTECTION PHYSICAL STANDBY
SWITCHOVER PENDING
SQL> alter database commit to switchover to primary;
alter database commit to switchover to primary
*
ERROR at line 1:
ORA-16139: media recovery required
SQL> !
[oracle@linux2 ~]$ tail /oracle/oradata/standby/bdump/alert_stand.log
End-Of-REDO archived log file has not been recovered
Archived log files detected beyond End-Of-REDO
Incomplete recovery SCN:0:234931 archive SCN:0:265075
Database not available for switchover
End-Of-REDO archived log file has been received
End-Of-REDO archived log file has not been recovered
Archived log files detected beyond End-Of-REDO
Incomplete recovery SCN:0:234931 archive SCN:0:265075
Switchover: Media recovery required - standby not in limbo
ORA-16139 signalled during: alter database commit to switchover to primary...
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> !
[oracle@linux2 ~]$ tail /oracle/oradata/standby/bdump/alert_stand.log
Completed: alter database recover managed standby database disconnect from session
Tue Apr 15 09:08:37 2008
Media Recovery Log /oracle/oradata/standby/arch/1_29_651601678.dbf
Media Recovery Log /oracle/oradata/standby/arch/1_30_651601678.dbf
Media Recovery Log /oracle/oradata/standby/arch/1_31_651601678.dbf
Media Recovery Log /oracle/oradata/standby/arch/1_32_651601678.dbf
Media Recovery Log /oracle/oradata/standby/arch/1_33_651601678.dbf
Media Recovery Log /oracle/oradata/standby/arch/1_34_651601678.dbf
Media Recovery Log /oracle/oradata/standby/arch/1_35_651601678.dbf
Media Recovery Log /oracle/oradata/standby/arch/1_36_651601678.dbf
SQL> select LOG_MODE,CONTROLFILE_TYPE,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database;
LOG_MODE CONTROL OPEN_MODE PROTECTION_MODE DATABASE_ROLE
------------ ------- ---------- -------------------- ----------------
SWITCHOVER_STATUS
--------------------
ARCHIVELOG STANDBY MOUNTED MAXIMUM PROTECTION PHYSICAL STANDBY
TO PRIMARY
SQL> alter database commit to switchover to primary;
Database altered.
SQL> alter database open;
Database altered.
SQL> select LOG_MODE,CONTROLFILE_TYPE,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database;
LOG_MODE CONTROL OPEN_MODE PROTECTION_MODE DATABASE_ROLE
------------ ------- ---------- -------------------- ----------------
SWITCHOVER_STATUS
--------------------
ARCHIVELOG CURRENT READ WRITE MAXIMUM PROTECTION PRIMARY
TO STANDBY
阅读(3877) | 评论(0) | 转发(0) |