WEB开发网
开发学院数据库Oracle DB2和 Oracle的并发控制(锁)比较 阅读

DB2和 Oracle的并发控制(锁)比较

 2008-09-08 12:53:33 来源:WEB开发网   
核心提示: 4.1 快照监控方式当使用快照方式进行锁的监控前,必须把监控锁的开关打开,DB2和 Oracle的并发控制(锁)比较(8),可以从实例级别和会话级别打开,具体命令如下:db2 update dbm cfg using dft_mon_lock on(实例级别)db2 update moni

4.1 快照监控方式

当使用快照方式进行锁的监控前,必须把监控锁的开关打开,可以从实例级别和会话级别打开,具体命令如下:

db2 update dbm cfg using dft_mon_lock on(实例级别)

db2 update monitor switches using lock on(会话级别,推荐使用)

当开关打开后,可以执行下列命令来进行锁的监控

db2 get snapshot for locks on ebankdb(可以得到当前数据库中具体锁的详细信息)

db2 get snapshot for locks on ebankdb

Fri Aug 15 15:26:00 JiNan 2004(红色为锁的关键信息)

       Database Lock Snapshot
Database name               = DEV
Database path               = /db2/DEV/db2dev/NODE0000/SQL00001/
Input database alias            = DEV
Locks held                 = 49
Applications currently connected      = 38
Agents currently waiting on locks     = 6
Snapshot timestamp             = 08-15-2003 15:26:00.951134
Application handle             = 6
Application ID               = *LOCAL.db2dev.030815021007
Sequence number              = 0001
Application name              = disp+work
Authorization ID              = SAPR3
Application status             = UOW Waiting
Status change time             =
Application code page           = 819
Locks held                 = 0
Total wait time (ms)            = 0
Application handle             = 97
Application ID               = *LOCAL.db2dev.030815060819
Sequence number              = 0001
Application name              = tp
Authorization ID              = SAPR3
Application status             = Lock-wait
Status change time             = 08-15-2003 15:08:20.302352
Application code page           = 819
Locks held                 = 6
Total wait time (ms)            = 1060648
 Subsection waiting for lock       = 0
 ID of agent holding lock         = 100
 Application ID holding lock       = *LOCAL.db2dev.030815061638
 Node lock wait occurred on        = 0
 Lock object type             = Row
 Lock mode                = Exclusive Lock (X)
 Lock mode requested           = Exclusive Lock (X)
 Name of tablespace holding lock     = PSAPBTABD
 Schema of table holding lock       = SAPR3
 Name of table holding lock        = TPLOGNAMES
 Lock wait start timestamp        = 08-15-2003 15:08:20.302356
 Lock is a result of escalation      = NO
List Of Locks
 Lock Object Name      = 29204
Node number lock is held at = 0
Object Type         = Table
Tablespace Name       = PSAPBTABD
Table Schema        = SAPR3
Table Name         = TPLOGNAMES
Mode            = IX
Status           = Granted
Lock Escalation       = NO

db2 get snapshot for database on dbname |grep -i locks(UNIX,LINUX平台)

上一页  3 4 5 6 7 8 9 10  下一页

Tags:DB Oracle 并发

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接