Tuesday, April 10, 2012

ORA-16139: media recovery required

During switch physical standby database to primary database i received following error message on (physical standby database)

ٍٍSQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY
*ERROR at line 1:ORA-16139: media recovery required

THE SOLUTION :

SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

SWITCHOVER_STATUS
--------------------
SWITCHOVER LATENT

SQL> RECOVER MANAGED STANDBY DATABASE FINISH;
Media recovery complete.
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;

 Metalink Note:[ID 219554.1]

Thank You
osama

12 comments:

  1. Thank you! Spent ages googling for this and it's a single command: RECOVER MANAGED STANDBY DATABASE FINISH!

    ReplyDelete
    Replies
    1. This is wonderful; Dan I just used this and it fixed my issue. such a simple and practical solution to an apparently sophisticated problem.

      Delete
  2. Hello Osama
    Sorry, but this screwed me up. I wanted a switchover and faced ORA-16139 on my 11.2.0.3. I used "RECOVER MANAGED STANDBY DATABASE FINISH" as you mentioned without specifying that this is used only for FAILOVER only and after you issue switchover sommand, your primary DOES NOT become primary and you find yourself in a AILOVER situation.
    http://docs.oracle.com/cd/B19306_01/server.102/b14239/sql_stmts.htm

    The FINISH clause initiates failover on the target physical standby database and recovers the current standby redo log files. Use the FINISH clause only in the event of the failure of the primary database. This clause overrides any delay intervals spec

    ReplyDelete
    Replies
    1. Agree with Salman.. instead of switchover, failover happens.

      Delete
  3. Hello osama...

    I have also got same error. but unable to switch that to primary...

    alter database RECOVER MANAGED STANDBY DATABASE FINISH;
    alter database RECOVER MANAGED STANDBY DATABASE FINISH
    *
    ERROR at line 1:
    ORA-00283: recovery session canceled due to errors
    ORA-01110: data file 1: '/u01/app/server12c/oradata/testdb1/system.dbf'
    ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
    ORA-01110: data file 1: '/u01/app/server12c/oradata/testdb1/system.dbf'


    this is the error after giving command... please help .... !

    ReplyDelete
  4. alter database RECOVER MANAGED STANDBY DATABASE FINISH;
    Worked for me on time, Thanks a lot Osama Mustafa

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. 1. It works "RECOVER MANAGED STANDBY DATABASE FINISH;" for my case although the return message is difference but same error message...

    2. SELECT SWITCHOVER_STATUS FROM V$DATABASE; return message "Pending performing switchover standby" something like this the error. didnt screen shot my bad...

    Thanks for sharing...

    ReplyDelete
  7. wao just like quickest fix for a while thankd

    ReplyDelete
  8. ORA-00283: recovery session canceled due to errors
    ORA-00331: log version 11.2.0.4.0 incompatible with ORACLE version 11.2.0.0.0

    ReplyDelete
  9. This webpage saved my butt this morning, THANK YOU SO MUCH!

    TIM

    ReplyDelete