Skip to content
Home » Oracle Database » Using RMAN Catalog in Data Guard Architecture (3/4) - After a Switchover

Using RMAN Catalog in Data Guard Architecture (3/4) - After a Switchover

Using RMAN Catalog in Data Guard Architecture (2/4) - GRANT REGISTER DATABASE Clause
Switchover can change the database roles in the catalog, but you have to connect to the target database one by one to resync the current status.
  1. Check the catalog before switchover.
  2. [oracle@primary01 ~]$ rman catalog catowner/password@smalldb
    ...
    connected to recovery catalog database

    RMAN> list db_unique_name all;


    List of Databases
    DB Key  DB Name  DB ID            Database Role    Db_unique_name
    ------- ------- ----------------- ---------------  ------------------
    2       COMPDB   841830157        PRIMARY          PRIMDB
    2       COMPDB   841830157        STANDBY          STANDB

  3. Do a switchover.
  4. [oracle@primary01 ~]$ dgmgrl sys/password@primdb1
    ...
    DGMGRL> switchover to standb;
    Performing switchover NOW, please wait...
    Operation requires shutdown of instance "primdb2" on database "primdb"
    Shutting down instance "primdb2"...
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    New primary database "standb" is opening...
    Operation requires shutdown of instance "primdb1" on database "primdb"
    Shutting down instance "primdb1"...
    ORA-01109: database not open

    Database dismounted.
    ORACLE instance shut down.
    Operation requires startup of instance "primdb1" on database "primdb"
    Starting instance "primdb1"...
    ORACLE instance started.
    Database mounted.
    Switchover succeeded, new primary is "standb"
    DGMGRL> exit

  5. Check the database roles of both databases.
  6. [oracle@primary01 ~]$ rman catalog catowner/password@smalldb
    ...
    connected to recovery catalog database

    RMAN> list db_unique_name all;


    List of Databases
    DB Key  DB Name  DB ID            Database Role    Db_unique_name
    ------- ------- ----------------- ---------------  ------------------
    2       COMPDB   841830157        PRIMARY          PRIMDB
    2       COMPDB   841830157        STANDBY          STANDB

    It's reasonable that the database roles have not been updated with the most recent information because the catalog has not connected to any target database after a switchover. Let's make them updated.
  7. Resync the current standby database by connecting to the target database and list the db_unique_name.
  8. [oracle@primary01 ~]$ rman catalog vpcowner/password@smalldb target sys/password@primdb1
    ...
    connected to target database: COMPDB (DBID=841830157)
    connected to recovery catalog database

    RMAN> list db_unique_name all;


    List of Databases
    DB Key  DB Name  DB ID            Database Role    Db_unique_name
    ------- ------- ----------------- ---------------  ------------------
    2       COMPDB   841830157        STANDBY          PRIMDB
    2       COMPDB   841830157        STANDBY          STANDB

    You can notice that the database role of the current standby database has been updated, but the other one has not.
  9. Resync the current primary database by connecting to the target database and list the db_unique_name.
  10. [oracle@primary01 ~]$ rman catalog vpcowner/password@smalldb target sys/password@standb1
    ...
    connected to target database: COMPDB (DBID=841830157)
    connected to recovery catalog database

    RMAN> list db_unique_name all;

    starting full resync of recovery catalog
    full resync complete

    List of Databases
    DB Key  DB Name  DB ID            Database Role    Db_unique_name
    ------- ------- ----------------- ---------------  ------------------
    2       COMPDB   841830157        PRIMARY          STANDB
    2       COMPDB   841830157        STANDBY          PRIMDB

    Both the database roles have been updated.

Using RMAN Catalog in Data Guard Architecture (4/4) - Configure RMAN

Leave a Reply

Your email address will not be published. Required fields are marked *