Script to check for Oracle table locks:
Display details on which table is being locked by which process/user
select s1.username || '@' || s1.machine
|| ' ( SID=' || s1.sid || ' ) is blocking '
|| s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
from v$lock l1, v$session s1, v$lock l2, v$session s2
where s1.sid=l1.sid and s2.sid=l2.sid
and l1.BLOCK=1 and l2.request > 0
and l1.id1 = l2.id1
and l2.id2 = l2.id2 ;
Repository of Database Related Information, Assets and Knowledge Base covering Oracle, SQLs, Scripts, Performance Tuning etc
Subscribe to:
Post Comments (Atom)
Labels
oracle SQL
oracle database
oracle 10g
SQL
Optimizer
user
v$session
parameter
sid
sqlplus;database name
userid
username
SET
SPOOL
SQL Faq
SQL Tutorial
column
imp
import
initialization
optimization
oracle DBA
oracle hints
process
rename
rename table
sizing
sql hints
statistics
status
system tables
table
table locks
tablespace
temp tablespace
user name
v$lock
v$parameter
v$process
v$sessmetric
v$sql
No comments:
Post a Comment