Friday, November 13, 2009

Checking Dataguard Transport Lag

# First check in the standby database for the curent value

1 select name, value from v$dataguard_stats
2* where name = 'transport lag'
SYS AS SYSDBA@pl01cfd1> /

NAME VALUE
----------------------------------------------------------------
transport lag +00 00:00:03


# Find Dataguard related metrics for Rac Databases.

select distinct column_label from mgmt_metrics where target_type = 'rac_database' and metric_name like 'dataguard%';

# find the raw stats for Transport Lag for database pl01sbt

select
t.target_name,
m.column_label,
mmr.collection_timestamp,
mmr.value
from
mgmt_targets t,
mgmt_metrics m,
mgmt_metrics_raw mmr
where t.target_guid = mmr.target_guid
and m.metric_guid = mmr.metric_guid
and m.column_label = 'Transport Lag (seconds)'
and t.target_name = 'pl01sbt';

# Find the 1 hour rollup stats for metric Transport Lag for database pl01sbt

select
t.target_name,
m.column_label,
mm1.rollup_timestamp,
mm1.value_average,
mm1.value_minimum,
mm1.value_maximum
from
mgmt_targets t,
mgmt_metrics m,
mgmt_metrics_1hour mm1
where t.target_guid = mm1.target_guid
and m.metric_guid = mm1.metric_guid
and m.column_label = 'Transport Lag (seconds)'
and t.target_name = 'pl01sbt';