ORACLE建庫過程中自動生成的跟鎖相關的VIEW

zhang41082發表於2019-05-10

之前一直沒有注意過,而且都是使用現成的文件來手工建庫,今天才發現我們的手冊沒有執行catblock.sql這個指令碼,所以就沒有建立這些檢視。這些檢視不是必須的,但是有了這些檢視可能會使用起來方便點。

ORACLE自動建立瞭如下幾個檢視:
DBA_KGLLOCK
DBA_LOCK
DBA_LOCK_INTERNAL
DBA_DML_LOCKS
DBA_DDL_LOCKS
DBA_WAITERS
DBA_BLOCKERS

他們各自的含義其實只要看catblock.sql指令碼中的註釋就可以了,這裡只是把註釋搬過來,記錄一下。

[@more@]

DBA_KGLLOCK:
/* this is an auxiliary view containing the KGL locks and pins */

DBA_LOCK:
/*
* DBA_LOCK has a row for each lock that is being held, and
* one row for each outstanding request for a lock or latch.
* The columns of DBA_LOCK are:
* session_id - session holding or acquiring the lock
* type - type of lock
* mode_held - mode the lock is currently held in by the session
* mode_requested - mode that the lock is being requested in by the process
* lock_id1 - type specific identifier of the lock
* lock_id2 - type specific identifier of the lock
* last_convert - time (in seconds) since last convert completed
* blocking_others - is this lock blocking other locks
*/

DBA_LOCK_INTERNAL:
/*
* DBA_LOCK_INTERNAL has a row for each lock or latch that is being held, and
* one row for each outstanding request for a lock or latch.
* The columns of DBA_LOCK_INTERNAL are:
* session_id - session holding or acquiring the lock
* type - type of lock (DDL, LATCH, etc.)
* mode_held - mode the lock is currently held in by the session
* mode_requested - mode that the lock is being requested in by the process
* lock_id1 - type specific identifier of the lock
* lock_id2 - type specific identifier of the lock
*
* NOTE: this view can be very, very slow depending on the size of your
* shared pool area and database activity.
*/

DBA_DML_LOCKS:
/*
* DBA_DML_LOCKS has a row for each DML lock that is being held, and
* one row for each outstanding request for a DML lock. It is subset
* of DBA_LOCKS
*/

DBA_DDL_LOCKS:
/*
* 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
*/

DBA_WAITERS:
/*
* Show all the sessions waiting for locks and the session that holds the
* lock.
*/

DBA_BLOCKERS:
/*
* Show all the sessions that have someone waiting on a lock they hold, but
* that are not themselves waiting on a lock.
*/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25016/viewspace-1004706/,如需轉載,請註明出處,否則將追究法律責任。

相關文章