DataGuard Role Switching

Source: Internet
Author: User

Step 1 Verify that the primary database can be switched to the standby role.
Verify that the master database can switch to the slave role.
SELECT SWITCHOVER_STATUS from v $ DATABASE;
Idle>: wq

SWITCHOVER_STATUS
--------------------
TO STANDBY

Step 2 Initiate the switchover on the primary database.
Switch over the master database
Alter database commit to switchover to physical standby with session shutdown;

Step 3 Shut down and then mount the former primary database.
Close and mount the previous master database.

Shutdown abort;
Startup mount;

Step 4 Verify that the switchover target is ready to be switched to the primary role.
Verify that the conversion target is ready to be converted to the master database role
SWITCHOVER_STATUS
--------------------
SWITCHOVER LATENT

The value queried here is not TO_PRIMARY.
Problems may occur during the next step.

Step 5 Switch the target physical standby database role to the primary role.
Convert the target logical standby database role to the master database role.

Sys @ DEX> alter database commit to switchover to primary with session shutdown;
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN
*
ERROR at line 1:
ORA-16139: media recovery required

Media recovery is required.

Sys @ DEX> alter database recover managed standby database disconnect from session;

Database altered.

Sys @ DEX> SELECT SWITCHOVER_STATUS from v $ DATABASE;

SWITCHOVER_STATUS
--------------------
TO PRIMARY

Sys @ DEX> alter database commit to switchover to primary with session shutdown;

Database altered.

Step 6 Open the new primary database.
Open a new master database
Sys @ DEX> alter database open;

Database altered.

Step 7 Verify the switch role.
Verify role conversion

Master database execution
Sys @ DEX> alter system switch logfile;

System altered.


Sys @ DEX> select sequence # from v $ log;


SEQUENCE #
----------
40
41
42


Sys @ DEX>

Standby database execution

Sys @ DEX> select sequence # from v $ log;

SEQUENCE #
----------
40
42
41


Sys @ DEX>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.