beliveAda 发表于 2013-1-13 18:15:56

查看表空间详细信息

查看表空间详细信息
   list tablespaces

具体使用方法是这样的:
首先,连接数据库,连接成功之后,输入命令db2 list tablespaces show detail,即可查看详细信息。
具体计算表空间的方法是:
找到 Tablespace ID 后, Total pages *Page size (bytes) ,出来的是总共的表空间大小,但单位是字节哦。需要再除以1024来查看具体的表空间。

以下是具体的表空间的大小详细信息
Tablespaces for Current Database
Tablespace ID                        = 4
Name                                 = TMSTBS0
Type                                 = Database managed space
Contents                           = All permanent data. Large table space.
State                              = 0x0000
   Detailed explanation:
   Normal
Total pages                        = 7680000
Useable pages                        = 7679808
Used pages                           = 4897536
Free pages                           = 2782272
High water mark (pages)            = 7555392
Page size (bytes)                  = 8192
Extent size (pages)                  = 64
Prefetch size (pages)                = 1152
Number of containers               = 3

Tablespace ID                        = 5
Name                                 = TMSTBS1
Type                                 = Database managed space
Contents                           = All permanent data. Large table space.
State                              = 0x0000
   Detailed explanation:
   Normal
Total pages                        = 7680000
Useable pages                        = 7679808
Used pages                           = 4661696
Free pages                           = 3018112
High water mark (pages)            = 5728960
Page size (bytes)                  = 8192
Extent size (pages)                  = 64
Prefetch size (pages)                = 1152
Number of containers               = 3


DB21011IIn a partitioned database server environment, only the table spaces
on the current node are listed.

具体关注的是标红的这几个指标

计算表空间, Total pages* Page size (bytes)
7680000 *8192 = 62914560000 bytes
转换为G的大小为:62914560000/1024/1024/1024 得出TMSTBS1的表空间为58.59375G。
页: [1]
查看完整版本: 查看表空间详细信息