Blocking Session in v$session [message #561888] |
Thu, 26 July 2012 01:57 |
|
ramoradba
Messages: 2457 Registered: January 2009 Location: AndhraPradesh,Hyderabad,I...
|
Senior Member |
|
|
Hi All,
I had a strange situation today.
I `ve 2 sessions with SID 375,659.
On Session 659 ,I am describing One Procedure or compiling one procedure.Its taking lot of time to complete or to return So From Sid# 375 I am monitoring it for the Blocking session.
Dev> select
2 blocking_session,
3 blocking_instance,
4 sid,
5 serial#,
6 wait_class,
7 seconds_in_wait,wait_time,state
8 from
9 v$session
10 where
11 blocking_session is not NULL
12 order by
13 blocking_session
14 /
BLOCKING_SESSION BLOCKING_INSTANCE SID SERIAL# WAIT_CLASS SECONDS_IN_WAIT WAIT_TIME STATE
---------------- ----------------- ---------- ---------- ------------- --------------- ---------- --
593 1 659 48646 Concurrency 459 0 WAITING
But when I verified for Blocking session There are no sessions with that sid(593) in v$session view.
Dev> select count(*) from v$session where sid=593;
COUNT(*)
----------
0
1 row selected.
It was In wait state Upto seconds_in_wait 900 approx. Then Again Its restarted from 0.
Please see below.
Dev> /
BLOCKING_SESSION BLOCKING_SE BLOCKING_INSTANCE SID SERIAL#
---------------- ----------- ----------------- ---------- ----------
WAIT_CLASS SECONDS_IN_WAIT WAIT_TIME STATE
------------- --------------- ---------- -------------------
593 VALID 1 659 48646
Concurrency 898 0 WAITING
1 row selected.
Dev> /
no rows selected
Dev> /
BLOCKING_SESSION BLOCKING_SE BLOCKING_INSTANCE SID SERIAL#
---------------- ----------- ----------------- ---------- ----------
WAIT_CLASS SECONDS_IN_WAIT WAIT_TIME STATE
------------- --------------- ---------- -------------------
593 VALID 1 659 48646
Concurrency 0 0 WAITING
1 row selected.
Dev> /
BLOCKING_SESSION BLOCKING_SE BLOCKING_INSTANCE SID SERIAL#
---------------- ----------- ----------------- ---------- ----------
WAIT_CLASS SECONDS_IN_WAIT WAIT_TIME STATE
------------- --------------- ---------- -------------------
593 VALID 1 659 48646
Concurrency 3 0 WAITING
1 row selected.
But When I killed the session with sid 659 blocking session 593 also got cleared.
Dev> select sid,serial#,program,terminal,type ,username,status,sql_id,prev_sql_id
2 from v$session
3 where username='Sriram' and terminal='Machine1'
4 /
SID SERIAL# PROGRAM TERMINAL TYPE USERNAME STATUS
---------- ---------- ------------ -------- ---------- ---------- --------
SQL_ID PREV_SQL_ID
------------- -------------
375 58962 sqlplusw.exe Machine1 USER Sriram ACTIVE
89dr4vkmr9jfs 633nsfc8bvnm3
659 48646 sqlplusw.exe Machine1 USER Sriram ACTIVE
cvv8a6j3z0g3s
2 rows selected.
Dev> alter system disconnect session '659,48646' immediate;
Dev> select
2 blocking_session,
3 blocking_session_status,
4 blocking_instance,
5 sid,
6 serial#,
7 wait_class,
8 seconds_in_wait,wait_time,state
9 from
10 v$session
11 where
12 blocking_session is not NULL
13 order by
14 blocking_session
15 /
no rows selected
Whats Causing the Problem here. Am I missing anything here ?
Please suggest !
Thank you
Sriram Sanka
|
|
|
|
|
|
|
|
|
|