In order to perform switchover, we have to prepare and verify both the primary and standby databases. Perform the following steps:
SQL> select group#,member,type from v$logfile where type='STANDBY'; GROUP# MEMBER TYPE ---------- ---------------------------------------------- ------- .. ........ 14 /u01/app/oracle/oradata/orcl/standby_redo05.log STANDBY 16 /u01/app/oracle/oradata/orcl/standby_redo06.log STANDBY 6 rows selected.
Standby redo logfiles should have been created on the primary database; this is so that after performing switchover, the new standby database can receive redo using standby redo logfiles. This will help us save time in the post-configuration steps.
SQL> show parameter log_archive_dest_2 NAME TYPE VALUE -------------------- ------ ------------------------------ log_archive_dest_2 string SERVICE=TURKEY LGWR ASYNC VALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=turkey_un'
SQL> select file_name,bytes/1024/1024 "SizeMB",maxbytes/1024/1024 "MaxSize MB",autoextensible fromdba_temp_files; FILE_NAME Size MB MaxSize MB AUT ---------------------------------------- ------- ---------- --- /u02/app/oracle/oradata/orcl/temp01.dbf 20 32767.9844 YES
If temporary files don't exist on the standby database or the number and size of temporary files don't match in the primary and standby databases, create or modify the temporary files on the standby database properly.
SQL> select name from v$datafile where status='OFFLINE';
SQL> select db_unique_name, status, protection_mode, synchronization_status, synchronized from v$archive_dest_status where dest_id=2; DB_UNIQUE_NAME STATUS PROTECTION_MODE SYNCHRONIZATION_STATUS SYN -------------- ------- ----------------- --------------------- --- INDIA_UN VALID MAXIMUM PERFORMANCE CHECK CONFIGURATION YES
CHECK CONFIGURATION
if the database is in Maximum Performance mode. If the configuration is either Maximum Protection or Availability, the status OK
will be returned when there are no synchronization issues. Check the maximum archived log sequences on the primary and standby databases.SQL> select thread#,max(sequence#) from v$archived_log group by thread#; THREAD# MAX(SEQUENCE#) ---------- -------------- 1 335
SQL> select thread#,max(sequence#) from v$archived_log where applied='YES' group by thread#; THREAD# MAX(SEQUENCE#) ---------- -------------- 335
MRP
process is running or not by running the following statement on the standby database:SQL> select thread#,sequence#,process,status,client_process from v$managed_standby where thread#=1; THREAD# SEQUENCE# PROCESS STATUS CLIENT_P ---------- ---------- --------- ------------ -------- 1 335 ARCH CLOSING ARCH 1 333 ARCH CLOSING ARCH 1 334 ARCH CLOSING ARCH 1 336 MRP0 APPLYING_LOG N/A 1 336 RFS IDLE LGWR
The current sequence 336
is being written into the standby redo logfiles and the MRP
process is applying this sequence at the same time.
v$dataguard_stats
view on the standby database to check the synchronization status:SQL> select name,value,time_computed from v$dataguard_stats; NAME VALUE TIME_COMPUTED ---------------------- ------------- -------------------- transport lag +00 00:00:00 10/10/2012 15:07:51 apply lag +00 00:00:00 10/10/2012 15:07:51 apply finish time +00 00:00:00 10/10/2012 15:07:51 estimated startup time 16 10/10/2012 15:07:51 SQL> !date Wed Oct 10 15:07:52 IST 2012
JOB_QUEUE_PROCESSES
parameter value to 0
so that no more jobs will be started. After the completion of switchover, reset it with the previous value.SQL> alter system set JOB_QUEUE_PROCESSES=0 scope=both sid='*';