Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

ORACLE DataGuard active / standby handoff

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

There is a problem with the disk of the main library, which leads to the downtime of the main library. Because the archive has not yet been applied, the standby database cannot be converted to the primary library.

First take a look at the current information of 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

View the status of the current database:

SQL > select open_mode from vested database and open door model read ONLY

The startup state is divided into four NOMOUNT,MOUNT,READ ONLY,READ WRITE states.

Check the switching status of DG master / slave libraries:

SQL > SELECT SWITCHOVER_STATUS FROM Vacation DataseX SWITCHOVERVERVER STATUSMOTO STANDBY

DG failover states include NOT ALLOWED,SESSIONS ACTIVE,TO STANDBY,TO PRIMARY. When the master library is TO STANDBY, it means that the master library can switch between master and slave roles.

ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY

If you encounter the following error prompt, there is also an active session link between the master and slave.

ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected

You can force the closure of an active session with the following statement:

ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN

ORA-16139: media recovery required

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH SKIP STANDBY LOGFILE

After the role of the master library is changed to the standby database, some parameters need to be modified.

1. Modify the C / S side of the archive, where FAL (Fetch Archive Log)

SQL > show parameters falNAME TYPE VALUE- fal_client string SID_PRIfal_server 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 DEFERSQL > show parameters log_archive_dest_2NAME TYPE VALUE- -log_archive_dest_2 string service=SID_DG

3. Modify 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 ENABLESQL > show parameters log_archive_dest_2NAME TYPE VALUE- -log_archive_dest_2 string service=SID_PRI

4. Check the status of the slave database. SESSIONS ACTIVE switch roles to master database.

Alter database commit to switchover to primary;shutdown immediatestartup mountalter database open read write

5. Check the file management status of the repository.

SQL > show parameters standby_file_managementNAME TYPE VALUE--- standby_file_management string AUTO

6. Switch the slave database to the recovery mode:

Alter database recover managed standby database disconnect from session

7. Check the synchronization of master / slave archives:

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 00 00

As long as the MRP (Managed Recovery Process) process of the repository is started, the archiving process is normal.

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' DEST_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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report