The previous article continued, the book connected to the last time, this toss data guard an important purpose is to use switchover to achieve machine upgrade, how switchover it? As I understand it, the role switching of Data guard is a process:
(1) Let the primary node become the standby node.
(2) make one of the standby nodes into a primary node
Here is meant to be "one", that is, Node A is primary turned into standby, suddenly I regret, or can immediately let him change back to primary node, the concrete look operation:
At this time test02 is the primary node, test03 is the standby node, because test03 missing a parameter, a little test03 into primary, the archive will not automatically send to test02, so the first step to complete this parameter:
12 |
##### test03 target priamry, standby now ##### alter system set log_archive_dest_2= ‘service=mydb_test02‘ ; |
Let test02 change from primary to standby:
12 |
##### test02, target standby, primary now ##### alter database commit to switchover to physical standby ; |
The above statement may encounter the following error:
1234 |
alter database commit to switchover to physical standby * ERROR at line 1: ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected |
This is due to the fact that some connections have not been released, and if this happens after the front end application is closed, you can use the following statement to confirm which connections are available:
1234 |
##### test02, target standby, primary now ##### SELECT SID, PROCESS, PROGRAM FROM V$SESSION WHERE TYPE = ‘USER‘ AND SID <> (SELECT DISTINCT SID FROM V$MYSTAT); |
If it is a connection to an Oracle internal process, do not bother him, execute the following statement:
1234 |
##### test02, target standby, priamry now ##### alter database commit to switchover to physical standby with session shutdown |
Convert the test03, which is the original standby node, to primary:
123 |
##### test03, target primary, standby now ##### alter database commit to switchover to primary; ##### test03, target primary, primary now ##### |
Open the database of the primary node so that it can serve externally:
123 |
##### test03, target primary, primary now ##### shutdown immediate; startup; |
Start the archive recovery process for standby:
12 |
##### test02, target standby, standby now ##### alter database recover managed standby database disconnect from session; |
Now that the data Guard master switch has been completed, you can monitor the alert file of the standby and log in the Primay to see if there is an archive log sent over and restored.
If the monitoring time is longer (more than 5 minutes) you will see the following error:
123456789101112131415161718 |
##### primary alert #####
Fri Dec 17 14:04:46 2010
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[10]: Assigned to RFS process 12079
RFS[10]: Database
mount
ID mismatch [0x9e217391:0x9e217bca]
RFS[10]: Client instance is standby database instead of primary
RFS[10]: Not using real application clusters
Fri Dec 17 14:04:46 2010
Errors
in
file
/u01/app/admin/mydb/udump/mydb_rfs_12079
.trc:
ORA-16009: remote archive log destination must be a STANDBY database
##### standby alert #####
Fri Dec 17 14:04:54 2010
Errors
in
file
/u01/app/admin/mydb/bdump/mydb_arc1_6821
.trc:
ORA-16009: remote archive log destination must be a STANDBY database
Fri Dec 17 14:04:54 2010
PING[ARC1]: Heartbeat failed to connect to standby
‘mydb_test02‘
. Error is 16009.
|
Although it does not affect the function and use of Data Guard, how to solve it? In fact, this is the archive process archn process in mischief, think of ways to block it, a comparison of the soil is the log_archive_dest_2 of the node is set to empty, that is, back to the previous article mentioned that configuration, another smart point is to introduce valid _for Parameters:
12345 |
##### test02 ##### alter system set log_archive_dest_2= ‘service=mydb_test03 valid_for=(online_logfiles,primary_role)‘ ; ##### test03 ##### alter system set log_archive_dest_2= ‘service=mydb_test02 valid_for=(online_logfiles,primary_role)‘ ; |
These two errors are no longer visible in the alert file.
ORACLE Datagurard Toss Two