Switchover
Switchover
===================================================================
Standby database:-
Before performing switchover, kindly verify the state of data guard on both the
instances by following SQL queries:
Step 2:-
Session altered.
SQL> SELECT sequence#, first_time, next_time, applied FROM v$archived_log ORDER BY
sequence#;
11 rows selected.
Step 3:-
SWITCHOVER_STATUS
--------------------
TO STANDBY
Not Allowed:-Either this is a standby database and the primary database has not
been switched first, or this is a primary database and there are no standby
databases
Session Active:- Indicates that there are active SQL sessions attached to the
primary or standby database that need to be disconnected before the switchover
operation is permitted
Switchover Pending:- This is a standby database and the primary database switchover
request has been received but not processed.
Switchover Latent:- The switchover was in pending mode, but did not complete and
went back to the primary database
To Primary:- This is a standby database, with no active sessions, that is allowed
to switch over to a primary database
To Standby:- This is a primary database, with no active sessions, that is allowed
to switch over to a standby database
Recovery Needed:- This is a standby database that has not received the switchover
request
On Primary database:-
Step 4:
Database altered.
Step 5:-
shutdown immediate
startup nomount
Database altered.
SQL> alter database recover managed standby database disconnect from session;
Database altered.
=============
-------------
STEP 6:-
-------------
=============
SQL> select name,open_mode,database_role from v$database;
=========
-----------------------------------------------------------------------------------
-------------------------------------------
Step 7:-
-----------------------------------------------------------------------------------
--------------------------------------------
=========
alter database commit to switchover to primary;
Database altered.
=====================================================
Step 8:-
archivelog_size_hourly.sql