Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: enqueue wait objects?
It depends on the type of enqueue, of course, but for a row wait (i.e.,
waiting on a locked row):
SELECT sid, taddr, lockwait, status, sql_address,
row_wait_obj# RW_OBJ#, row_wait_file# RW_FILE#, row_wait_block#
RW_BLOCK#, row_wait_row# RW_ROW#
FROM v$session
WHERE sid = &sid
ORDER BY sid;
The status for a waiting session is ACTIVE. SQL_ADDR is the address for the last SQL statement that the session executed; you can get the SQL text by querying V$SQL. For the waiter, this is the SQL that caused the wait. For the blocker this could be the SQL that caused the block, or any SQL executed since.
If ROW_WAIT_OBJ# has a value other than -1, then it means that the session is waiting on a lock for this object. The object information can be obtained by joining with DBA_OBJECTS.OBJECT_ID or DBA_OBJECTS.DATA_OBJECT_ID. The other RW* columns identify the row (by file id, block id, row number) that the waiting session wants to lock.
DBA_OBJECTS can tell you the table owner and the table name.
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Fri Feb 20 2004 - 17:20:15 CST
![]() |
![]() |