- Check the catalog before switchover.
- Do a switchover.
- Check the database roles of both databases.
- Resync the current standby database by connecting to the target database and list the db_unique_name.
- Resync the current primary database by connecting to the target database and list the db_unique_name.
[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
[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
[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.
[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.
[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.