Oracle 视图 V$LOCK 官方解释,作用,如何使用详细说明
本站中文解释
Oracle视图 V$LOCK 是系统提供的一种查看当前数据库系统锁定信息的视图,它主要用于查看当前数据库的并发锁情况。查看本视图的作用,也可以帮助了解当前数据库系统正在执行的锁,比如可以查看出表被谁锁住,是行锁还是表锁,谁正在锁定这个表,说明在进行哪个操作,等等。
V$LOCK 视图可以用于下面的查询:
1.查某客户端正在使用的锁
SELECT * FROM V$LOCK WHERE sid = sid
2.查出某表被锁定的详情
SELECT * FROM V$LOCK WHERE id1=(SELECT DISTINCT(DATA_OBJECT_ID) FROM USER_OBJECTS WHERE OBJECT_NAME=’表名’)
官方英文解释
V$LOCK
lists the locks currently held by the Oracle Database and outstanding requests for a lock or latch.
Column | Datatype | Description |
---|---|---|
|
|
Address of lock state object |
|
|
Address of lock |
|
|
Identifier for session holding or acquiring the lock |
|
|
Type of user or system lock The locks on the user types are obtained by user applications. Any process that is blocking others is likely to be holding one of these locks. The user type locks are:
The system type locks are listed in Table 9-1. Be aware that not all types of locks are documented. To find a complete list of locks for the current release, query the |
|
|
Lock identifier #1 (depends on type) |
|
|
Lock identifier #2 (depends on type) |
|
|
Lock mode in which the session holds the lock:
|
|
|
Lock mode in which the process requests the lock:
|
|
|
Time since current mode was granted |
|
|
Indicates whether the lock in question is blocking other processes. The possible values are:
|
|
|
The ID of the container to which the data pertains. Possible values include:
|
Table 9-1 Values for the TYPE Column: System Types
System Type | Description | System Type | Description |
---|---|---|---|
|
Edition enqueue |
MR |
Media recovery |
|
Lock held for the |
NA..NZ |
Library cache pin instance ( |
|
Buffer hash table instance |
|
Password File |
|
Control file schema global enqueue |
|
Parallel operation |
|
Cross-instance function invocation instance |
|
Process startup |
|
Cursor bind |
|
Row cache instance ( |
|
datafile instance |
|
Redo thread global enqueue |
|
Direct loader parallel index create |
|
System change number instance |
|
Mount/startup db primary/secondary instance |
|
SMON |
|
Distributed recovery process |
|
Sequence number instance |
|
Distributed transaction entry |
|
Sequence number enqueue |
|
File set |
|
Sort segment |
|
Space management operations on a specific segment |
|
Space transaction enqueue |
|
Instance number |
|
Sequence number value |
|
Instance recovery serialization global enqueue |
|
Generic enqueue |
|
Instance state |
|
Temporary segment enqueue (ID2=0) |
|
Library cache invalidation instance |
|
New block allocation enqueue (ID2=1) |
|
Job queue |
|
Temporary table enqueue |
|
Thread kick |
|
User name |
|
Library cache lock instance lock (A..P = namespace) |
|
Undo segment DDL |
|
Mount definition global enqueue |
|
Being-written redo log instance |