How long lock should be in order to take snapshot of locks [message #659625] |
Tue, 24 January 2017 19:03 |
|
juniordbanewbie
Messages: 250 Registered: April 2014
|
Senior Member |
|
|
Dear Sir/Mdm,
as our customer is using SE, there's no way we can have historical information of locks. every time they ask me to look at locking issues, the issue is already gone.
DBA_HIST_ACTIVE_SESS_HISTORY is not populated
there's no equivalent in STATSPACK as well.
from http://www.orafaq.com/node/854, I'm thinking of taking snapshot of v$lock, v$process, dba_objects.
I'm intending to modify statspack package script and install it as another schema.
based on https://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_2027.htm#REFRN30121
CTIME came close to the time the lock is held, what should this value be to qualify taking snapshot of the lock?
code is like
PROCEDURE snap_latch IS
/* Capture Latch details statistics */
begin
insert into stats$latch_children
( snap_id
, dbid
, instance_number
, latch#
, child#
, gets
, misses
, sleeps
, immediate_gets
, immediate_misses
, spin_gets
, wait_time
)
select l_snap_id
, p_dbid
, p_instance_number
, latch#
, child#
, gets
, misses
, sleeps
, immediate_gets
, immediate_misses
, spin_gets
, wait_time
from v$latch_children;
|
|
|
|
|
|
|
|
|