Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Newbie: finding out which tables are lock?

Newbie: finding out which tables are lock?

From: andrew phuong <caop_at_infosci.com.au>
Date: Wed, 25 Oct 2000 09:26:36 +1000
Message-ID: <K0oJ5.5$wW5.2506@vic.nntp.telstra.net>

Hi All,

I've been trying to write a script to find out which tables are currently locked (e.g someone has not executed a commit after updating a table)

What I have so far is.

select b.username,c.sid,c.owner,
c.object,b.lockwait,a.sql_text

from v$sqltext a,
     v$session b,
     v$access  c,
     v$locked_object d,
     dba_objects e
where  a.address=b.sql_address
and    a.hash_value=b.sql_hash_value
and    b.sid=c.sid
and    d.object_id=e.object_id

and e.object_name=c.object
and c.owner!='SYS'

I then tested this by UPDATE a table without a commit. When I execute this script
it returns nothing. Can any guru out there see the flaw in the script ?

Thanks in advance.

Andrew Received on Tue Oct 24 2000 - 18:26:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US