Failover First Steps
Failover First Steps
Prior to performing the actual failover commands that convert the standby into a
primary, we need to first perform some actions that will ensure that we have as much
data as possible from the primary. We also need to prepare the standby to assume the
role of a primary, making the transition smoother. Items that we should address are
• First and foremost, attempt to get all unapplied data off of the primary host and
onto the standby host. This could include any archivelogs that did not get
transferred.
• Ensure that any temporary tablespaces on the standby are populated with
tempfiles.
• If the standby will become a RAC primary, make sure that all but one instance
are down.
• Remove any delay setting for recovery of redo from the primary.
• Change the protection mode of the standby database to maximum performance.
Workshop Notes
The following steps are to be used when performing a failover to a physical standby.
Step 1. Resolve any gaps that may exist on the standby. Query the V$ARCHIVE_GAP
view on the standby database to identify any gaps. Attempt to resolve the gaps by
copying archivelogs from the primary host or from other standbys. Copy any
archivelogs to the standby host that have a higher sequence number than the last one to
arrive at the standby chosen for failover.
Step 2. Any archivelogs that have been copied to resolve a gap need to be registered in
the standby controlfile. Register the archivelogs with the following command on the
standby:
Step 3. Perform terminal recovery on the standby by issuing managed recovery with
the FINISH keyword. The following command is to be used if you have standby redo
logs that are configured and active:
If you do not have standby redo logs, or they are not active, you must enter the
following command:
Step 4. Once the terminal recovery command completes, convert the standby into a
primary database by entering the following command:
alter database commit to switchover to primary;
shutdown immediate;
startup;