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

How to analyze Oracle 10g DataGuard physical active / standby switching switchover and failover

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

Share

Shulou(Shulou.com)05/31 Report--

Today, I will talk to you about how to analyze Oracle 10g DataGuard physical active / standby switching between switchover and failover. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

Oracle 10g physical master and backup libraries:

Switchover switching: switching between master database and slave database data synchronization under normal conditions, mainly used for active / standby maintenance, switching drills, etc.

Failover switchover: forced handover between master and slave database when the data is not synchronized. It is mainly used for switching in case of downtime or failure of the primary database.

I. switchover handoff

The data of the main database and the standby database are synchronized and run normally, and the roles of the primary database and the standby database are exchanged.

Before switching, be sure to check whether the archives of the current master and standby are synchronized, and then perform the switch after confirming the synchronization

Switchover switch main library operation

Step 1, the main library stops listening

Lsnrctl stop

(in theory, it is not necessary to stop the listening of the main database, but in practice, if the database is busy during the switch, there are still a large number of session connections to operate the database, and when performing the switching operation, you need to wait for oracle to execute session shutdown, which is sometimes very slow. It is recommended to stop listening directly. After stopping, you can also check ps-ef | grep "LOCAL=NO". LOCAL=NO is the client connection process. And kill-9 kills these unreleased connections, and then performs the following switch)

Step 2, the main library performs the switch.

Main library status role confirmation

Select switchover_status from v$database

The query results can be divided into two situations:

The first case

SQL > select switchover_status from v$database

SWITCHOVER_STATUS

-

SESSIONS ACTIVE

If the query result is SESSIONS ACTIVE: execute the following:

SQL > alter database commit to switchover to physical standby with session shutdown

The second case

SQL > select switchover_status from v$database

SWITCHOVER_STATUS

-

TO STANDBY

If the query result is: TO STANDBY executes the following:

SQL > alter database commit to switchover to physical standby

Step 3, close the main library

SQL > shutdown immediate

ORA-01507: database not mounted

ORACLE instance shut down.

Step 4, the main library starts to mount state

SQL > startup mount

ORACLE instance started.

Total System Global Area 9646899200 bytes

Fixed Size 2087000 bytes

Variable Size 822085544 bytes

Database Buffers 8808038400 bytes

Redo Buffers 14688256 bytes

Database mounted.

Step 5, the main database determines the status after switching.

SQL > select open_mode,database_role,switchover_status from v$database

OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS

MOUNTED PHYSICAL STANDBY SESSIONS ACTIVE

The database role becomes PHYSICAL STANDBY (physical repository)

Completed the role conversion of the main library

Step 6, the main library starts listening

Lsnrctl start

Switchover switch slave operation

The standby database executes to switch to the main library mode.

Step 1, prepare the database status role confirmation

SQL > select switchover_status from v$database

The first case

SQL > select switchover_status from v$database

SWITCHOVER_STATUS

-

TO PRIMARY

If the status is TO PRIMARY, execute the following statement:

SQL > alter database commit to switchover to primary

The second case

SQL > select switchover_status from v$database

SWITCHOVER_STATUS

-

SESSIONS ACTIVE

If the status is SESSIONS ACTIVE, execute the following statement:

Alter database commit to switchover to primary with session shutdown

Step 2, prepare the library to open

Alter database open

Step 3, prepare the database status role confirmation

SQL > select open_mode,database_role,switchover_status from v$database

OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS

READ WRITE PRIMARY SESSIONS ACTIVE

Step 4, the original main library starts synchronization

Execute on the original master library:

Alter database recover managed standby database using current logfile disconnect from session

Switchover handover completed

After reading the above, do you have any further understanding of how to analyze Oracle 10g DataGuard physical active / standby switching switchover and failover? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

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