ORACLE Dataguard Master and Standby switchover

Source: Internet
Author: User

Major library disk issues, causing the main library to go down because the archive has not been applied, resulting in the repository not being transferred to the primary library

First look at the current information about the repository:

Sql> select * from V$version; BANNER---------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit productionpl/sql release 11.2.0.3.0-productioncore 11.2.0.3.0 productiontns for Linux : Version 11.2.0.3.0-productionnlsrtl version 11.2.0.3.0-production

To view the status of the current database:

Sql> Select Open_mode from V$database;open_mode--------------------READ only

This boot state is divided into Nomount,mount,read Only,read write four states

To view the switch status of the DG Master and Standby libraries:

Sql> SELECT switchover_status from V$database; Switchover_status--------------------to STANDBY

The DG failover status includes not allowed,sessions active,to standby,to PRIMARY. When the main library is to standby, it means that the main library can switch the primary and standby roles.

ALTER DATABASE COMMIT to switchover to physical STANDBY;

If you encounter the following error message, there are active session links in the main spare room

Ora-01093:alter DATABASE CLOSE only permitted with no sessions connected

You can force the active session to close by using the following statement:

ALTER DATABASE COMMIT to switchover-physical STANDBY with SESSION SHUTDOWN;

Ora-16139:media Recovery Required

ALTER database RECOVER MANAGED STANDBY database FINISH SKIP STANDBY LOGFILE;

After the main library role is switched to standby, some of the parameters need to be modified.

1, modify the C/s to obtain the archive, here Fal (Fetch Archive Log)

Sql> Show Parameters falname TYPE VALUE-----------------------------fal_client string sid_prifal_se RVer string SID_DG

2, modify the main library Log_archive_dest_state_n and Log_archive_dest_n.

Sql> Show Parameters log_archive_dest_state_2name TYPE VALUE------------------------------ -------------log_archive_dest_state_2 String DEFER
Sql> Show Parameters log_archive_dest_2name TYPE VALUE------------------------------------------ -----log_archive_dest_2 String SERVICE=SID_DG

3, modify the storehouse Log_archive_dest_state_n and Log_archive_dest_n.

Sql> Show Parameters log_archive_dest_state_2name TYPE VALUE------------------------------ -------------log_archive_dest_state_2 String ENABLE
Sql> Show Parameters log_archive_dest_2name TYPE VALUE------------------------------------------ -----log_archive_dest_2 String Service=sid_pri

4. Check the standby status SESSIONS active switch role to main library

ALTER DATABASE commit to switchover to Primary;shutdown immediatestartup mountalter database open Read Write

5. View the file management status of the standby library

Sql> Show Parameters standby_file_managementname TYPE VALUE--------------------------------- ----------Standby_file_management String AUTO

6, switch the standby library into the recovery mode:

ALTER DATABASE recover managed standby database disconnect from session;

7, check the primary and standby archive synchronization situation:

sql> select  process, status,sequence#,block#,blocks, delay_mins from v$ Managed_standby; process   status        sequence#      block#     blocks delay_mins--------- ------------ ------- --- ---------- ---------- ----------arch      connected              0           0          0           0ARCH      CONNECTED              0           0          0           0arch      connected              0          0           0           0arch      connected              0          0           0          0MRP0       WAIT_FOR_LOG       8048           0          0           0RFS       IDLE                   0           0          0           0RFS       IDLE                8048      170025        824           0RFS       IDLE                   0           0          0           0

As soon as the MRP (Managed Recovery Process) session of the library is started, the archive is functioning correctly

Sql> Select Dest_name,status,target,archiver,schedule, valid_type,valid_role,db_unique_name from V$archive_dest where dest_name= ' log_archive_dest_2 ';D est_name STATUS TARGET archiver SCHEDULE valid_type VALID _role db_unique_name------------------------------------------------------------------------------------------- -------------------------log_archive_dest_2 VALID STANDBY lgwr ACTIVE all_logfiles all_roles NONE

This article is from the "linuxoracle" blog, make sure to keep this source http://onlinekof2001.blog.51cto.com/3106724/1589080

ORACLE Dataguard Master and Standby switchover

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.