0% found this document useful (0 votes)
169 views3 pages

Oracle Blocking Sessions

This document discusses how to track blocking sessions in Oracle. It notes that STATSPACK and AWR do not track blocking sessions by default, but the ASH components can track blocking sessions for the past hour. It provides a script to check for blocking sessions every 5 minutes and trigger an alert procedure. It also includes a query to list blocking sessions and the sessions they are blocking, including the wait class and time spent waiting.

Uploaded by

shaan_ocp
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
169 views3 pages

Oracle Blocking Sessions

This document discusses how to track blocking sessions in Oracle. It notes that STATSPACK and AWR do not track blocking sessions by default, but the ASH components can track blocking sessions for the past hour. It provides a script to check for blocking sessions every 5 minutes and trigger an alert procedure. It also includes a query to list blocking sessions and the sessions they are blocking, including the wait class and time spent waiting.

Uploaded by

shaan_ocp
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

6/22/12

Tracking Oracle blocking sessions

Free Oracle Tips

Iyour e1111il

I
'fraekina Oracle blockina senions

Oracle Ti!JI

CHTML CText Search BC Oracle Sites

Oracle Dlrtv R"'ulo Omde ltolation Leye!

Ill!!
Oracle Goldm<dtl> llg

B URL ESO N
(OI< ULTIHG

The Bridu to

EV!I'f!!hlft
Oncle Dmrs:ptp moor

Question: I have transient hcking problems in what appear to be blocking sessions.


1-bllll E-llllil Us

sharing eauals similar Bow to Add Spoce to an


Oru]e Linus: Dirp;ton

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 is not NULL order by

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

FREE new White paper

lt1.M,Itftlftlr

data block for a blockin1: session

Oracle RAC blockin& sessions

lOft
da
lth Ch c ?
Don't get blamed forb d perform neeI

Need an Oracle Health Check?


Do you have bad performance after an upgrade? Need to certify that your database follows best practices? BC Oracle performance gurus can quickly certify every aspect of your Oracle database and provide a complete verification that your database is fully optimized.

ABOUT BC
COnsultingStaff COnsulting Prices Help Wanted!

www.dba-oracle.com/t_tracking_oracle_blocking_sessions.htm

1/3

6/22/12

Tracking Oracle blocking sessions

Oracle Books
Oracle Pbslers Oracle Books Oracle Scripts For experts only Over 600 advanced Oracle Scripts

ion
Excei-CB

Bur1eson the Almri:an Team

Nut.: Thia Orade documentation W1lll anted as a anpport and Orade training reference for use by our DBA performance tuning conaulting professionals.

Feel free to aak questions on our Oracle forum.


Vm.fjl IDqlt!liml Anyone considering using the senices of an Oracle suwort u.pert ahould independently inwstigate their credentials and experience,and not rely on adwrtisements andaelf-prodaimed expertise.All legitimate Oracle experts publish their Orade oualifl.catlons.

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

CoP,JifptT 1!1:!16- 2112 Allri,plln11no"

You might also like