In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to resolve two error states of oracle11gR2 DataGuard switchover. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
Oracle11gR2 DataGuard was built in the company's test environment for pre-production testing. There are two types of redundant switching in Data Guard, one is failover lossless switching and the other is failover discard switching.
The so-called switchover is for failover, it is a lossless handover, the process of switching will not lose data. It is possible to make the main and standby interchangeable smoothly and both libraries can be used normally. Switching process: main library-> switching-> standby library-> check status-> original and standby library-> switching-> main library-> check status again
Application: The master library needs to be adjusted and upgraded due to performance or other reasons. In this case, the new master library can be used to provide services to the outside world after switching.
DG on the building process will not be detailed here, the following on the switching process occurred in the two error states for analysis and resolution.
I. SWITCH LATENT STATUS
Query database roles and status on backup
SYS@standby> select database_role,switchover_status,open_mode from v$database;
DATABASE_ROLE SWITCHOVER_STATUS OPEN_MODE
---------------- -------------------- --------------------
PHYSICAL STANDBY SWITCHOVER LATENT READ ONLY
Switchover Latent rather than to Primary
The problem is that the switch is in pending mode and cannot be returned to the main library until it is completed. When you check the ALERT log, you don't see any errors. Do you want to wait? In fact, there is no need to wait. The reason for this problem is that the log is not archived, so the backup database is inconsistent with the main database and needs to be restored. When the backup database is restored to be consistent with the primary database, the status becomes to_primary.
To verify that the problem is not the cause of the above, you can continue to execute the following sentence on the backup library
sys@standby> 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.
According to the above analysis and positioning, we need to solve this problem, we need to cut off the application on the backup library and enable log synchronization.
SYS@standby> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.
SYS@standby> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
It is displayed as TO PRIMARY, and the status is normal at this time.
SYS@standby> alter database commit to switchover to primary with session shutdown;
Database altered.
SYS@standby> select database_role,switchover_status,open_mode from v$database;
DATABASE_ROLE SWITCHOVER_STATUS OPEN_MODE
---------------- -------------------- --------------------
PRIMARY NOT ALLOWED MOUNTED
open the database
sys@standby>alter database open;
Switch to the journal.
sys@standby> alter system switch logfile ;
System altered.
Check the status of the logs again.
SYS@standby> select sequence#,standby_dest,archived,applied,status from v$archived_log;
SEQUENCE# STA ARC APPLIED S
---------- --- --- --------- -
4 NO YES YES A
5 NO YES YES A
6 NO YES YES A
7 NO YES YES A
8 NO YES YES A
9 NO YES YES A
10 NO YES YES A
11 NO YES YES A
11 NO YES YES A
10 NO YES YES A
12 NO YES YES A
Yes, it's already synchronized.
II. FAILS DESTINATION STATUS
When the backup library is switched to the master library, the switching status is found to be FAiled DESTINATION.
SYS@primary> select database_role,switchover_status,open_mode from v$database;
DATABASE_ROLE SWITCHOVER_STATUS OPEN_MODE
---------------- -------------------- --------------------
PRIMARY FAILED DESTINATION READ WRITE
FAILED DESTINATION, NOT TO STANDBY
This problem indicates that there is a problem with the connection between the main library and the backup library. You can check the ALERT log to see what is going on.
Error 12541 received logging on to the standby
Check whether the listener is up and running.
Errors in file /u01/app/oracle/diag/rdbms/primary/primary/trace/primary_arc2_2546.trc:
ORA-12541: TNS:no listener
PING[ARC2]: Heartbeat failed to connect to standby 'standby'. Error is 12541.
This shows that there is a problem with the monitoring of the backup library. Restart the monitoring of the backup library. Check again and the status will change to standby.
SYS@primary> select database_role,switchover_status,open_mode from v$database;
DATABASE_ROLE SWITCHOVER_STATUS OPEN_MODE
---------------- -------------------- --------------------
PRIMARY TO STANDBY READ WRITE
Of course, there are many reasons for FAILS DESTINATION, such as the attribute value of log_archive_dest_2 parameter, configuration error of password file or permission problem, etc.
In short, there is a problem, face the problem analysis problem on the right, from which you can learn a lot.
Meaning of Switchover_Status value attached
NOT ALLOWED
The current database is not a primary database with a standby database
PREPARING DICTIONARY
The logical standby database is sending its redo data to a primary database and other standby databases in preparation for the switchover
PREPARING SWITCHOVER
When accepting redo data for a switchover, logical standby configurations use it
RECOVERY NEEDED
The standby database has not yet received a handoff request.
SESSIONS ACTIVE
Active SQL sessions exist in the primary database; these sessions must be disconnected before execution can continue
SWITCHOVER PENDING
For standby databases that have received a primary database switch request but have not yet processed it
SWITCHOVER LATENT
The switch is not complete and returns to the main database
TO LOGICAL STANDBY
The primary database has received the complete dictionary from the logical standby database
TO PRIMARY
the standby database can be convert to that primary database
TO STANDBY
The primary database can be converted to a standby database
Thank you for reading! About "how to solve oracle11gR2 DataGuard switchover two error states" This article is shared here, I hope the above content can be of some help to everyone, so that we can learn more knowledge, if you think the article is good, you can share it to let more people see it!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.