Description:-
- We invoke a failover operation in response to an emergency situation, usually when the primary database cannot be accessed or is unavailable.
- We need to enable the flashback database for both side.So that we will REINSTATE easily after failover.
- Failover should be performed when the primary database cannot be recovered in a timely manner.
- Failover may or may not result in data loss depending on the protection mode in effect at the time of the failover.
- Failover can be performed when all or most of the information until the Unavailability of the Primary Database
was propagated to the Standby. The usage of Standby Redo Logs is a great advantage here. If you have no
Standby Redo Logs available, you will always encounter some Data Loss depending on the Changes since
the latest Log Switch.
Environment Details:-
SQL> select flashback_on,instance_name,database_role from v$database,V$instance;
FLASHBACK_ON INSTANCE_NAME DATABASE_ROLE
—————— —————- —————-
YES delhi PRIMARY
SQL> select flashback_on,instance_name,database_role from v$database,V$instance;
FLASHBACK_ON INSTANCE_NAME DATABASE_ROLE
—————— —————- —————-
YES chennai PHYSICAL STANDBY
Note:-Now primary database is Delhi After the failover primary database is Chennai
Let’s start the Demo:-
Step1:-Show the configuration
[oracle@dev19c ]$ dgmgrl
DGMGRL for Linux: Release 19.0.0.0.0 – Production on Sat Oct 26 00:16:37 2019
Version 19.4.1.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type “help” for information.
DGMGRL> connect sys/oracle@delhi
Connected to “delhi”
Connected as SYSDBA.
Step2:-Issue the SHOW CONFIGURATION command to verify the failover.
DGMGRL> SHOW CONFIGURATION;
Configuration – hari
Protection Mode: MaxAvailability
Members:
delhi – Primary database
chennai – Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 57 seconds ago)
Step3:-Check the readiness of the target standby.
To validate the target standby database to ensure that it’s ready to become the new primary database, use the VALIDATE DATABASE command
DGMGRL> VALIDATE DATABASE ‘chennai’;
Database Role: Physical standby database
Primary Database: delhi
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
Managed by Clusterware:
delhi : NO
chennai: NO
Validating static connect identifier for the primary database delhi…
The static connect identifier allows for a connection to database “delhi”.
Current Log File Groups Configuration:
Thread # Online Redo Log Groups Standby Redo Log Groups Status
(delhi) (chennai)
1 3 3 Insufficient SRLs
Step4:-Connect to the target standby database
[oracle@dev19c CHENNAI]$ dgmgrl
DGMGRL for Linux: Release 19.0.0.0.0 – Production on Sat Oct 26 00:27:02 2019
Version 19.4.1.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type “help” for information.
DGMGRL> connect sys/oracle@chennai
Connected to “CHENNAI”
Connected as SYSDBA.
Step5:-Issue the failover command
Now you can issue the failover command to make the target standby database the new primary database for the configuration.
[oracle@dev19c CHENNAI]$ dgmgrl
DGMGRL for Linux: Release 19.0.0.0.0 – Production on Sat Oct 26 00:27:02 2019
Version 19.4.1.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type “help” for information.
DGMGRL> connect sys/oracle@chennai
Connected to “CHENNAI”
Connected as SYSDBA.
DGMGRL> SHOW CONFIGURATION;
Configuration – hari
Protection Mode: MaxAvailability
Members:
delhi – Primary database
chennai – Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 41 seconds ago)
DGMGRL> FAILOVER TO ‘chennai’;
Performing failover NOW, please wait…
Failover succeeded, new primary is “chennai”
Step6:-Show the configuration.
[oracle@dev19c CHENNAI]$ dgmgrl
DGMGRL for Linux: Release 19.0.0.0.0 – Production on Sat Oct 26 12:39:52 2019
Version 19.4.1.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type “help” for information.
DGMGRL> connect sys/oracle@chennai
Connected to “CHENNAI”
Connected as SYSDBA.
DGMGRL> SHOW CONFIGURATION;
Configuration – hari
Protection Mode: MaxAvailability
Members:
chennai – Primary database
Warning: ORA-16629: database reports a different protection level from the protection mode
delhi – Physical standby database (disabled)
ORA-16661: the standby database needs to be reinstated
Fast-Start Failover: Disabled
Configuration Status:
WARNING (status updated 21 seconds ago)
Successfully Failover completed oracle 19c using DGMGRL Utlility
Connect with me:-
Telegram App:https://t.me/oracledbwr
LinkedIn:https://www.linkedin.com/in/hariprasathdba
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page : https://www.facebook.com/dbahariprasath/?
Twitter : https://twitter.com/hariprasathdba