Sep 20, 2006

Excessive wait events

SQL> select a.event e0, count(*) t0 from sys.v_$session_wait a , sys.v_$event_name n where a.event= n.name group by event;

E0 T0
---------------------------------------------------------------- ----------
SQL*Net message from client 135
SQL*Net message to client 1
db file scattered read 5
db file sequential read 6
enqueue 144
latch free 1
pipe get 1
pmon timer 1
rdbms ipc message 12
smon timer 1

10 rows selected.

Here equeue represents that some session is holding the lock.
To find out which session is holding the lock:

SQL> select /*+ RULE */ a.session_id, s.serial#, s.username, s.status
from dba_locks a, v$session s
where a.blocking_others = 'Blocking'
and a.session_id = s.sid
order by 1;

SESSION_ID SERIAL# USERNAME STATUS
---------- ---------- ------------------------------ --------
436 5032 TEST INACTIVE

SQL> select sql_address, username, SQL_HASH_VALUE,LOGON_TIME,LAST_CALL_ET,status from v$session where sid=436;

SQL_ADDR USERNAME SQL_HASH_VALUE LOGON_TIME LAST_CALL_ET STATUS
-------- ------------------------------ -------------- ------------------- ------------ --------
00 TEST 0 2006-09-20 00:04:39 0 INACTIVE

SQL> select a.sql_text from v$session b,v$sqlarea a where a.address=b.sql_address and b.sid=436;

no rows selected

If SQL_ADDRESS shows some what like '00' it means that particular session not doing any transaction.

To release the Block/LOCK Kill the session based on the sql it is holding/ by knowing the imp. of the sql.

alter system kill session '436,5032';

No comments: