To see archive gap in dataguard, execute following script. select switchover_status,database_role from v$database To see the status of the switchover and the role of database which is in Standby or Primary state, execute following script. select a.event, a.wait_time, a.seconds_in_wait from gv$session_wait a, gv$session b where a.sid=b.sid andī.sid=(select SID from v$session where PADDR=(select PADDR from v$bgprocess where NAME='MRP0')) What is the MRP process waiting for status ? You can check with below script. select process, client_process,thread#,sequence#,status from v$managed_standby where process like '%MRP%' You can just want to see MRP process status then you can execute below script. select process, client_process,thread#,sequence#,status from v$managed_standby You can display the status of background processes in a standby database with below script. SELECT database_role, open_mode FROM v$database If you want to learn which of database is Standby and which of database is Primary, you can execute below query. You should add standby logs to the standby database in this case.ĪLTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION If you don’t want any lag you should start dataguard with using logfile option. ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION When dataguard is started, MRP ( Media Recovery Process ) will run. To start dataguard you can use following query. alter database recover managed standby database cancel When dataguard is stopped, MRP ( Media Recovery Process ) won’t run. To stop dataguard you can use following query. (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 (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 ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last in Sequence", APPL.SEQUENCE# "Last Applied Sequence", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" If you want to know which archive sequence number comes from the Primary database lastly and which is last applied in Standby, you can learn the following script. Select name,value from v$dataguard_stats Your dataguard is running but is there any lag ? You can learn below script. Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )ĭataguard Monitoring Scripts – v$dataguard_stats Oracle DBA ( Database Administrator ) needs useful scripts to monitor, analyze and check Oracle database for routine database operations and monitoring.īefore Oracle DBA Scripts, If you don’t know Oracle database and want to learn, click following link to start learning Oracle database with this tutorial. I will share all Oracle DBA Scripts related Dataguard in this post.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |