Mir Sayeed Hassan – Oracle Blog

Oracle DBA – Tips & Techniques | Learn with real-time examples

  • Translate

  • It’s Me






  • My Certificates

  • Links

    My Acclaim Certification : Credly Profile
    My Oracle ACE Pro Profile

  • Achievements

    Awarded Top 100 Oracle Blogs from Worldwide - #RANK 39
  • VISITORS COUNT

  • Verified International Academic Qualification from World Education Service (WES)

    Verified International Academic Qualification from World Education Service (WES)

  • Jobs

ORA-16139: media recovery required in Oracle Database 11gR2

Posted by Mir Sayeed Hassan on September 15th, 2018

ORA-16139: media recovery required in Oracle Database 11gR2

The Ora-16139 error occur while performing the physical standby database during switchover from physical standby database to primary database in Oracle database 11gR2(11.2.0.4)

Check the status of standby db

SQL> select switchover_status from v$database;

SWITCHOVER_STATUS
 --------------------
 NOT ALLOWED
Or

SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

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

ERROR:

SQL> alter database commit to switchover to primary;
 alter database commit to switchover to primary
 *
 ERROR at line 1:
 ORA-16139: media recovery required

SOLUTION:

SQL> RECOVER MANAGED STANDBY DATABASE FINISH;
 Media recovery complete
SQL> alter database commit to switchover to primary with session shutdown;
 Database altered.
SQL> select status from V$instance;

STATUS
 ------------
 MOUNTED
SQL> shutdown immediate
 ORA-01109: database not open
 Database dismounted.
 ORACLE instance shut down.
SQL> startup
 ORACLE instance started.

Total System Global Area 1.0021E+10 bytes
 Fixed Size 2261848 bytes
 Variable Size 5234494632 bytes
 Database Buffers 4764729344 bytes
 Redo Buffers 19894272 bytes
 Database mounted.
 Database opened.

Verify:

SQL> select INSTANCE_NAME,DATABASE_STATUS,INSTANCE_ROLE,status from V$instance;

INSTANCE_NAME DATABASE_STATUS INSTANCE_ROLE STATUS
 ---------------- ----------------- ------------------ ------------
 standbydb ACTIVE PRIMARY_INSTANCE OPEN

=============Hence tested & verified in our production database===============