SQL or Session Id that is locking a table (110)
SQL or Session Id that is locking a table
Shareplex for Oracle all versions: These two scripts can be used to find out what user and sql is locking a table at a given time.
Run the first sql to get the oracle session id's that are present at a given time.
Run the second sql to get the sql that is running against a table at the time.
Select sid, serial#, username, osuser, program, status, to_char(logon_time, 'yyyy-mm-dd hh24:mi:ss')
from v$session where status='ACTIVE' and username is not null order by username, logon_time;
select hash_value, sql_text from v$sqltext, V$session
where hash_value = sql_hash_value and v$session.sid=&sid
order by piece;
© 2020 Quest Software Inc. ALL RIGHTS RESERVED.