首页产品库评测行情新闻|手机数码笔记本台式机DIY硬件数字家庭数码相机办公外设|软件下载游戏开发|社区

更多

数码相机
MP4
LCD
机箱
音箱

软件资讯设计 工具 系统 开发 安全 办公 陶吧 IT教育 Vista频道 | 下载中心酷我音乐盒 腾讯QQ
天极网 > 开发频道>DB2诊断系列之---定位锁等待问题

DB2诊断系列之---定位锁等待问题

2007-11-26 10:46作者:tacy lee出处:论坛整理责任编辑:方舟

  4、根据RecordID找到锁在哪行

  db2提供了一个强大的数据分析工具db2dart,可以dump出相应的page数据

  #db2dart eos /dd /tsi 2 /oi 1560 /ps 157312p /np 1 /v y

  Warning: The database state is not consistent.

  Warning: Reorg rows MAY be due to the inconsistent state of the database.

  DB2DART Processing completed with warning(s)!

  Complete DB2DART report found in:

  /home/db2inst1/sqllib/db2dump/DART0000/EOS.RPT

  其中tsi为表空间id(2),oi为表id(1560),ps为page number(0x0266807),需要转换为十进制,在结尾必须加p,np代表你要获取的页数,v为是否详细输出

  现在我们来看看EOS.RPT

  ______________________________________________________________________________

  _______ DART _______

  D a t a b a s e A n a l y s i s a n d R e p o r t i n g T o o l

  IBM DB2 6000

  ______________________________________________________________________________

  DART (V8.1.0) Report:

  2007-11-24-20.59.51.355893

  Database Name: EOS

  Report name: EOS.RPT

  Old report back-up: EOS.BAK

  Database Subdirectory: /opt/db2/db2inst1/NODE0000/SQL00001

  Operational Mode: Database Inspection Only (INSPECT)

  ______________________________________________________________________________

  ------------------------------------------------------------------------------

  Action option: DD

  Table-object-ID: 1560; Tablespace-ID: 2; First-page: 157312p; Number-pages: 1; Verbose: y

  Warning: The database state is not consistent.

  Warning: Reorg rows MAY be due to the inconsistent state of the database.

  Connecting to Buffer Pool Services...

  Table object report phase start.

  Dump format is verbose.

  ______________________________________

  Page 0 of object 1560 from table space 2.

  BPS Page Header:

  Page Data Offset = 48

  Page Data Length = 4048

  Page LSN = 0000 AE97 AE41

  Object Page Number = 0

  Pool Page Number = 157312

  Object ID = 1560

  Object Type = Data Object

  Data Page Header:

  Slot Count = 8

  Total Free Space = 2784

  Total Reserve Space = 0

  Youngest Reserve Space = n/a

  Youngest TID = n/a

  Free Space Offset = 2799

  Maximum Record Size = 23

  Data Records:

  Slot 0:

  Offset Location = 3996 (xF9C)

  Record Length = 32 (x20)

  Record Type = Data Object Header Control Record

  Page count = 1

  Object Creation LSN = 0000 AE97 800C

  Object State = x0000

  UDI Since Runstats = 0

  DART Field = x00000000

  Slot 1:

  Offset Location = 2992 (xBB0)

  Record Length = 1004 (x3EC)

  Record Type = Free Space Control Record

  Free space entries:

  0: 2884 (x0B44), 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC)

  4: 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC)

  8: 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC)

  省略。。。

  492: 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC)

  496: 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC)

  Slot 2:

  Offset Location = 2916 (xB64)

  Record Length = 76 (x4C)

  Record Type = Table Directory Record

  MetaIndex Root Page = 157377

  Index Type = 2

  Table Descriptor Pointer -- Page 157312 Slot 3

  Max Insert Search = 0

  Flags = x02000200

  bit representation = 00000010 00000000 00000010 00000000

  Check pending info:

  Constraint status = x00

  Constraint RID = Page 0 Slot 0

  last BID = x00000000

  Slot 3:

  Offset Location = 2892 (xB4C)

  Record Length = 24 (x18)

  Record Type = Table Description Record

  Number of Columns = 2

  Column 1:

  Type is Long Integer

  Length = 4

  Prohibits NULLs

  Prohibits Default

  Fixed offset: 0

  Column 2:

  Type is Fixed Length Character String

  Length = 10

  Allows NULLs

  Prohibits Default

  Fixed offset: 4

  Slot 4:

  Offset Location = 2869 (xB35)

  Record Length = 23 (x17)

  Record Type = Table Data Record (FIXEDVAR)

  Fixed part length value = 15

  Column 1:

  Fixed offset: 0

  Type is Long Integer

  Value = 1

  Column 2:

  Fixed offset: 4

  Type is Fixed Length Character String

  61202020 20202020 2020 a

  Slot 5:

  Offset Location = 2846 (xB1E)

  Record Length = 23 (x17)

  Record Type = Table Data Record (FIXEDVAR)

  Fixed part length value = 15

  Column 1:

  Fixed offset: 0

  Type is Long Integer

  Value = 2

  Column 2:

  Fixed offset: 4

  Type is Fixed Length Character String

  61202020 20202020 2020 a

  Slot 6:

  Offset Location = 2823 (xB07)

  Record Length = 23 (x17)

  Record Type = Table Data Record (FIXEDVAR)

  Fixed part length value = 15

  Column 1:

  Fixed offset: 0

  Type is Long Integer

  Value = 3

  Column 2:

  Fixed offset: 4

  Type is Fixed Length Character String

  61202020 20202020 2020 a

  Slot 7:

  Offset Location = 2800 (xAF0)

  Record Length = 23 (x17)

  Record Type = Table Data Record (FIXEDVAR)

  Fixed part length value = 15

  Column 1:

  Fixed offset: 0

  Type is Long Integer

  Value = 4

  Column 2:

  Fixed offset: 4

  Type is Fixed Length Character String

  61202020 20202020 2020 a

  Slots Summary: Total=8, In-use=8, Deleted=0.

  Table object report phase end.

  ______________________________________

  DB2DART Processing completed with warning(s)!

  Warning(s) detected during processing.

  ______________________________________

  Complete DB2DART report found in:

  /home/db2inst1/sqllib/db2dump/DART0000/EOS.RPT

  _______ D A R T P R O C E S S I N G C O M P L E T E _______

  找到Solt 7 (0x07),ok,你现在可以清楚的知道应用等待的Row为(4,a)

  总结

  通过上面的方法,我们简单描述了一个db2锁问题的定位方法,希望能给大家在分析和定位应用性能问题的时候起到一定的帮助

共2页。 上一页12
进入 最权威的Windows 7论坛 查看网友讨论

软件频道最新更新

热点推荐

IT嘉年华

编辑推荐

软件下载

热门
推荐

网友关注

软件
资料
游戏

装机推荐

文章排行

本周
本月
最新更新
天极服务|关于我们|About us|网站律师|RSS订阅|友情合作|加入我们|天极动态|网站地图|意见反馈|MSN/QQ上看天极
Copyright (C) 1999-2012 Yesky.com, All Rights Reserved 版权所有 天极网络