Failover with Reinstate using Broker Test Oracle 12

Version 1

    Converted from post on 9/18/2016

     

    Scenario Setup

     

    Check for the PMON background process:

     

    /u01/app/oracle/diag/rdbms/primary/PRIMARY/trace:PRIMARY>ps -ef | grep pmon | grep -v grep

     

    oracle 19874     1  0 13:22 ?        00:00:00 ora_pmon_PRIMARY

     

    Then kill it.

     

    PRIMARY >kill -9 19874

     

    Confirm it is gone.

     

    /u01/app/oracle/diag/rdbms/primary/PRIMARY/trace:PRIMARY> ps -ef | grep PRIMARY

    oracle   30637 31386  0 15:28 pts/1    00:00:00 grep PRIMARY

     

    /u01/app/oracle/diag/rdbms/primary/PRIMARY/trace:PRIMARY> ps -ef | grep PRIMARY

    oracle   30637 31386  0 15:28 pts/1    00:00:00 grep PRIMARY

     

    Start broker, connect and display the configuration:

     

    /u01/app/oracle/diag/rdbms/primary/PRIMARY/trace:PRIMARY>dgmgrl

    DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production

     

    Copyright (c) 2000, 2013, Oracle. All rights reserved.

     

    Welcome to DGMGRL, type "help" for information.

    DGMGRL> connect /

    Connected as SYSDG.

    DGMGRL> show configuration

    ORA-01034: ORACLE not available

    Process ID: 0

    Session ID: 0 Serial number: 0

     

    Configuration details cannot be determined by DGMGRL

     

    Failover

     

    Perform the Failover:

     

    DGMGRL> connect dga/*********@STANDBY

    Connected as SYSDG.

     

    DGMGRL> failover to 'standby'

    Performing failover NOW, please wait...

    Failover succeeded, new primary is "standby"

     

     

     

    Check the configuration again:

     

    DGMGRL> show configuration

     

    Configuration - broker1

     

      Protection Mode: MaxPerformance

      Members:

      standby - Primary database

        PRIMARY - Physical standby database (disabled)

          ORA-16661: the standby database needs to be reinstated

     

    Fast-Start Failover: DISABLED

     

    Configuration Status:

    SUCCESS   (status updated 53 seconds ago)

     

     

    DGMGRL> reinstate database 'PRIMARY'

    Reinstating database "PRIMARY", please wait...

    Error: ORA-16653: failed to reinstate database

     

    1. Failed.

    Reinstatement of database "PRIMARY" failed

     

    SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 27 15:37:46 2016

     

    Copyright (c) 1982, 2014, Oracle. All rights reserved.

     

    Connected to an idle instance.

     

    SQL> startup mount

    ORACLE instance started.

     

    Total System Global Area 1509949440 bytes

    Fixed Size 2924640 bytes

    Variable Size 654315424 bytes

    Database Buffers 838860800 bytes

    Redo Buffers 13848576 bytes

    Database mounted.

    SQL> select db_unique_name,database_role,flashback_on from v$database;

     

    DB_UNIQUE_NAME DATABASE_ROLE    FLASHBACK_ON

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

    PRIMARY PRIMARY          YES

     

    With the database in mount try a reinstate again:

     

    PRIMARY>dgmgrl

    DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production

     

    Copyright (c) 2000, 2013, Oracle. All rights reserved.

     

    Welcome to DGMGRL, type "help" for information.

    DGMGRL> connect /

    Connected as SYSDG.

    DGMGRL> reinstate database 'PRIMARY'

    ORA-16795: the standby database needs to be re-created

     

    Configuration details cannot be determined by DGMGRL

     

     

    I'm not keen on rebuilding as my setup is correct so using broker from the standby server:

     

     

    /u01/app/oracle/product/12.1.0.2/dbs:STANDBY >dgmgrl

    DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production

     

    Copyright (c) 2000, 2013, Oracle. All rights reserved.

     

    Welcome to DGMGRL, type "help" for information.

    DGMGRL> connect /

    Connected as SYSDG.

    DGMGRL> show configuration

     

    Configuration - broker1

     

      Protection Mode: MaxPerformance

      Members:

      standby - Primary database

        PRIMARY - Physical standby database (disabled)

          ORA-16661: the standby database needs to be reinstated

     

    Fast-Start Failover: DISABLED

     

    Configuration Status:

    SUCCESS   (status updated 17 seconds ago)

     

    DGMGRL> reinstate database 'PRIMARY'

    Reinstating database "PRIMARY", please wait...

    Reinstatement of database "PRIMARY" succeeded

     

    DGMGRL> show configuration

     

    Configuration - broker1

     

      Protection Mode: MaxPerformance

      Members:

      standby - Primary database

        PRIMARY - Physical standby database

     

    Fast-Start Failover: DISABLED

     

    Configuration Status:

    SUCCESS   (status updated 26 seconds ago)

     

    Perform a switchover to return setup to correct primary mode:

     

    DGMGRL> validate database 'PRIMARY'

     

      Database Role:     Physical standby database

      Primary Database:  standby

     

      Ready for Switchover:  Yes

      Ready for Failover:    Yes (Primary Running)

     

      Current Log File Groups Configuration:

        Thread #  Online Redo Log Groups Standby Redo Log Groups Status

    (standby) (PRIMARY)

    1 4 3 Insufficient SRLs

     

      Future Log File Groups Configuration:

        Thread #  Online Redo Log Groups Standby Redo Log Groups Status

    (PRIMARY) (standby)

    1 4 3 Insufficient SRLs

     

    DGMGRL>

     

     

    DGMGRL> connect dga/********@PRIMARY

    Connected as SYSDG.

    DGMGRL> switchover to 'PRIMARY'

    Performing switchover NOW, please wait...

    New primary database "PRIMARY" is opening...

    Operation requires start up of instance "STANDBY" on database "standby"

    Starting instance "STANDBY"...

    ORACLE instance started.

    Database mounted.

    Switchover succeeded, new primary is "PRIMARY"

    DGMGRL>

     

     

     

    Success!

     

    For additional Information see section 5.4.3.1 How to Reinstate a Database in Oracle Data Guard Broker 12c Release 1 (12.1) E48241-05