DATAGUARD STARTUP AND SHUTDOWN PHYSICAL STANDBY
shutdown primary and standby in case of OS patching or Maintanence: (PRIMARY & PHYSICAL STANDBY)
************************************SHUTDOWN***********************************
1) shutdown Primary :
[orams@12.11.1.1 ~]$ ps -ef | grep pmon
oraprms 11670 1 0 Oct19 ? 00:08:15 ora_pmon_PRMS
[orams@12.11.1.1 ~]$ sqlplus "/as sysdba"
SQL> alter system set log_archive_dest_state_2=defer;
SQL> alter system switch logfile;
SQL> shut immediate;
SQL> exit
[orams@12.11.1.1 ~]$ lsnrctl stop LISTENER
2) shutdown Standby:
[orams@12.11.1.2 ~]$ sqlplus "/as sysdba"
SQL> select open_mode from v$database
OPEN_MODE
--------------------
MOUNTED
SQL> alter database recover managed standby database cancel;
SQL> shutdown immediate;
[orams@12.11.1.2 ~]$ lsnrctl stop LISTENER
*****************************************STARTUP*********************************
3) startup standby :
[orams@12.11.1.2 ~]$ lsnrctl start LISTENER
[orams@12.11.1.2 ~]$ sqlplus "/as sysdba"
sql> startup nomount;
sql> alter database mount standby database;
sql> alter database recover managed standby database disconnect from session;
4)Startup Primary:
[orams@12.11.1.1 ~]$ lsnrctl start LISTENER
sql> startup
sql> alter system set log_archive_dest_state_2=enable;
Check the sysc: Need to execute in both primary and standby:
SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference"
FROM
(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,
(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL
WHERE ARCH.THREAD# = APPL.THREAD#
ORDER BY 1;
SELECT PROCESS, STATUS, SEQUENCE# FROM V$MANAGED_STANDBY;
Subscribe to:
Posts (Atom)
No comments:
Post a Comment