SWITCHOVER AND FAILOVER


Switchover   -   Role reversal between primary and standby databases. Old primary is now a standby. Used for hardware upgrades, OS upgrades, etc.

·        Failover   -   Primary is down with little hope of quick recovery (ie. hardware failure on primary machine).Once failover has been initiated , the old primary database is no longer useful.

STEPS OF SWITCHOVER

On primary database:

Sql> select switchover_status from v$database ;

Initiate switchover on primary database :

Sql> alter database commit to switchover to physical standby;

After the above statement completes the old primary is now a standby database.

While still on old primary shutdown database and restart as standby:

Sql>shu immediate;

Sql>startup nomount;

Sql>alter database mount standby database;

On the old standby system (new primary)

Sql> select switchover_status from v$database;

On new primary complete switchover then restart database:

Sql>alter database commit to switchover to primary;

Sql>shu immediate;

Sql>startup;

On new standby start managed recovery:

Sql>alter database recover managed standby database disconnect from session;

On new primary begin redo transport:

Sql>alter system archive log current;

Switchover complete.

STEPS OF FAILOVER

Manually register any redo logs with the standby that are available and that have not been applied.

If using standby redo logs, initiate failover with:

Sql> alter database managed standby database finish;

If not using standby redo logs:

Sql> Alter database recover managed standby database finish skip standby logfile;

Convert the Physical Standby to Primary (modify pfile before restart):

Initialization Parameters:
 
...
log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=prods'
log_archive_dest_2='service=prod valid_for=(online_logfiles,primary_role) db_unique_name=prod'
log_archive_dest_state_1='ENABLE'
log_archive_dest_state_2='DEFER'
fal_server='prod','prods'
fal_client='prods'
...

Sql>alter database commit to switchover to primary;

Sql>shu immediate;

Sql>startup;

Failover complete.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: