ITPub博客

首页 > 数据库 > Oracle > ORACLE建库过程中自动生成的跟锁相关的VIEW

ORACLE建库过程中自动生成的跟锁相关的VIEW

原创 Oracle 作者:zhang41082 时间:2019-05-10 18:03:04 0 删除 编辑

之前一直没有注意过,而且都是使用现成的文档来手工建库,今天才发现我们的手册没有执行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博客 ” ,链接:https://blog.itpub.net/25016/viewspace-1004706/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2002-10-11

  • 博文量
    105
  • 访问量
    122256