Wednesday 6 July 2016

Pre-check for DataGuard switchover Process




Please perform these pre-requisite checks before undertaking a switchover to primary.


Ø   ON STANDBY SITE:

The database_role must be “PHYSICAL STANDBY”  . . . check this using below query

SQL> select database_role from v$database;

DATABASE_ROLE
-----------------------
PHYSICAL STANDBY

Note: If you receive a reply like below

SQL> select database_role from v$database;
DATABASE_ROLE
-----------------------
PRIMARY
Then do not proceed if this message is received …in this case you are most probably on the primary site..


Next Check, Again on STANDBY SITE:

While functioning as a STANDBY, it is better to set log_archive_dest_state_2 to DEFER to avoid errors appearing in the alertlog file,.. but make sure it is set to ENABLE before starting a switchover.

The below command can be issued to convert it to ENABLE
sql> alter system set log_archive_dest_state_2=’ENABLE’ scope=both;


Next Check :
If any of the datafiles are in RECOVER status, DO NOT PROCEED with the switchover…

SQL> select distinct status from v$datafile;

STATUS
------------
ONLINE
ONLINE
SYSTEM


Next Check:
If the STANDBY database has been opened in READ ONLY mode, then do NOT proceed.
If the database is in mount mode, then only proceed.
(This is to ensure that the logs are being shipped and more importantly the LAST LOG archived has been applied…)

QL> select distinct open_mode from v$database;

OPEN_MODE
-------------------
MOUNTED



Now,.. On PRIMARY site
SQL> select max(SEQUENCE#) “LAST_LOG_GENERATED” FROM V$ARCHIVED_LOG WHERE THREAD# =1 and ARCHIVED=’YES’;

LAST_LOG_GENERATED
——————
25

And  on STANDBY site.
SQL> select max(SEQUENCE#) “LAST_LOG_APPLIED” FROM V$ARCHIVED_LOG WHERE THREAD# = 1 and APPLIED=’YES’;

LAST_LOG_APPLIED
—————-
25

Both the values are same, so you can Proceed for the Switchover.



Click here to Join Our Blog and Stay Updated


No comments:

Post a Comment