analyze db locks query running
TRANSCRIPT
-
8/11/2019 Analyze DB Locks Query Running
1/3
select * from gv$session where sid = 1877
select * from shep_log where msg_text like 'DOD%' order by 1 desc
select * from citing_lni_queue
select * from allref_lni_dod where cited_lni = '4YF7-GVF1-NRF4-41KW-00000-01' --.1
select * from v$sqlarea where sql_id = '843hvcpgn0dcn'
select * from shep_log where msg_text like 'DOD Error in reload LNI%' order by 1 desc
select * FROM v$session_longops where sid = 1877
select * from dba_locks where lock_id1 in (389518,378002) --Row Exclusive lock Row-X (SX)
select * from dba_locks where lock_id2 in (389518, 378002)
select * from v$locked_object where object_id in (389518,378002)
select * from dba_objects where object_name = 'ALLREF_CITE_DOD'
select * from dba_objects where object_id in(262153, 489565)
select * from v$lock where sid = 1877
select * from gv$lock where sid = 1877
SELECT * FROM v$lock where sid = 1877MINUSSELECT * FROM v$enqueue_lockwhere sid = 1877
select * from dba_lock_internal
select * from v$dlm_locks
select * from v$session_wait where sid = 1877
select * from dba_dml_locks
select * from dba_dml_locks where lock_id2 = 389518/*ALLREF_CITE_DODALLREF_DOD_QUEUE_TEMP
*/
select p1 "File #", p2 "Block #", p3 "Reason Code", eventfrom v$session_waitwhere sid = 1877
-
8/11/2019 Analyze DB Locks Query Running
2/3
select distinct
u.username, u.osuser,
w.event,w.p2text as reason,ts.name as tablespace,nvl(ddf.file_name, dtf.file_name)
fromv$session_wait w,v$session u,v$tablespace ts
left outer joindba_data_files ddf on ddf.tablespace_name = ts.name
left outer joinDBA_TEMP_FILES dtf on dtf.tablespace_name = ts.name
where u.sid = w.sidand w.p2 = ts.TS#--and w.sid = 1877and w.event = 'db file sequential read';
selectblocking_session,sid,
serial#,wait_class, seconds_in_waitfrom
v$sessionwhere
blocking_session is not NULLorder by
blocking_session; select * from v$session where sid in (1877, 3261)
SELECT NVL(a.username, '(oracle)') AS username, a.osuser, a.sid, a.serial#, c.value AS &1, a.lockwait, a.status, a.module, a.machine, a.program, TO_CHAR(a.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_timeFROM v$session a, v$sesstat c,
v$statname dWHERE a.sid = c.sidand a.sid = 1877AND c.statistic# = d.statistic#AND d.name = DECODE(UPPER('&1'), 'READS', 'session logical reads', 'EXECS', 'execute count', 'CPU', 'CPU used by this session', 'CPU used by this session')ORDER BY c.value DESC;
-
8/11/2019 Analyze DB Locks Query Running
3/3
select * from v$process where addr = '00000007C1200310'select * from gv$session where sid = 1877select
*from
v$sqlwhere
hash_value= (select
sql_hash_valuefrom
v$sessionwhere paddr=
(select addr from v$process where spid=28308) );