ORA-16139: media recovery required

dawn009發表於2014-09-26

如果SWITCHOVER_STATUS= TO PRIMARY

備庫可以順利切換到主庫

 

如果SWITCHOVER_STATUS=sessions active

表示當前仍然活動會話在進行,

這是你可以新增WITH SESSION SHUTDOWN關鍵字在ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY語句之後進行強制關閉會話,

如果不加alert_LEO.log裡有If media recovery active, switchover will wait 900 seconds你需要等待900秒的時間,

這只是一個估計值,實際上時間會更長

 

 

SQL> select switchover_status from v$database;

 

SWITCHOVER_STATUS

--------------------

NOT ALLOWED

 

SQL> /

 

SWITCHOVER_STATUS

--------------------

NOT ALLOWED

 

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> alter database commit to switchover to primary with session shutdown;

出現長時間等待,不能執行完成。

檢查alert.log記錄If media recovery active, switchover will wait 900 seconds.

試著等待900 seconds後,情況依然。

 

SQL> alter database recover managed standby database finish force;

 

Database altered.

 

SQL> select switchover_status from v$database;

 

SWITCHOVER_STATUS

--------------------

TO PRIMARY

 

SQL> alter database commit to switchover to primary;

 

Database altered.

大功告成。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29119536/viewspace-1281894/,如需轉載,請註明出處,否則將追究法律責任。

相關文章