`

关于db2dart dbname /dhwm /tsi 的测试

    博客分类:
  • db2
阅读更多

下面是db2dart database /dhwm /tsi tabspaceid

1.       建个新的 dms  ,

Db2dart ……. 查看输出文件:

[0000] 65534 0x0e   [0001] 65534 0x0e   [0002] 65535 0x00

2.create 一个新的table 

Db2dart ……. 查看输出文件:

 [0000] 65534 0x0e   [0001] 65534 0x0e   [0002] 65535 0x00   [0003]     4 0x40*

 [0004]     4 0x00*

3.insert into table select * from table (插入大量条记录)

Db2dart ……. 查看输出文件:

[0000] 65534 0x0e   [0001] 65534 0x0e   [0002] 65535 0x00   [0003]     4 0x40*

 [0004]     4 0x00*  [0005]     4 0x00   [0006]     4 0x00   [0007]     4 0x00 

 [0008]     4 0x00   [0009]     4 0x00   [0010]     4 0x00   [0011]     4 0x00 

 [0012]     4 0x00   [0013]     4 0x00   [0014]     4 0x00   [0015]     4 0x00 

 

测试结束,下面是说明 :

使用DB2工具db2dart分析数据库管理表空间 (DMS) 的使用情况(二)

 

Document #: 8893617F06005

Body:
db2dart test /dhwm /tsi 4

The requested DB2DART processing has completed successfully!

Complete DB2DART report found in:
/home/db2inst1/sqllib/db2dump/DART0000/TEST.RPT

打开输出文件 /home/db2inst1/sqllib/db2dump/DART0000/TEST.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:
2006-09-01-10.41.13.211971

Database Name: TEST
Report name: TEST.RPT
Database Subdirectory: /home/db2inst1/db2inst1/NODE0000/SQL00003
Operational Mode: Database Inspection Only (INSPECT)



------------------------------------------------------------------------------------------------------------------------------
Action option: DHWM

Tablespace-ID: 4

Connecting to Buffer Pool Services...

Highwater mark processing - phase start.

NOTES:

All highwater mark values and/or object sizes listed below aregiven in extents and not pages (unless explicitly stated).*1

The object ID and object type are shown for each extent listed.*2

Extents marked with an asterisk (*) hold the first page of an
object and these extents can only be moved by dropping and
recreating that object.*3

Extents marked as belonging to objects with ID equal to 65534 or
65535 are SMP extents or object table extents and they are not
movable.*4

After following a step and before continuing on to the next one,
disconnect and reconnect to the database.



Highwater Mark: 96 pages, 3 extents (extents #0 - 2)

[0000] 65534 0x0e [0001] 65534 0x0e [0002] 65535 0x00

Dump highwater mark processing - phase start.

Number of free extents below highwater mark: 0
Number of used extents below highwater mark: 3
……


*1 所有的高水位和数据对象标记都以扩展块为单位。

*2 数据对象和数据类型标记在每一个扩展块中。

*3 星号(*)代表数据对象的第一个扩展块。除非数据对象被删除,否则此类扩展块是无法移动的。

*4 对象ID6553465535D的对象为SMPSpace Map Page)扩展块和对象表扩展块,这些扩展块也是不可移动的。这些扩展块就是表空间保留开销。随着数据对象的增加和数据对象中数据量的增加,表空间中可能会创建更多的保留开销扩展块。

从上面的输出可以看到,刚创建完时,数据库管理表空间中只有3个表空间保留开销扩展块:

Highwater Mark: 96 pages, 3 extents (extents #0 - 2)

[0000] 65534 0x0e [0001] 65534 0x0e [0002] 65535 0x00

2 在表空间中创建一个表

db2inst1@p615 /home/db2inst1$ db2 "create table t1 (id int not null, name char(20)) in usrtest"
DB20000I The SQL command completed successfully.

使用 list tablespaces show detail 命令再次检查表空间的使用情况:

db2 list tablespaces show detail

当前数据库的表空间

……



表空间标识

= 4

名称

= USRTEST

类型

= 数据库管理空间

内容

= 任何数据

状态

= 0x0000

详细解释:



正常



总计页数

= 16384

可用页数

= 16352

已用页数

= 160

未用页数

= 16192

高水位标记()

= 160

页大小(以字节计)

= 4096

扩展数据块大小()

= 32

预取大小()

= 32

容器数

= 1

相比前面的输出,表空间中已用的扩展块增加到5个(160页)。用 db2dart DHWM 选项,再次分析该表空间的使用情况:

……
Highwater Mark: 160 pages, 5 extents (extents #0 - 4)

[0000] 65534 0x0e [0001] 65534 0x0e [0002] 65535 0x00 [0003] 4 0x40*
[0004] 4 0x00*

Dump highwater mark processing - phase start.

Number of free extents below highwater mark: 0
Number of used extents below highwater mark: 5
……
相比于前次的输出,增加了下面两个扩展块:
[0003] 4 0x40* [0004] 4 0x00*




[0003]1

42 0x4304*5

[0003]1

代表扩展块3

42

代表对象4

0x43

代表该扩展块存储的是该对象扩展块的对应图

04

代表存储的是数据

*5

代表这是该对象(扩展块对应图)第一个扩展块。

[0004]1

42 0x4304*5

[0004]1

代表扩展块4

42

代表对象4

0x03

代表这是对象扩展块

04

代表存储的是数据

*5

代表这是该对象第一个扩展块。

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics