Step 1: verify whether the role of the master database can be converted to the slave database (executed by the original master database) SQLgt; SELECTSWITCHOVER_STATUSFR
Physical Data Guard role conversion Step 1 verify whether the master database can perform role conversion to the slave database (executed by the original master database) SQLgt; SELECT SWITCHOVER_STATUS FR
Physical Data Guard role conversion steps
Step 1 verify whether the role of the master database can be converted to the slave database (the original master database)
SQL> SELECT SWITCHOVER_STATUS FROM V $ DATABASE; SWITCHOVER_STATUS --------------- TO STANDBY 1 row selected
Step 2 change the physical master database to the physical slave database (executed by the original master database)
SQL> alter database commit to switchover to physical standby; or SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY with session shutdown;
NOTE: If an Active session can use this option, otherwise the conversion will encounter a ORA-01093 error, you can also kill the Active session or wait for the conversion after the active session
Step 3 shut down and restart the master database (executed by the original master database)
SQL> shutdown immediate; SQL> STARTUP MOUNT;
Step 4 verify whether the role of the slave database can be converted to the master database (the original slave database)
SQL> SELECT SWITCHOVER_STATUS FROM V $ DATABASE; SWITCHOVER_STATUS --------------- TO_PRIMARY 1 row selected
Step 5 start to convert the physical standby database to the physical primary database (executed by the original standby database)
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
-- If the ORA-16139: media recovery required is reported, it may be caused by the absence of logs, You can first execute
Alter database recover managed standby database disconnect from session;
Step 6 open the slave database, and then shut down and restart (executed by the original slave database)
SQL> ALTER DATABASE OPEN;
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP;
Step 7 verify whether the conversion is successful (executed by the original standby database)
SQL> ALTER SYSTEM SWITCH LOGFILE;
Setp 8 Application archive log (executed on the original master database)
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
References:
Important configuration parameters of Oracle Data Guard
Configure Oracle 11g Data Guard based on the same host
Explore Oracle 11g elastic uard
Oracle Data Guard (RAC + DG) archive deletion policies and scripts
Role conversion for Oracle Data Guard
FAL gap in Oracle Data Guard logs
Oracle 11g Data Guard Error 16143 Heartbeat failed to connect to standby