Files
oracle/tpt/ash/sample_drift.sql
2026-03-12 21:23:47 +01:00

20 lines
702 B
SQL

-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
-- check if there's sample time drift in ASH (should be every 1 seconds)
-- it makes sense to run this only on active systems where every sample there
-- are some active sessions seen
select * from (
select
to_char(sample_time,'YYYYMMDD HH24:MI:SS')
, sample_time-lag(sample_time) over(order by sample_time) delta
from
(select distinct sample_time from v$active_session_history)
)
where
delta < numtodsinterval(2, 'second') -- eliminate ASH sample gaps without captured DB activity
/