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;
SQL> RECOVER MANAGED STANDBY DATABASE FINISH;
Media recovery complete.
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
Metalink Note:[ID 219554.1]
Published by Osama Mustafa
Osama considered as one of the leaders in Cloud technology, DevOps and database in the Middle-East. I have more than ten years of experience within the industry. moreover, certfied 4x AWS , 4x Azure and 6x OCI, have also obtained database certifications for multiple providers.
In addition to having experience with Oracle database and Oracle products, such as middle-ware, OID, OAM and OIM, I have gained substantial knowledge with different databases.
Currently, I am architecting and implementing Cloud and DevOps. On top of that, I'm providing solutions for companies that allow them to implement the solutions and to follow the best practices.
View all posts by Osama Mustafa
13 thoughts on “ORA-16139: media recovery required”
Thank you! Spent ages googling for this and it's a single command: RECOVER MANAGED STANDBY DATABASE FINISH!
Hello OsamaSorry, but this screwed me up. I wanted a switchover and faced ORA-16139 on my 220.127.116.11. 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.htmThe 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
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 errorsORA-01110: data file 1: '/u01/app/server12c/oradata/testdb1/system.dbf'ORA-01157: cannot identify/lock data file 1 – see DBWR trace fileORA-01110: data file 1: '/u01/app/server12c/oradata/testdb1/system.dbf'this is the error after giving command… please help …. !
alter database RECOVER MANAGED STANDBY DATABASE FINISH; Worked for me on time, Thanks a lot Osama Mustafa
Your more than welcome 🙂
This is wonderful; Dan I just used this and it fixed my issue. such a simple and practical solution to an apparently sophisticated problem.
This comment has been removed by the author.
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…
Agree with Salman.. instead of switchover, failover happens.
wao just like quickest fix for a while thankd
ORA-00283: recovery session canceled due to errorsORA-00331: log version 18.104.22.168.0 incompatible with ORACLE version 22.214.171.124.0
This webpage saved my butt this morning, THANK YOU SO MUCH!TIM
Thanks a lot