Oracle Dataguard Switching method for master and standby libraries

Source: Internet
Author: User
Tags failover

Primary and Standby library switching is mainly in two cases, switchover and failover, both of which need to be done manually.

One is switchover (planned switchover, no loss of data)

The second is failover (the main repository switch role is required when the main library fails)

Switching method of 1,switchover

Main Library side:

Select Switchover_status from V$database;

If the to standby table can be switched normally.

Execute ALTER DATABASE commit to switchover to physical standby directly;

Otherwise execute: ALTER DATABASE commit to switchover to physical standby with session shutdown;

Shutdown immediate;

Startup Nomount;

ALTER DATABASE mount standby database;

ALTER DATABASE recover managed standby database disconnect from session;

Prepare the library side:

Select Switchover_status from V$database;

If the To_primary table can be switched normally.

Execution: ALTER DATABASE commit to switchover to primary;

Otherwise execute: ALTER DATABASE commit to switchover to primary with session shutdown;

Shutdown immediate;

Startup

2,failover Switching method

(1) Determine that the primary database does have a serious hardware failure or other cause the primary database cannot be started.

(2) Check if there is a archive redo log on the physical standby database gaps

Sql>select thread#, low_sequence#, high_sequence# from V$archive_gap;

(3) Eliminate archive redo log gaps

Archive redo logs that are not uploaded to the physical standby database are uploaded to the physical standby database from the primary database or from other backup locations and registered to the controlfile of the physical standby database.

sql> ALTER DATABASE REGISTER physical LOGFILE ' archive redo log file name ';

Repeat the 2,3 step until the V$archive_gap view has no record.

(4) Initiating failover operations on the physical standby database

SQL > ALTER database RECOVER MANAGED STANDBY database FINISH Force;

(5) Transforming the physical standby database into a primary role

Sql> ALTER DATABASE COMMIT to switchover to PRIMARY;

(6) Restart the new primary database

Sql> SHUTDOWN IMMEDIATE;

Sql> STARTUP;

(7) Make a full backup of the new primary database.

Oracle Dataguard Switching method for master and standby libraries

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.