日誌不得應用情況切換強制standby改變狀態為primary
備庫執行如下:
alter database recover managed standby database disconnect from session;
alter database commit to switchover to primary
日誌反應如下:
Maximum wait for role transition is 15 minutes.
2016-09-07 12:57:20.653000 +08:00
Switchover: Media recovery is still active
Database not available for switchover
End-Of-REDO archived log file has not been recovered
Database not available for switchover
End-Of-REDO archived log file has not been recovered
2016-09-07 12:57:22.681000 +08:00
Database not available for switchover
End-Of-REDO archived log file has not been recovered
Database not available for switchover
End-Of-REDO archived log file has not been recovered
下面將STANDBY資料庫切換為PRIMARY資料庫:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
或
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE;
SELECT DATABASE_ROLE FROM V$DATABASE;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
這樣備庫可切換成primary 了