Oracle Blocking Sessions
Oracle Blocking Sessions
Iyour e1111il
I
'fraekina Oracle blockina senions
Oracle Ti!JI
Ill!!
Oracle Goldm<dtl> llg
B URL ESO N
(OI< ULTIHG
The Bridu to
EV!I'f!!hlft
Oncle Dmrs:ptp moor
Oracle Articles
They come and go so fast that cannot always see them If there a way to track blocking I sessions in Oracle? Answer: Sadly, Oracle time-series tables (STATSPACK andAWR) do not track
SERVICES
Oracle Training Oracle lips Oracle Forum OassCatalog
blocking session and waiting sessions. but you can use the extra-cost ASH components can track bhcking sessions for one hour into the past. As a blocking session alert mechanism, you can schedule a job to check every 5 minutes for a blocking session (using this script to \find blocking sessions with y$session) and then trigger a procedure to hcate the exact data block where the blocking/waiting occurred. This automated blocking tracing can then be e-nailed to the DBA for subsequent investigation and repair.
SUPPORT
Rerrote DBA Oracle Tuning Emergency 911 RACSupport Apps Support Analysis Design I!Tllle1111ntation Oracle Support
Here is a query that gives us a JEt ofblocking sessions and the sessions that they are blocking:
select
blocking_session,
sid,
serial#,
wait_class,
seconds in wait
from v$session
where
CONSULTING
SQL Tuning Security Oracle UNX Oracle Linux Monftoring Rerrote support Rerrote plans Rerrote services Application Server Applications Oracle For1111 Oracle Fl:lrtal App Upgrades SQLServer Oracle Concepts Softw are Support Rerrote Support Developrrent IITlJierrentation
blocking_session;
BLOCKING_SESSION
148
SID
135
SERIAL# WAIT_CLASS
61521 Idle
SECONDS_IN_WAIT
64
In this case, we find that session 148 "ti blocking session 135 and bas been fur 64
seconds. For complete scripts fur detecting bk.lcking session, see the Oracle script collection AJso see these related notes on finding Oracle blocking sessions:
Find blocking sessions with y$session Find the
lt1.M,Itftlftlr
lOft
da
lth Ch c ?
Don't get blamed forb d perform neeI
ABOUT BC
COnsultingStaff COnsulting Prices Help Wanted!
www.dba-oracle.com/t_tracking_oracle_blocking_sessions.htm
1/3
6/22/12
Oracle Books
Oracle Pbslers Oracle Books Oracle Scripts For experts only Over 600 advanced Oracle Scripts
ion
Excei-CB
Nut.: Thia Orade documentation W1lll anted as a anpport and Orade training reference for use by our DBA performance tuning conaulting professionals.
www.dba-oracle.com/t_tracking_oracle_blocking_sessions.htm
2/3
6122112
.ar.a1 Olllell> lM UI'III'II cU.qfquohrt l1mt lo updldit our BC Onldl> 111pp0rtlnf..,.,....,. lla.Cu errot'or... ""- ..,... CIODWilt,... OI(Ipnldale)WI't..l111t ....all: DBAC!Iremote-dba.net... ha.d.,... ,URL""a. pap.
If,...
rrrr
Burleson Consulting
Qmsfp brfmmDCI Tuning
Rtmotp DBASarvlc;es