Oracle DataGuard Monitoring Script
Oracle DataGuard Monitoring Script
I will share all Oracle DBA Scripts related Dataguard in this post.
Oracle DBA ( Database Administrator ) needs useful scripts to monitor, analyze and check Oracle
database for routine database operations and monitoring.
Before 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.
Your dataguard is running but is there any lag ? You can learn below script.
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.
FROM
WHERE
ARCH.THREAD# = APPL.THREAD#
ORDER BY 1;
To stop dataguard you can use following query. When dataguard is stopped, MRP ( Media Recovery
Process ) won’t run.
To start dataguard you can use following query. When dataguard is started, MRP ( Media Recovery
Process ) will run.
If you don’t want any lag you should start dataguard with using logfile option. You should add
standby logs to the standby database in this case.
If you want to learn which of database is Standby and which of database is Primary, you can execute
below query.
You can display the status of background processes in a standby database with below script.
You can just want to see MRP process status then you can execute below script.
What is the MRP process waiting for status ? You can check with below 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
b.sid=(select SID from v$session where PADDR=(select PADDR from v$bgprocess where NAME='MRP0'));
To see the status of the switchover and the role of database which is in Standby or Primary state,
execute following script.
Below script provides information about approximate completion time of the recovery process
To see all parameters of Oracle dataguard, you can execute following query.
'log_archive_dest_1','log_archive_dest_2','log_archive_dest_3',
'log_archive_dest_state_1','log_archive_dest_state_2','log_archive_dest_state_3',
'remote_login_passwordfile',
'log_archive_format','log_archive_max_processes','fal_server','fal_client','db_file_name_convert',