Set up a friendly environment to share my understanding and ideas about Oracle / Oracle Spatial database administration, ESRI ArcSDE Geodatabase administration and UNIX (Solaris) operating system.
DBA_WAITERS shows all the sessions that are waiting for a lock.
Column
Datatype
NULL
Description
WAITING_SESSION
NUMBER
The waiting session
HOLDING_SESSION
NUMBER
The holding session
LOCK_TYPE
VARCHAR2(26)
The lock type
MODE_HELD
VARCHAR2(40)
The mode held
MODE_REQUESTED
VARCHAR2(40)
The mode requested
LOCK_ID1
VARCHAR2(40)
Lock ID 1
LOCK_ID2
VARCHAR2(40)
Lock ID 2
Note:
1. $ORACLE_HOME/rdbms/admin/catblock.sql The script creates these views, dba_locks and dba_blockers, along with the following views:
dba_kgllock
dba_lock (dba_locks is synonym for this)
dba_lock_internal
dba_dml_locks
dba_ddl_locks
dba_waiters
2. A number of Oracle views permits to detect locking problems.
V$SESSION_WAIT When a session is waiting on a resource, it can be found waiting on the enqueue wait event, e.g. SELECT * FROM V$SESSION_WAIT WHERE EVENT = 'enqueue';
- SID identifier of session holding the lock
- P1, P2, P3 determine the resource when event = 'enqueue'
- SECONDS_IN_WAIT gives how long the wait did occurs
V$SESSION session information and row locking information
- SID, SERIAL# identifier of the session
- LOCKWAIT address of the lock waiting, otherwise null
- ROW_WAIT_OBJ# object identified of the object we are waiting on (object_id of dba_objects)
- ROW_WAIT_FILE#, ROW_WAIT_BLOCK#, ROW_WAIT_ROW# file_id , block_id and row location within block of the locked row
V$LOCK list of all the locks in the system
- SID identifier of session holding the lock
- TYPE, ID1 and ID2 determine the resource
- LMODE and REQUEST indicate which queue the session is waiting on, as follows:
LMODE > 0, REQUEST = 0 owner
LMODE = 0, REQUEST > 0 acquirer
LMODE > 0, REQUEST > 0 converter
- CTIME time since current mode was converted (see Note 223146.1)
- BLOCK are we blocking another lock
BLOCK = 0 non blocking
BLOCK = 1 blocking others
DBA_LOCK or DBA_LOCKS formatted view on V$LOCK (created via $ORACLE_HOME/rdbms/admin/catblock.sql)
- SESSION_ID == SID in V$LOCK
- LOCK_TYPE, LOCK_ID1, LOCK_ID2 formatted value of TYPE, ID1, ID2 from V$LOCK
- MODE_HELD and MODE_REQUESTED formatted value of LMODE and REQUEST from V$LOCK
- LAST_CONVERT == CTIME of V$LOCK
- BLOCKING_OTHERS formatted value of BLOCK from V$LOCK
V$TRANSACTION_ENQUEUE subset of V$LOCK for the blocking TX resources only (same description as for the V$LOCK view) V$ENQUEUE_LOCK subset of V$LOCK for the system resources only and blocked TX resources only. (same description as for the V$LOCK view) DBA_DML_LOCKS subset of the V$LOCK for the DML (TM) locks only (created via $ORACLE_HOME/rdbms/admin/catblock.sql - same description as the DBA_LOCK view) V$LOCKED_OBJECT same info as DBA_DML_LOCKS, but linked with the rollback and session information
- XIDUSN, XIDSLOT and XIDSQN rollback information to be linked with V$TRANSACTION
- OBJECT_ID object being locked
- SESSION_ID session id
- ORACLE_USERNAME oracle user name
- OS_USER_NAME OS user name
- PROCESS OS process id
- LOCKED_MODE lock mode
V$RESOURCE list of all the currently locked resources in the system. Each row can be associated with one or more rows in V$LOCK - TYPE, ID1 and ID2 determine the resource DBA_DDL_LOCKS has a row for each DDL lock that is being held, and one row for each outstanding request for a DDL lock. It is subset of DBA_LOCKS same description as the DBA_LOCK view DBA_WAITERS view that retrieve information for each session waiting on a lock (created via $ORACLE_HOME/rdbms/admin/catblock.sql)
- WAITING_SESSION waiting session
- HOLDING_SESSION holding session
- LOCK_TYPE, LOCK_ID1, LOCK_ID2 resource locked
- MODE_HELD lock type held
- MODE_REQUESTED lock type requested
DBA_BLOCKERS view that gives the blocking sessions (created via $ORACLE_HOME/rdbms/admin/catblock.sql) -HOLDING_SESSION holding session
DBA_USTATS describes the user-defined statistics collected on all tables and indexes in the database. Its columns are the same as those in ALL_USTATS.
Related Views
·ALL_USTATS describes the user-defined statistics collected on the tables and indexes accessible to the current user.
·USER_USTATS describes the user-defined statistics collected on the tables and indexes owned by the current user.
Column
Datatype
NULL
Description
OBJECT_OWNER
VARCHAR2(30)
Owner of the table or index for which the statistics have been collected
OBJECT_NAME
VARCHAR2(30)
Name of the table or index for which the statistics have been collected
PARTITION_NAME
VARCHAR2(30)
Partition name of a table; NULL if the table is either non-partitioned or the entry corresponds to the aggregate statistics for the table
OBJECT_TYPE
VARCHAR2(6)
Type of the object for which statistics have been collected:
·INDEX
·COLUMN
ASSOCIATION
VARCHAR2(8)
Statistics type association:
·DIRECT Direct association with the object for which the statistics have been collected
·IMPLICIT - Association for which the statistics have been collected is with the column type or index type, and the object is an instance of that column type or index type
COLUMN_NAME
VARCHAR2(30)
Column name, if OBJECT_TYPE is COLUMN, for which statistics have been collected
STATSTYPE_SCHEMA
VARCHAR2(30)
Schema of the statistics type which was used to collect the statistics
STATSTYPE_NAME
VARCHAR2(30)
Name of the statistics type which was used to collect statistics
DBA_OBJECT_SIZE lists the sizes, in bytes, of various PL/SQL objects.
Related View
·USER_OBJECT_SIZE lists the size of PL/SQL objects owned by the current user.
Column
Datatype
NULL
Description
OWNER
VARCHAR2(30)
NOT NULL
Owner of the object
NAME
VARCHAR2(30)
NOT NULL
Name of the object
TYPE
VARCHAR2(12)
Type of the object: TYPE, TYPE BODY, TABLE, VIEW, SYNONYM, SEQUENCE, PROCEDURE, FUNCTION, PACKAGE, PACKAGE BODY, JAVA SOURCE, JAVA CLASS or JAVA RESOURCE
SOURCE_SIZE
NUMBER
Size of the source in bytes. Must be in memory during compilation, or dynamic recompilation.
PARSED_SIZE
NUMBER
Size of the parsed form of the object, in bytes. Must be in memory when an object is being compiled that references this object.
CODE_SIZE
NUMBER
Code size, in bytes. Must be in memory when this object is executing.
ERROR_SIZE
NUMBER
Size of error messages, in bytes. In memory during the compilation of the object when there are compilation errors.
Note:
1. Oracle Metalink (Note 1020288.6) provides a script to report size of stored objects (PL/SQL packages, functions, procedures, Java objects, sequences, types and triggers).
column num_instances heading "Num" format 99999
column type heading "Object Type" format a12
column source_size heading "Source" format 99,999,999
column parsed_size heading "Parsed" format 99,999,999
column code_size heading "Code" format 99,999,999
column error_size heading "Errors" format 999,999
column size_required heading "Total" format 999,999,999
I reserve the right to delete comments that are not contributing to the overall theme of the BLOG or are insulting or demeaning to anyone. The posts on this BLOG are provided "as is" with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer.