How to find out Blocking locks from Oracle Database

Share free Oracle DBA scripts and OS related shell scripts in this forum section. Very useful resource sharing for all DBAs and System administrators. Shell scripts, DBA scripts, SQL scripts, PL/SQL Packages, functions, triggers, windows dos scripts, sharing.

How to find out Blocking locks from Oracle Database

Postby Gitesh » Tue Aug 30, 2011 7:08 pm

Hi Friends,

Checking blocking locks is regular task of Oracle DBA. But problem is that how can find out blocking locks from database. Because so many SQL scripts are available and some of those stuck after execution of script. Here I am providing some of good SQL scripts for finding block locks.

Script-1: Blocking lock find out

Code: Select all
select l1.sid, ' IS BLOCKING ', l2.sid
from v$lock l1, v$lock l2
where l1.block =1 and l2.request > 0
and l1.id1=l2.id1
and l1.id2=l2.id2;
Gitesh
 
Posts: 11
Joined: Sat Aug 27, 2011 8:56 pm

Return to Free Oracle Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron