Question: I want to find what session have
locked a library cache object/ Can I use the v$access view for
this or do I need to use v$locked_object?
Answer: In addition to
v$_locked_object you can also query the
v$access
view (starting in 11g) to identify locked objects:
column object
format a30
select
a.object,
a.type,
a.sid,
b.serial#,
b.username,
b.osuser,
b.program
from
v$access a,
v$session b
where
a.sid =
b.sid
and
a.owner =
DECODE(UPPER('&1'), 'ALL', a.object, upper('&1'))
and
a.object = DECODE(UPPER('&2'),
'ALL', a.object, upper('&2'))
order by
a.object;
|
|
Get the Complete
Oracle SQL Tuning Information
The landmark book
"Advanced Oracle
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|