0% found this document useful (0 votes)
10 views

Monitoring Data Guard Configuration

Uploaded by

Pavan Raghu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Monitoring Data Guard Configuration

Uploaded by

Pavan Raghu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Monitoring Data Guard Configuration

Section 4 – Lecture 5
Objectives
This lecture will guide you through the tools that you would use to monitor
a Data Guard configuration. You should learn how to do the following:
• Use the alert log file and the V$DATAGUARD_STATUS to monitor the
Data Guard
• Obtain the archive log gaps, transport lag, apply lag and active apply
rate using SQL*Plus and the Broker
• Obtain information about the standby processes
• Obtain statistics about the logical standby database

Oracle© Data Guard Course – b y Ah m e d B a r a k a


About Monitoring Oracle Data Guard
• Proactive Monitoring
• Troubleshooting
• Performance Tuning

Oracle© Data Guard Course – b y Ah m e d B a r a k a


alter log file
• Any error reported by the Data Guard configuration will be
reported in the alert log file
• Monitoring the alert log file for ORA-* errors is recommended
• Text version is saved in:
${ORACLE_BASE}/diag/rdbms/${ORACLE_SID}/${ORACL
E_SID}

Oracle© Data Guard Course – b y Ah m e d B a r a k a


V$DATAGUARD_STATUS (P)
• It returns the last 256 messages (including the errors ) in the alert
log file that are related to the physical standby databases in the
configuration
Column Possible values

FACILITY Crash Recovery, Log Transport Services, Log Apply


Services, Role Management Services, Remote File Server,
Fetch Archive Log, Data Guard, Network Services
SEVERITY INFORMATIONAL, WARNING, ERROR, FATAL, and CONTROL.

Oracle© Data Guard Course – b y Ah m e d B a r a k a


DBA_LOGSTDBY_EVENTS (L)
• Reports information about the activity of the SQL Apply,
including the errors
SELECT EVENT_TIME, STATUS, EVENT
FROM DBA_LOGSTDBY_EVENTS
ORDER BY EVENT_TIMESTAMP, COMMIT_SCN, CURRENT_SCN;

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Detecting Archive Log Gap
• Archive log gap: is redo archive files generated by the primary
database and have not been transferred to the standby database
• Usually is caused by a network failure
• V$ARCHIVE_GAP (P)
SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE#
FROM V$ARCHIVE_GAP;

• Compare with the SEQUENCE# in V$ARCHIVED_LOG

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Detecting Archive Log Gap (cont)
• Most recent archive log file in the primary database:
SELECT MAX(SEQUENCE#), THREAD#
FROM V$ARCHIVED_LOG
WHERE RESETLOGS_CHANGE# = (SELECT MAX(RESETLOGS_CHANGE#)
FROM V$ARCHIVED_LOG)
GROUP BY THREAD#;

• Most recent archive log file transferred to the standby database:


SELECT DESTINATION, STATUS, ARCHIVED_THREAD#, ARCHIVED_SEQ#
FROM V$ARCHIVE_DEST_STATUS
WHERE STATUS <> 'DEFERRED' AND STATUS <> 'INACTIVE';

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Detecting Archive Log Gap (cont)
• The DBA_LOGSTDBY_LOG view provides dynamic information
about archived logs being processed by SQL Apply (L)
SELECT FILE_NAME, SEQUENCE# AS SEQ#, FIRST_CHANGE# AS F_SCN#,
NEXT_CHANGE# AS N_SCN#, TIMESTAMP,
DICT_BEGIN, DICT_END,
THREAD# AS THR#, APPLIED
FROM DBA_LOGSTDBY_LOG
ORDER BY SEQUENCE#;

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Examining transport and apply lag
• Transport lag
• Apply lag
• The time to failover: ‘apply finish time’
• Run it in the standby database (P+L) :
SELECT NAME, VALUE, UNIT, TIME_COMPUTED
FROM V$DATAGUARD_STATS
WHERE NAME IN ('transport lag','apply lag','apply finish
time');

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Obtain Active Apply Rate
• V$RECOVERY_PROGRESS : how fast the physical standby
database is able to keep up with the primary database (P)
• Can also be used to ensure stalled recovery process

SELECT TO_CHAR(START_TIME, 'DD-MON-RR HH24:MI:SS') start_time,


ITEM,
SOFAR || ' ' || UNITS Sofar
FROM V$RECOVERY_PROGRESS
WHERE ITEM IN ('Active Apply Rate', 'Average Apply Rate',
'Redo Applied');

Oracle© Data Guard Course – b y Ah m e d B a r a k a


SQL Apply Progress
• V$LOGSTDBY_PROGRESS (L)
Column Description
APPLIED_SCN The SCN of the last transaction applied in the
standby database
APPLIED_TIME The time and date of APPLIED_SCN
LATEST_SCN The highest SCN of all redo records that Logical
Standby has encountered
LATEST_TIME The time and date of LATEST_SCN

Oracle© Data Guard Course – b y Ah m e d B a r a k a


SQL Apply Progress (cont)
SELECT NUMTODSINTERVAL(LATEST_TIME - APPLIED_TIME,'day')
"Apply Lag"
FROM V$LOGSTDBY_PROGRESS;

SELECT NUMTODSINTERVAL(SYSDATE - LATEST_TIME,'day') "Logical


Standby Redo Lag"
FROM V$LOGSTDBY_PROGRESS;

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Monitoring Data Guard using the Broker
• A single command shows a lot
DGMGRL> show database oradb_s2
Database - oradb_s2

Role: PHYSICAL STANDBY


Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Average Apply Rate: 4.00 KByte/s
Real Time Query: OFF
Instance(s):
ORADB_S2

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Monitoring Data Guard using the Broker (cont)
• Check the instance configuration (output truncated):
DGMGRL> show instance verbose oradb
Instance 'oradb' of database 'oradb'
Host Name: srv1.localdomain
Properties:
StaticConnectIdentifier =
'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.170)(PORT=1521))(
CONNECT_DATA=(SERVICE_NAME=oradb_DGMGRL.localdomain)(INSTANCE_NAME=ora
db)(SERVER=DEDICATED)))'
StandbyArchiveLocation = 'USE_DB_RECOVERY_FILE_DEST'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = 'oradb_T%t_S%s_R%r.arc'
TopWaitEvents = '(monitor)'

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Monitoring Data Guard using the Broker (cont)
• Redo not sent to the standby
SHOW DATABASE oradb SendQEntries

• Not Applied Redo:


SHOW DATABASE oradb_s2 RECVQENTRIES

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Monitoring the Standby Processes
• To have a look at the processes running in a physical standby
database and check their status, use the view
V$MANAGED_STANDBY
• For a logical standby database, use the view
V$LOGSTDBY_PROCESS

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Displaying Statistics on SQL Apply Operation
• DBA_LOGSTDBY_STATS displays information about the activity of
the logical standby database system.
SELECT SUBSTR(name, 1, 40) AS NAME, SUBSTR(value,1,32) AS
VALUE FROM V$LOGSTDBY_STATS;

Oracle© Data Guard Course – b y Ah m e d B a r a k a


Summary
In this lecture you should have learnt about the tools that you use to
do the following:
• Use the alert log file and the V$DATAGUARD_STATUS to monitor
the Data Guard
• Obtain the archive log gaps, transport lag, apply lag and active
apply rate using SQL*Plus and the Broker
• Obtain information about the standby processes
• Obtain statistics about the logical standby database
Oracle© Data Guard Course – b y Ah m e d B a r a k a

You might also like