This article show how to enable FSFO, you can refer to my earlier posts on how to implement Data Guard and the Broker.
In my test the environment is being operated at Max Performance Mode.
DGMGRL> show configuration
Configuration - mobpro
Protection Mode: MaxPerformance
Databases:
mobpro_collab1 - Primary database
mobpro_collab2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
Since it is being operated at Max Performance let us make sure the property LogXptMode has the value SYNC.
DGMGRL> SHOW DATABASE 'mobpro_collab1' 'LogXptMode';
LogXptMode = 'ASYNC'
DGMGRL> SHOW DATABASE 'mobpro_collab2' 'LogXptMode';
LogXptMode = 'ASYNC'
On the primary we need to setup a property FastStartFailoverTarget to point to the standby, however this is important if there is more than one primary, In my case since I have one standby I can ignore it, for the sake of clarity I will setup value for this property.
DGMGRL> EDIT DATABASE mobpro_collab1 set property 'FastStartFailoverTarget'='mobpro_collab2';
Property "FastStartFailoverTarget" updated
DGMGRL> EDIT DATABASE mobpro_collab2 set property 'FastStartFailoverTarget'='mobpro_collab1';
Property "FastStartFailoverTarget" updated
The above command conveys that for the primary the target would be mobpro_collab2, if in case the standby becomes primary Iam indicating that for the failover it would be mobpro_collab1.
One more important property to be set is FastStartFailoverThreshold, it indicates that the observer or the standby will wait for so many seconds before initiating the failover, default is 30 secs.
DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverThreshold = 45;
Property "faststartfailoverthreshold" updated
One more important property worth discussing is FastStartFailoverAutoReinstate, default value is FALSE, what it does is it bring up the Primary after the FSFO if the issues on the primary is fixed, for now we wiull have this FALSE.
Next step will be to enable fast-start failover
DGMGRL> ENABLE FAST_START FAILOVER;
Enabled.
We will now start the observer
DGMGRL> START OBSERVER;
Observer started
Let look the output of the configuration,
DGMGRL> show configuration
Configuration - mobpro
Protection Mode: MaxPerformance
Databases:
mobpro_collab1 - Primary database
mobpro_collab2 - (*) Physical standby database
Fast-Start Failover: ENABLED
Configuration Status:
SUCCESS
DGMGRL> SHOW FAST_START FAILOVER;
Fast-Start Failover: ENABLED
Threshold: 45 seconds
Target: mobpro_collab2
Observer: collab1
Lag Limit: 30 seconds
Shutdown Primary: TRUE
Auto-reinstate: FALSE
Configurable Failover Conditions
Health Conditions:
Corrupted Controlfile YES
Corrupted Dictionary YES
Inaccessible Logfile NO
Stuck Archiver NO
Datafile Offline YES
Oracle Error Conditions:
(none)
Let us now test the failover,
I will crash the primary database by terminating the smon process
collab1:/u01/app/oracle/diag/rdbms/mobpro_collab1/mobpro/trace[mobpro]$ ps -ef
grep smon
oracle 24021 1 0 11:31 ? 00:00:00 ora_smon_mobpro
oracle 30781 8828 0 12:11 pts/2 00:00:00 grep smon
collab1:/u01/app/oracle/diag/rdbms/mobpro_collab1/mobpro/trace[mobpro]$ kill -9 24021
Now on the other terminal of the observer, I can see this
12:12:21.38 Tuesday, October 27, 2009
Initiating Fast-Start Failover to database "mobpro_collab2"...
Performing failover NOW, please wait...
Failover succeeded, new primary is "mobpro_collab2"
12:12:28.60 Tuesday, October 27, 2009
As you see it automatically failed over to the standby after waiting 45 secs which is the threshold.
I now bring up the primary and will reinstate
DGMGRL> startup mount
ORACLE instance started.
Database mounted.
DGMGRL> REINSTATE DATABASE mobpro_collab1;
Reinstating database "mobpro_collab1", please wait...
Operation requires shutdown of instance "mobpro" on database "mobpro_collab1"
Shutting down instance "mobpro"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "mobpro" on database "mobpro_collab1"
Starting instance "mobpro"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "mobpro_collab1" ...
Reinstatement of database "mobpro_collab1" succeeded
Let see the config now
DGMGRL> show configuration
Configuration - mobpro
Protection Mode: MaxPerformance
Databases:
mobpro_collab2 - Primary database
mobpro_collab1 - (*) Physical standby database
Fast-Start Failover: ENABLED
Configuration Status:
SUCCESS
As you see we have got back the old primary, however the current primary continues the work, if required we can now switch over to the standby as a primary.
DGMGRL> switchover to mobpro_collab1;
Performing switchover NOW, please wait...
New primary database "mobpro_collab1" is opening...
Operation requires shutdown of instance "mobpro" on database "mobpro_collab2"
Shutting down instance "mobpro"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "mobpro" on database "mobpro_collab2"
Starting instance "mobpro"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "mobpro_collab1"
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment