Oracle 12c-Step by Step Manual Data Guard Switchover
Prepared by Ranesh
| Details | Primary Side | Standby Side | 
| Server Name | Primary | Pysical Standby | 
| DB Name | Warangal | Mumbai | 
| IP Adresses | 192.168.182.128 | 192.168.182.129 | 
Step 1:- Check database role and database name
Primary database:-
select name,open_mode,database_role from v$database

Standby database:-
select name,open_mode,database_role from v$database

Precheck for Switchover:-
Before performing switchover, kindly verify the state of data guard on both the instances by following SQL queries:
 ALTER SYSTEM SET  log_archive_dest_2=’service=warangal  async valid_for=(online_logfiles,primary_role) db_unique_name=warangal’;
Step 2:-
ALTER SESSION SET nls_date_format=’DD-MON-YYYY HH24:MI:SS’;
SELECT sequence#, first_time, next_time, applied FROM v$archived_log ORDER BY sequence#;

On Primary database:-
Step 3:- select switchover_status from v$database;

Note: This command will give you appropriate message about the data guard current status.
On Primary database:-
Step 4:
SQL> alter database commit to switchover to standby;

Step 5:-
shutdown immediate
startup nomount
alter database mount standby database

Step 6:-select name,open_mode,database_role from v$database;

alter database recover managed standby database disconnect from session;

On Standby database:
Step 7:-alter database commit to switchover to primary;

Step 8:-select name,open_mode,database_role from v$database;

| Details | Primary Side | Standby Side | 
| Server Name | Physical Standby | Primary | 
| DB Name | Warangal | Mumbai | 
| IP Adresses | 192.168.182.128 | 192.168.182.129 | 
Recent Posts