How To Perform Switchover and Switchback in Oracle 11g | Karan Rajpoot

In this article you will get to know how we can perform step by step Switchover and Switchback configuration in Oracle 11g.

Switchover: – A switchover is a technique through which the roles reversal is possible between the primary database and standby database. At the time of Switchover activity, the primary database becomes the standby database and vice-versa. In the whole activity, there is no data loss occur on both sides.

Let start’s the step by step Switchover and Switchback configuration in Oracle 11g.

Step 1) First we will check the DB name, DB unique name, open_mode, database_role of both the servers.

Primary Side: –

SQL> select name,db_unique_name,log_mode,open_mode,database_role from v$database;

NAME   DB_UNIQUE_NAME LOG_MODE     OPEN_MODE    DATABASE_ROLE
——— —————————— ———— ——————– —————-
PROD   prod ARCHIVELOG   READ WRITE    PRIMARY

Standby Side: –

SQL> select name,db_unique_name,log_mode,open_mode,database_role from v$database;

NAME DB_UNIQUE_NAME LOG_MODE OPEN_MODE DATABASE_ROLE
——— —————————— ———— ——————– —————-
PROD dr ARCHIVELOG MOUNTED PHYSICAL STANDBY

Step 2) Now switch the role of the primary database to the physical standby database. 

Command: – alter database commit to switchover to standby;

Output: –

The output of the alert log file: –

Step 3) Now check the switchover status on the primary and the standby server.

Command: select name,db_unique_name, open_mode, database_role from v$database;

Primary side: –

Standby side: –

Now we can see from the above output our primary database role has been changed into physical standby, now we can open the database into read-only mode and start the MRP (managed recovery process) process as well.

Output: –

Command to start the MRP process: – alter database recover managed standby database disconnect from session;

MRP Process output: –

When we start the MRP process than the status of the open_mode will change from READ ONLY to READ ONLY WITH APPLY, This is because MRP process is now ready to apply the archive log on the primary server side.

Step 4) Now we can switch the archives from standby side (Which is currently Primary) to the primary side (Which is currently standby).

 The old output of Standby Server: –

The new output of Standby Server after switching the archives: –

Now we can check the same on the Primary server, whether the archives has been applied.

The output of the Primary Server: –

We can check from the above output that Archives has been successfully applied on the new physical standby server.

Let’s start the configuration of Switchback.

Step 5) To switchback the roles need to run the below command on the standby server.

Command to run on standby server: – alter database commit to switchover to standby;

Output: –


Command to run on the primary server: –
alter database commit to switchover to primary;

 Output: –

Step 6) Now the roles have been changed again, at last, we can check the status of the Primary and Standby server whether the roles have been changed properly between them.

The output of the Primary Server: –

The output of the standby Server: –

As we can check from the above output, roles have been changed successfully between the primary and the standby server.

If this article is useful for you please comment, share with your friends.

In case of any issues please send your query to below comment section.

For more articles please do visit below links: –

Linux Installation

How to Install Linux on Oracle Virtual Box

Dataguard

Oracle Physical Standby Dataguard in 11g | Karan Rajpoot

How To Configure Step By Step Oracle DGMGRL Utility | Karan Rajpoot

Cloning

RMAN Backup Based Cloning in Oracle 11g | Karan Rajpoot

How to perform “Cloning” through “Active database” in Oracle 11g

Leave a Reply

Close Menu