db2_使用db2dart分析儲存結構

redhouser發表於2011-09-08

目的:
透過dump資料塊/索引塊,瞭解DB2儲存結構,步驟如下:
0,建立測試表:
1,匯出資料,/DDEL選項
2,匯出格式化資料塊,/DD /v y選項
3,匯出十六進位制資料塊,/DD /v h選項
4,匯出十六進位制資料塊,/DP /v y選項
5,匯出格式化索引塊,/DI /v y選項
6,db2dart其他用途:


透過測試,可以得出如下結論:
(1) 表、索引分配在哪些資料塊上可以透過/demp獲取
(2) 表資料儲存:
  *每個資料頁固定位置儲存了該頁所有記錄(slot)的偏移量(需要另外加上x48,slot0的偏移位置),據此查詢每個記錄
  *列資訊儲存在資料塊page0 slot3中
  *空閒空間資訊儲存在page0 slot1中
  *將變長列儲存在每行的結尾
(3) 索引資料塊
  *列資訊儲存在Index Root Vector
  *空閒資訊儲存在Free Page Map
  *每個索引包含一個特殊rid:x(0001 0000 0000)


測試過程:
0,建立測試表:
*表結構:
db2 => describe table employee
                                資料型別                      列
列名                             模式       資料型別名稱      長     小數位 NULL
------------------------------- --------- ------------------- ---------- ----------
EMPNO                           SYSIBM    CHARACTER                    6     0否
FIRSTNME                        SYSIBM    VARCHAR                     12     0否
MIDINIT                         SYSIBM    CHARACTER                    1     0是
LASTNAME                        SYSIBM    VARCHAR                     15     0否
WORKDEPT                        SYSIBM    CHARACTER                    3     0是
PHONENO                         SYSIBM    CHARACTER                    4     0是
HIREDATE                        SYSIBM    DATE                         4     0是
JOB                             SYSIBM    CHARACTER                    8     0是
EDLEVEL                         SYSIBM    SMALLINT                     2     0否
SEX                             SYSIBM    CHARACTER                    1     0是
BIRTHDATE                       SYSIBM    DATE                         4     0是
SALARY                          SYSIBM    DECIMAL                      9     2是
BONUS                           SYSIBM    DECIMAL                      9     2是
COMM                            SYSIBM    DECIMAL                      9     2是

*記錄個數
db2 => select count(*) from employee
         42

*表物件id,表空間id
db2 => select tableid,tbspaceid from syscat.tables where tabname='EMPLOYEE'
TABLEID TBSPACEID
------- ---------
      6         2

*表儲存資訊
db2dart sample /demp /tsi 2 /oi 6
------------------------------------------------------------------------------
Action option: DEMP
Table-object-ID: 6; Tablespace-ID: 2
DART formatted EMP page dump:
-----------------------------
   Traversing extent map for:
   Object ID: 6
   Table space: 2

   Pool specific info:
   -------------------
   Name             =   USERSPACE1
   Pool extent size =   32
   # of containers  =   1

   Container names:
      C:\DB2\NODE0000\SAMPLE\T0000002\C0000000.LRG

   Object specific mapping info:
   -----------------------------
   DAT extent anchor: 1824
   Traversing extent map for object type: 0
      Tablespace ID: 2, Tablespace Seed: 2, Object: 6 EMP page class: 64,
      EMP pool page: 1824, # entries: 1
      Page LSN = 0000000005B6A5F4
      Pool relative page #'s :
       1856             --------&gt1824+32

   INX extent anchor: 352
   Traversing extent map for object type: 1
      Tablespace ID: 2, Tablespace Seed: 2, Object: 6 EMP page class: 65,
      EMP pool page: 352, # entries: 1
      Page LSN = 0000000005B6AD08
      Pool relative page #'s :
        384             --------&gt352+32

   XDA extent anchor: 0
   LF extent anchor: 0
   LOB extent anchor: 0
   LOBA extent anchor: 0
   BKM extent anchor: 0
------------------------------------------------------------------------------

1,匯出資料,/DDEL選項
*匯出命令
db2dart sample /ddel
   Please enter
Table ID or name, tablespace ID, first page, num of pages:
6 2 0 100

*匯出結果
"000010","CHRISTINE","I","HAAS","A00","3978",19950101,"PRES    ",18,"F",19630824,+0152750.00,+0001000.00,+0004220.00
"000020","MICHAEL","L","THOMPSON","B01","3476",20031010,"MANAGER ",18,"M",19780202,+0094250.00,+0000800.00,+0003300.00
...

2,匯出格式化資料塊,/DD /v y選項
*匯出命令
db2dart sample /dd /tsi 2 /oi 6 /ps 0 /np 100 /v y

*透過分析匯出資料,可以看到:
(1) 在page0中,共包括46條記錄(slot)
Slot 0:Data Object Header Control Record,用來記錄一些資料物件(表)的控制資訊,只在page0出現
Slot 1:Free Space Control Record,即 FSCR,用來記錄接下來 500 個頁中每個頁的可用空間近似值
Slot 2:Table Directory Record,用來記錄這個表的目錄資訊,只在page0出現
Slot 3:Table Description Record,對這個表的描述,只在page0出現
Slot 4-Slot 45:Table Data Record (FIXEDVAR),對應42條記錄
(2) 資料分佈如下:
|free space|slot 45|....|slot 4|slot 3|slot 2|slot 1|slot 0|--20--|--48--|
0        3264    3347  6805  6892   7012   7088   8092   8124   8144    8192

*匯出結果
------------------------------------------------------------------------------
Action option: DD
Table-object-ID: 6; Tablespace-ID: 2; First-page: 0; Number-pages: 100; Verbose: y
   Table object report phase start.
   Dump format is verbose.
                           ______________________________________

         Page 0 of object 6 from table space 2.
         BPS Page Header:
                     Page Data ffset = 48
                     Page Data Length = 8144
                             Page LSN = 0000000005B6AB28
                   Object Page Number = 0
                     Pool Page Number = 1856
                            Object ID = 6
                          Object Type = Data Object

               Data Page Header:
                           Slot Count = 46
                     Total Free Space = 3172
                  Total Reserve Space = 0
               Youngest Reserve Space = n/a
                         Youngest TID = n/a
                    Free Space ffset = 3263
                  Maximum Record Size = 92

               Data Records:
            Slot 0:
               Offset Location = 8092  (x1F9C)
               Record Length = 32  (x20)
               Record Type = Data Object Header Control Record
                  Page count = 1
         Object Creation LSN = 0000000005B6A4B8
                Object State = x0000
          UDI Since Runstats = 0
               DFH flag bits = x00000000
        Row Change Timestamp = x00000000000000

            Slot 1:
               Offset Location = 7088  (x1BB0)
               Record Length = 1004  (x3EC)
               Record Type = Free Space Control Record
               Free space entries:
                 0:  3172 (x0C64),  8124 (x1FBC),  8124 (x1FBC),  8124 (x1FBC)  --&gt3172對應page0的Total Free Space
                 4:  8124 (x1FBC),  8124 (x1FBC),  8124 (x1FBC),  8124 (x1FBC)
                 8:  8124 (x1FBC),  8124 (x1FBC),  8124 (x1FBC),  8124 (x1FBC)
               ....
               492:  8124 (x1FBC),  8124 (x1FBC),  8124 (x1FBC),  8124 (x1FBC)
               496:  8124 (x1FBC),  8124 (x1FBC),  8124 (x1FBC),  8124 (x1FBC)  --&gt共500page

            Slot 2:
               Offset Location = 7012  (x1B64)
               Record Length = 76  (x4C)
               Record Type = Table Directory Record
                  TDIR version = 2
                  MetaIndex Root Page = 1
                  Index Type = 2
                  Max Insert Search = 0
                  Dictionary RID -- Page 0  Slot 0
                  Mapping Directory RID  --  Page 0  Slot 0
                  Current table row format version = 0
                  Flags = x0000000106000200
                     bit representation = 00000000 00000000 00000000 00000001
                                          00000110 00000000 00000010 00000000
                  Check pending info:
                     Constraint status    = x00
                     Constraint RID page      = 0
                     last BID page     = x00000000

            Slot 3:
               Offset Location = 6892  (x1AEC)
               Record Length = 120  (x78)
               Record Type = Table Description Record
                  Number of Columns = 14

    Column 1:
                  Type is Fixed Length Character String
                  Length = 6
                  Prohibits NULLs
                  Prohibits Default
            Fixed offset: 0
                  Column 2:
                  Type is Variable Length Character String
                  Maximum Length = 12
                  Prohibits NULLs
                  Prohibits Default
            Fixed offset: 6
                  Column 3:
                  Type is Fixed Length Character String
                  Length = 1
                  Allows NULLs
                  Prohibits Default
            Fixed offset: 10
                  Column 4:
                  Type is Variable Length Character String
                  Maximum Length = 15
                  Prohibits NULLs
                  Prohibits Default
            Fixed offset: 12
                  Column 5:
                  Type is Fixed Length Character String
                  Length = 3
                  Allows NULLs
                  Prohibits Default
            Fixed offset: 16
                  Column 6:
                  Type is Fixed Length Character String
                  Length = 4
                  Allows NULLs
                  Prohibits Default
            Fixed offset: 20
                  Column 7:
                  Type is Gregorian Date
                  Length = 4
                  Allows NULLs
                  Prohibits Default
            Fixed offset: 25
                  Column 8:
                  Type is Fixed Length Character String
                  Length = 8
                  Allows NULLs
                  Prohibits Default
            Fixed offset: 30
                  Column 9:
                  Type is Small Integer
                  Length = 2
                  Prohibits NULLs
                  Prohibits Default
            Fixed offset: 39
                  Column 10:
                  Type is Fixed Length Character String
                  Length = 1
                  Allows NULLs
                  Prohibits Default
            Fixed offset: 41
                  Column 11:
                  Type is Gregorian Date
                  Length = 4
                  Allows NULLs
                  Prohibits Default
            Fixed offset: 43
                  Column 12:
                  Type is Decimal
                  Precision = 9
                  Scale = 2
                  Allows NULLs
                  Prohibits Default
            Fixed offset: 48
                  Column 13:
                  Type is Decimal
                  Precision = 9
                  Scale = 2
                  Allows NULLs
                  Prohibits Default
            Fixed offset: 54
                  Column 14:
                  Type is Decimal
                  Precision = 9
                  Scale = 2
                  Allows NULLs
                  Prohibits Default
            Fixed offset: 60

            Slot 4:
               Offset Location = 6805  (x1A95)  --&gtslot4 offset + x44 = x1A95 + x44 = x1AD9
               Record Length = 87  (x57)
               Record Type = Table Data Record (FIXEDVAR)
               Record Flags = 0
               Fixed part length value = 66

                  Column 1:
            Fixed offset: 0
                  Type is Fixed Length Character String
                      30303030 3130                          000010         
                  Column 2:
            Fixed offset: 6
                  Type is Variable Length Character String     --&gt已經按表中的列序排列,實際存放在記錄末尾
                  Length = 9 ffset = 66
                      43485249 5354494E 45                   CHRISTINE      
                  Column 3:
            Fixed offset: 10
                  Type is Fixed Length Character String
                      49                                     I              
                  Column 4:
            Fixed offset: 12
                  Type is Variable Length Character String
                  Length = 4 ffset = 75
                      48414153                               HAAS           
                  Column 5:
            Fixed offset: 16
                  Type is Fixed Length Character String
                      413030                                 A00            
                  Column 6:
            Fixed offset: 20
                  Type is Fixed Length Character String
                      33393738                               3978           
                  Column 7:
            Fixed offset: 25
                  Type is Gregorian Date
                  Value = 01/01/1995
                  Column 8:
            Fixed offset: 30
                  Type is Fixed Length Character String
                      50524553 20202020                      PRES           
                  Column 9:
            Fixed offset: 39
                  Type is Small Integer
                  Value = 18
                  Column 10:
            Fixed offset: 41
                  Type is Fixed Length Character String
                      46                                     F              
                  Column 11:
            Fixed offset: 43
                  Type is Gregorian Date
                  Value = 08/24/1963
                  Column 12:
            Fixed offset: 48
                  Type is Decimal
                  Value = +0152750.00
                  Column 13:
            Fixed offset: 54
                  Type is Decimal
                  Value = +0001000.00
                  Column 14:
            Fixed offset: 60
                  Type is Decimal
                  Value = +0004220.00

            Slot 5:
               Offset Location = 6716  (x1A3C)
               Record Length = 89  (x59)
               Record Type = Table Data Record (FIXEDVAR)
               Record Flags = 0
               Fixed part length value = 66

                  Column 1:
            Fixed offset: 0
                  Type is Fixed Length Character String
                      30303030 3230                          000020         
                  Column 2:
            Fixed offset: 6
                  Type is Variable Length Character String
                  Length = 7 ffset = 66
                      4D494348 41454C                        MICHAEL        
                  Column 3:
            Fixed offset: 10
                  Type is Fixed Length Character String
                      4C                                     L              
                  Column 4:
            Fixed offset: 12
                  Type is Variable Length Character String
                  Length = 8 ffset = 73
                      54484F4D 50534F4E                      THOMPSON       
                  Column 5:
            Fixed offset: 16
                  Type is Fixed Length Character String
                      423031                                 B01            
                  Column 6:
            Fixed offset: 20
                  Type is Fixed Length Character String
                      33343736                               3476           
                  Column 7:
            Fixed offset: 25
                  Type is Gregorian Date
                  Value = 10/10/2003
                  Column 8:
            Fixed offset: 30
                  Type is Fixed Length Character String
                      4D414E41 47455220                      MANAGER        
                  Column 9:
            Fixed offset: 39
                  Type is Small Integer
                  Value = 18
                  Column 10:
            Fixed offset: 41
                  Type is Fixed Length Character String
                      4D                                     M              
                  Column 11:
            Fixed offset: 43
                  Type is Gregorian Date
                  Value = 02/02/1978
                  Column 12:
            Fixed offset: 48
                  Type is Decimal
                  Value = +0094250.00
                  Column 13:
            Fixed offset: 54
                  Type is Decimal
                  Value = +0000800.00
                  Column 14:
            Fixed offset: 60
                  Type is Decimal
                  Value = +0003300.00

            ...

            Slot 45:
               Offset Location = 3264  (xCC0)
               Record Length = 83  (x53)
               Record Type = Table Data Record (FIXEDVAR)
               Record Flags = 0
               Fixed part length value = 66

                  Column 1:
            Fixed offset: 0
                  Type is Fixed Length Character String
                      32303033 3430                          200340         
                  Column 2:
            Fixed offset: 6
                  Type is Variable Length Character String
                  Length = 3 ffset = 66
                      524F59                                 ROY            
                  Column 3:
            Fixed offset: 10
                  Type is Fixed Length Character String
                      52                                     R              
                  Column 4:
            Fixed offset: 12
                  Type is Variable Length Character String
                  Length = 6 ffset = 69
                      414C4F4E 5A4F                          ALONZO         
                  Column 5:
            Fixed offset: 16
                  Type is Fixed Length Character String
                      453231                                 E21            
                  Column 6:
            Fixed offset: 20
                  Type is Fixed Length Character String
                      35363938                               5698           
                  Column 7:
            Fixed offset: 25
                  Type is Gregorian Date
                  Value = 07/05/1997
                  Column 8:
            Fixed offset: 30
                  Type is Fixed Length Character String
                      4649454C 44524550                      FIELDREP       
                  Column 9:
            Fixed offset: 39
                  Type is Small Integer
                  Value = 16
                  Column 10:
            Fixed offset: 41
                  Type is Fixed Length Character String
                      4D                                     M              
                  Column 11:
            Fixed offset: 43
                  Type is Gregorian Date
                  Value = 05/17/1956
                  Column 12:
            Fixed offset: 48
                  Type is Decimal
                  Value = +0031840.00
                  Column 13:
            Fixed offset: 54
                  Type is Decimal
                  Value = +0000500.00
                  Column 14:
            Fixed offset: 60
                  Type is Decimal
                  Value = +0001907.00

         Slots Summary:  Total=46,  In-use=46,  Deleted=0.
   Table object report phase end.
--------------------------------------------------------------------------

3,匯出十六進位制資料塊,/DD /v h選項
*匯出命令
db2dart sample /dd /tsi 2 /oi 6 /ps 0 /np 100 /v h

*匯出結果
--------------------------------------------------------------------------
Action option: DD
Table-object-ID: 6; Tablespace-ID: 2; First-page: 0; Number-pages: 100; Verbose: h
   Table object report phase start.
   Dump format is hex (consistency bits are untouched).
                           ______________________________________

         Page 0 of object 6 from table space 2.

        0000  *3000D01F 00000000 0005000A 02000000*     *0...............*  "3000"->"0030",為偏移量48
        0010  *40070000 06000000 00000000 60000000*     *................*
        0020  *28ABB605 00000000 8C010000 00000000*     *................*
        0030  *2E00640C 00000000 5C00BF0C 00000000*     *..d.............*
        0040  *00000000 9C1FB01B 641BEC1A 951A3C1A*     *........d.......* "9C1F"->"1F9C,slot0 offset,"B01B"->"1BB0,slot1 offset
        0050  *E9199619 4119ED18 94183B18 E0178917*     *....A...........*
        0060  *3017D716 81162816 CC157315 1E15CA14*     *0.........s.....*
        0070  *74141E14 C6136D13 1813C212 6E121612*     *t.....m.....n...*
        0080  *C2116D11 1611C110 70101B10 C40F6F0F*     *..m.....p.....o.*
        0090  *1E0FC50E 730E190E C10D670D 130DC00C*     *....s.....g.....*
        00A0  *00000000 00000000 00000000 00000000*     *................*
        00B0  *00000000 00000000 00000000 00000000*     *................*
        00C0  *00000000 00000000 00000000 00000000*     *................*
        00D0  *00000000 00000000 00000000 00000000*     *................*
        00E0  *00000000 00000000 00000000 00000000*     *................*
        00F0  *00000000 00000000 00000000 00000000*     *................*
        ...刪除190行
        0CE0  *00000000 00000000 00000000 00000000*     *................*
        0CF0  *00000000 00000000 00000000 00000000*     *................*
        0D00  *00000000 00005300 01004200 32303033*     *......S...B.2003*
        0D10  *34304200 03005200 45000600 45323100*     *40B...R.E...E21.*
        0D20  *35363938 00199707 05004649 454C4452*     *5698......FIELDR*
        0D30  *45500010 004D0019 56051700 00318400*     *EP...M..V....1..*
        0D40  *0C000000 50000C00 00019070 0C00524F*     *....P......p..RO*
        0D50  *59414C4F 4E5A4F00 00540001 00420032*     *YALONZO..T...B.2*
        0D60  *30303333 30420006 00200048 00040045*     *00330B.....H...E*
        0D70  *32310032 31303300 20060223 00464945*     *21.2103......FIE*
        0D80  *4C445245 50000E00 46001971 07180000*     *LDREP...F..q....*
        0D90  *3537000C 00000050 000C0000 0203000C*     *57.....P........*
        0DA0  *0048454C 454E4157 4F4E4700 005A0001*     *.HELENAWONG..Z..*
        0DB0  *00420032 30303331 30420008 0046004A*     *.B.200310B...F.J*
        0DC0  *00080045 31310033 33333200 19940912*     *...E11.3332.....*
        0DD0  *004F5045 5241544F 52000C00 46001961*     *.OPERATOR...F..a*
        0DE0  *04210000 3590000C 00000030 000C0000*     *....5......0....*
        0DF0  *0127200C 004D4943 48454C4C 45535052*     *.....MICHELLESPR*
        0E00  *494E4745 52000058 00010042 00323030*     *INGER..X...B.200*
        0E10  *32383042 00060052 00480008 00453131*     *280B...R.H...E11*
        0E20  *00383939 37001997 0324004F 50455241*     *.8997......OPERA*
        0E30  *544F5200 11004600 19660328 00004625*     *TOR...F..f....F.*
        0E40  *000C0000 0050000C 00000210 000C0045*     *.....P.........E*
        0E50  *494C4545 4E534348 57415254 5A00005A*     *ILEENSCHWARTZ..Z*
        0E60  *00010042 00323030 32343042 0006004D*     *...B.200240B...M*
        0E70  *0048000A 00443231 00333738 30002004*     *.H...D21.3780...*
        0E80  *12050043 4C45524B 20202000 11004D00*     *...CLERK......M.*
        0E90  *19840331 00003776 000C0000 0060000C*     *...1..7v........*
        0EA0  *00000230 100C0052 4F424552 544D4F4E*     *...0...ROBERTMON*
        0EB0  *54455645 52444500 00520001 00420032*     *TEVERDE..R...B.2*
        0EC0  *30303232 30420004 004B0046 00040044*     *00220B...K.F...D*
        0ED0  *31310030 36373200 20050829 00444553*     *11.0672......DES*
        0EE0  *49474E45 52001200 46001978 03190000*     *IGNER...F..x....*
        0EF0  *6984000C 00000060 000C0000 0238700C*     *i............8p.*
        0F00  *00524542 414A4F48 4E000059 00010042*     *.REBAJOHN..Y...B*
        0F10  *00323030 31373042 00070020 00490008*     *.200170B.....I..*
        0F20  *00443131 00323839 30002005 09150044*     *.D11.2890......D*
        0F30  *45534947 4E455200 10004D00 19810105*     *ESIGNER...M.....*
        0F40  *00006468 000C0000 0050000C 00000197*     *..dh.....P......*
        0F50  *400C004B 49594F53 48495941 4D414D4F*     *...KIYOSHIYAMAMO*
        0F60  *544F0000 51000100 42003230 30313430*     *TO..Q...B.200140*
        0F70  *42000300 4E004500 04004330 31003137*     *B...N.E...C01.17*
        0F80  *39330020 06121500 414E414C 59535420*     *93......ANALYST.*
        0F90  *00120046 00197601 19000068 42000C00*     *...F..v....hB...*
        0FA0  *00006000 0C000002 27400C00 4B494D4E*     *............KIMN*
        0FB0  *41545A00 00550001 00420032 30303132*     *ATZ..U...B.20012*
        0FC0  *30420004 00200046 00070041 30300032*     *0B.....F...A00.2*
        0FD0  *31363700 20020505 00434C45 524B2020*     *167......CLERK..*
        0FE0  *20000E00 4D001972 10180000 3925000C*     *....M..r....9...*
        0FF0  *00000060 000C0000 0234000C 00475245*     *.........4...GRE*
        1000  *474F524C 414E444F 00005700 01004200*     *GORLANDO..W...B.*
        1010  *32303030 31304200 04004A00 46000900*     *200010B...J.F...*
        1020  *41303000 33393738 00199501 01005341*     *A00.3978......SA*
        1030  *4C455352 45500012 00460019 73081400*     *LESREP...F..s...*
        1040  *00465000 0C000001 00000C00 00042200*     *.FP.............*
        1050  *0C004449 414E4845 4D4D494E 47455200*     *..DIANHEMMINGER.*
        1060  *00550001 00420030 30303334 30420005*     *.U...B.000340B..*
        1070  *00520047 00060045 32310035 36393800*     *.R.G...E21.5698.*
        1080  *19770505 00464945 4C445245 50001000*     *.w...FIELDREP...*
        1090  *4D001956 05170000 4384000C 00000050*     *M..V....C......P*
        10A0  *000C0000 0190700C 004A4153 4F4E474F*     *......p..JASONGO*
        10B0  *554E4F54 00005100 01004200 30303033*     *UNOT..Q...B.0003*
        10C0  *33304200 04002000 46000300 45323100*     *30B.....F...E21.*
        10D0  *32313033 00200602 23004649 454C4452*     *2103......FIELDR*
        10E0  *4550000E 004D0019 71071800 00453700*     *EP...M..q....E7.*
        10F0  *0C000000 50000C00 00020300 0C005749*     *....P.........WI*
        1100  *4E474C45 45000055 00010042 00303030*     *NGLEE..U...B.000*
        1110  *33323042 00060056 00480005 00453231*     *320B...V.H...E21*
        1120  *00393939 30001995 07070046 49454C44*     *.9990......FIELD*
        1130  *52455000 10004D00 19620811 00003995*     *REP...M..b....9.*
        1140  *000C0000 0040000C 00000159 600C0052*     *...........Y...R*
        1150  *414D4C41 4C4D4548 54410000 57000100*     *AMLALMEHTA..W...*
        1160  *42003030 30333130 42000500 46004700*     *B.000310B...F.G.*
        1170  *08004531 31003333 33320019 94091200*     *..E11.3332......*
        1180  *4F504552 41544F52 000C0046 00196104*     *OPERATOR...F..a.*
        1190  *21000035 90000C00 00003000 0C000001*     *...5......0.....*
        11A0  *27200C00 4D415544 45534554 52494748*     *....MAUDESETRIGH*
        11B0  *54000055 00010042 00303030 33303042*     *T..U...B.000300B*
        11C0  *00060058 00480005 00453131 00323039*     *...X.H...E11.209*
        11D0  *35002002 0619004F 50455241 544F5200*     *5......OPERATOR.*
        11E0  *0E004D00 19761027 00003775 000C0000*     *..M..v....7u....*
        11F0  *0040000C 00000142 000C0050 48494C49*     *.......B...PHILI*
        1200  *50534D49 54480000 54000100 42003030*     *PSMITH..T...B.00*
        1210  *30323930 42000400 52004600 06004531*     *0290B...R.F...E1*
        1220  *31003435 30320020 06053000 4F504552*     *1.4502....0.OPER*
        1230  *41544F52 000C004D 00198507 09000035*     *ATOR...M.......5*
        1240  *34000C00 00003000 0C000001 22700C00*     *4.....0......p..*
        1250  *4A4F484E 5041524B 45520000 58000100*     *JOHNPARKER..X...*
        1260  *42003030 30323830 42000500 52004700*     *B.000280B...R.G.*
        1270  *09004531 31003839 39370019 97032400*     *..E11.8997......*
        1280  *4F504552 41544F52 00110046 00197603*     *OPERATOR...F..v.*
        1290  *28000036 25000C00 00005000 0C000002*     *...6......P.....*
        12A0  *10000C00 45544845 4C534348 4E454944*     *....ETHELSCHNEID*
        12B0  *45520000 54000100 42003030 30323730*     *ER..T...B.000270*
        12C0  *42000500 4C004700 05004432 31003930*     *B...L.G...D21.90*
        12D0  *30310020 06093000 434C4552 4B202020*     *01....0.CLERK...*
        12E0  *000F0046 00200305 26000037 38000C00*     *...F.......78...*
        12F0  *00005000 0C000002 19000C00 4D415249*     *..P.........MARI*
        1300  *41504552 455A0000 56000100 42003030*     *APEREZ..V...B.00*
        1310  *30323630 42000500 50004700 07004432*     *0260B...P.G...D2*
        1320  *31003839 35330020 05091100 434C4552*     *1.8953......CLER*
        1330  *4B202020 00100046 00197610 05000047*     *K......F..v....G*
        1340  *25000C00 00003000 0C000001 38000C00*     *......0.....8...*
        1350  *53594249 4C4A4F48 4E534F4E 00005500*     *SYBILJOHNSON..U.*
        1360  *01004200 30303032 35304200 06005300*     *..B.000250B...S.*
        1370  *48000500 44323100 30393631 00199910*     *H...D21.0961....*
        1380  *3000434C 45524B20 2020000F 004D0019*     *0.CLERK......M..*
        1390  *69111200 00491800 0C000000 40000C00*     *i....I..........*
        13A0  *00015340 0C004441 4E49454C 534D4954*     *..S...DANIELSMIT*
        13B0  *48000059 00010042 00303030 32343042*     *H..Y...B.000240B*
        13C0  *0009004D 004B0006 00443231 00333738*     *...M.K...D21.378*
        13D0  *30002004 12050043 4C45524B 20202000*     *0......CLERK....*
        13E0  *11004D00 20020331 00004876 000C0000*     *..M....1..Hv....*
        13F0  *0060000C 00000230 100C0053 414C5641*     *.......0...SALVA*
        1400  *544F5245 4D415249 4E4F0000 58000100*     *TOREMARINO..X...*
        1410  *42003030 30323330 42000500 4A004700*     *B.000230B...J.G.*
        1420  *09004432 31003230 39340019 96112100*     *..D21.2094......*
        1430  *434C4552 4B202020 000E004D 00198005*     *CLERK......M....*
        1440  *30000042 18000C00 00004000 0C000001*     *0..B............*
        1450  *77400C00 4A414D45 534A4546 46455253*     *w...JAMESJEFFERS*
        1460  *4F4E0000 56000100 42003030 30323230*     *ON..V...B.000220*
        1470  *42000800 4B004A00 04004431 31003036*     *B...K.J...D11.06*
        1480  *37320019 98082900 44455349 474E4552*     *72......DESIGNER*
        1490  *00120046 00197803 19000049 84000C00*     *...F..x....I....*
        14A0  *00006000 0C000002 38700C00 4A454E4E*     *........8p..JENN*
        14B0  *49464552 4C55545A 00005600 01004200*     *IFERLUTZ..V...B.*
        14C0  *30303032 31304200 07005400 49000500*     *000210B...T.I...*
        14D0  *44313100 30393432 00199804 11004445*     *D11.0942......DE*
        14E0  *5349474E 45520011 004D0020 03022300*     *SIGNER...M......*
        14F0  *00682700 0C000000 40000C00 00014620*     *.h............F.*
        1500  *0C005749 4C4C4941 4D4A4F4E 45530000*     *..WILLIAMJONES..*
        1510  *54000100 42003030 30323030 42000500*     *T...B.000200B...*
        1520  *20004700 05004431 31003435 30310020*     *..G...D11.4501..*
        1530  *02030300 44455349 474E4552 0010004D*     *....DESIGNER...M*
        1540  *00197105 29000057 74000C00 00006000*     *..q....Wt.......*
        1550  *0C000002 21700C00 44415649 4442524F*     *.....p..DAVIDBRO*
        1560  *574E0000 55000100 42003030 30313930*     *WN..U...B.000190*
        1570  *42000500 48004700 06004431 31003239*     *B...H.G...D11.29*
        1580  *38360020 04072600 44455349 474E4552*     *86......DESIGNER*
        1590  *0010004D 00198206 25000050 45000C00*     *...M.......PE...*
        15A0  *00004000 0C000001 63600C00 4A414D45*     *........c...JAME*
        15B0  *5357414C 4B455200 00590001 00420030*     *SWALKER..Y...B.0*
        15C0  *30303138 30420007 00530049 00080044*     *00180B...S.I...D*
        15D0  *31310031 36383200 20030707 00444553*     *11.1682......DES*
        15E0  *49474E45 52001100 46001979 02210000*     *IGNER...F..y....*
        15F0  *5134000C 00000050 000C0000 0170700C*     *Q4.....P.....pp.*
        1600  *004D4152 494C594E 53434F55 5454454E*     *.MARILYNSCOUTTEN*
        1610  *00005C00 01004200 30303031 37304200*     *......B.000170B.*
        1620  *09004A00 4B000900 44313100 32383930*     *..J.K...D11.2890*
        1630  *00199909 15004445 5349474E 45520010*     *......DESIGNER..*
        1640  *004D0019 81010500 00446800 0C000000*     *.M.......Dh.....*
        1650  *50000C00 00019740 0C004D41 5341544F*     *P.........MASATO*
        1660  *53484959 4F534849 4D555241 00005900*     *SHIYOSHIMURA..Y.*
        1670  *01004200 30303031 36304200 09005200*     *..B.000160B...R.*
        1680  *4B000600 44313100 33373832 00200610*     *K...D11.3782....*
        1690  *11004445 5349474E 45520011 00460019*     *..DESIGNER...F..*
        16A0  *80041200 00622500 0C000000 40000C00*     *.....b..........*
        16B0  *00017800 0C00454C 495A4142 45544850*     *..x...ELIZABETHP*
        16C0  *49414E4B 41000056 00010042 00303030*     *IANKA..V...B.000*
        16D0  *31353042 00050020 00470007 00443131*     *150B.....G...D11*
        16E0  *00343531 30002002 02120044 45534947*     *.4510......DESIG*
        16F0  *4E455200 10004D00 19770517 00005528*     *NER...M..w....U.*
        1700  *000C0000 0050000C 00000202 200C0042*     *.....P.........B*
        1710  *52554345 4144414D 534F4E00 00590001*     *RUCEADAMSON..Y..*
        1720  *00420030 30303134 30420007 00410049*     *.B.000140B...A.I*
        1730  *00080043 30310031 37393300 20061215*     *...C01.1793.....*
        1740  *00414E41 4C595354 20001200 46001976*     *.ANALYST....F..v*
        1750  *01190000 6842000C 00000060 000C0000*     *....hB..........*
        1760  *0227400C 00484541 54484552 4E494348*     *.....HEATHERNICH*
        1770  *4F4C4C53 00005900 01004200 30303031*     *OLLS..Y...B.0001*
        1780  *33304200 07004D00 49000800 43303100*     *30B...M.I...C01.*
        1790  *34353738 00200107 2800414E 414C5953*     *4578......ANALYS*
        17A0  *54200010 00460019 55091500 00738000*     *T....F..U....s..*
        17B0  *0C000000 50000C00 00019040 0C004445*     *....P.........DE*
        17C0  *4C4F5245 53515549 4E54414E 41000057*     *LORESQUINTANA..W*
        17D0  *00010042 00303030 31323042 00040020*     *...B.000120B....*
        17E0  *00460009 00413030 00323136 37001993*     *.F...A00.2167...*
        17F0  *12050043 4C45524B 20202000 0E004D00*     *...CLERK......M.*
        1800  *19721018 00004925 000C0000 0060000C*     *.r....I.........*
        1810  *00000234 000C0053 45414E4F 27434F4E*     *...4...SEANO.CON*
        1820  *4E454C4C 00005B00 01004200 30303031*     *NELL......B.0001*
        1830  *31304200 08004700 4A000900 41303000*     *10B...G.J...A00.*
        1840  *33343930 00198805 16005341 4C455352*     *3490......SALESR*
        1850  *45500013 004D0019 59110500 00665000*     *EP...M..Y....fP.*
        1860  *0C000000 90000C00 00037200 0C005649*     *..........r...VI*
        1870  *4E43454E 5A4F4C55 43434845 53534900*     *NCENZOLUCCHESSI.*
        1880  *00590001 00420030 30303130 30420008*     *.Y...B.000100B..*
        1890  *0051004A 00070045 32310030 39373200*     *.Q.J...E21.0972.*
        18A0  *20000619 004D414E 41474552 20000E00*     *.....MANAGER....*
        18B0  *4D001980 12180000 8615000C 00000050*     *M..............P*
        18C0  *000C0000 0209200C 00544845 4F444F52*     *.........THEODOR*
        18D0  *45535045 4E534552 00005900 01004200*     *ESPENSER..Y...B.*
        18E0  *30303030 39304200 06005700 48000900*     *000090B...W.H...*
        18F0  *45313100 35343938 00200008 15004D41*     *E11.5498......MA*
        1900  *4E414745 52200010 00460019 71051500*     *NAGER....F..q...*
        1910  *00897500 0C000000 60000C00 00023800*     *..u...........8.*
        1920  *0C004549 4C45454E 48454E44 4552534F*     *..EILEENHENDERSO*
        1930  *4E000054 00010042 00303030 30373042*     *N..T...B.000070B*
        1940  *00030044 00450007 00443231 00373833*     *...D.E...D21.783*
        1950  *31002005 0930004D 414E4147 45522000*     *1....0.MANAGER..*
        1960  *10004600 20030526 00009617 000C0000*     *..F.............*
        1970  *0070000C 00000289 300C0045 56415055*     *.p......0..EVAPU*
        1980  *4C41534B 49000055 00010042 00303030*     *LASKI..U...B.000*
        1990  *30363042 00060046 00480005 00443131*     *060B...F.H...D11*
        19A0  *00363432 33002003 0914004D 414E4147*     *.6423......MANAG*
        19B0  *45522000 10004D00 19750707 00007225*     *ER....M..u....r.*
        19C0  *000C0000 0050000C 00000258 000C0049*     *.....P.....X...I*
        19D0  *5256494E 47535445 524E0000 53000100*     *RVINGSTERN..S...*
        19E0  *42003030 30303530 42000400 42004600*     *B.000050B...B.F.*
        19F0  *05004530 31003637 38390019 79081700*     *..E01.6789..y...*
        1A00  *4D414E41 47455220 0010004D 00195509*     *MANAGER....M..U.*
        1A10  *15000080 17500C00 00008000 0C000003*     *.....P..........*
        1A20  *21400C00 4A4F484E 47455945 52000053*     *....JOHNGEYER..S*
        1A30  *00010042 00303030 30333042 00050041*     *...B.000030B...A*
        1A40  *00470004 00433031 00343733 38002005*     *.G...C01.4738...*
        1A50  *0405004D 414E4147 45522000 14004600*     *...MANAGER....F.*
        1A60  *19710511 00009825 000C0000 0080000C*     *.q..............*
        1A70  *00000306 000C0053 414C4C59 4B57414E*     *.......SALLYKWAN*
        1A80  *00005900 01004200 30303030 32304200*     *..Y...B.000020B.*
        1A90  *07004C00 49000800 42303100 33343736*     *..L.I...B01.3476*
        1AA0  *00200310 10004D41 4E414745 52200012*     *......MANAGER...*
        1AB0  *004D0019 78020200 00942500 0C000000*     *.M..x...........*
        1AC0  *80000C00 00033000 0C004D49 43484145*     *......0...MICHAE*
        1AD0  *4C54484F 4D50534F 4E000057 00010042*     *LTHOMPSON..W...B*  --&gtslot4 offset + x44 = "1AD9"
        1AE0  *00303030 30313042 00090049 004B0004*     *.000010B...I.K..*
        1AF0  *00413030 00333937 38001995 01010050*     *.A00.3978......P*
        1B00  *52455320 20202000 12004600 19630824*     *RES.......F..c..*
        1B10  *00015275 000C0000 0100000C 00000422*     *..Ru............*
        1B20  *000C0043 48524953 54494E45 48414153*     *...CHRISTINEHAAS* --&gt變長型別存放在記錄末尾
        1B30  *00007800 00000E00 00010600 02000000*     *..x.............*
        1B40  *01010C00 02000600 00010100 01000A00*     *................*
        1B50  *01010F00 02000C00 00010300 01001000*     *................*
        1B60  *00010400 01001400 05010400 01001900*     *................*
        1B70  *00010800 01001E00 00000200 02002700*     *................*
        1B80  *00010100 01002900 05010400 01002B00*     *................*
        1B90  *02000902 01003000 02000902 01003600*     *......0.......6.*
        1BA0  *02000902 01003C00 10004C00 00000201*     *..........L.....*
        1BB0  *01000000 00020006 01000000 00000000*     *................*
        1BC0  *00000000 00000000 00000000 00000000*     *................*
        1BD0  *00000000 00000000 00000000 00000000*     *................*
        1BE0  *00000000 00000000 00000000 00000000*     *................*
        1BF0  *00000000 0100EC03 640CBC1F BC1FBC1F*     *........d.......* --&gt640C(to_number0C64=3172)對應page0的Total Free Space
        1C00  *BC1FBC1F BC1FBC1F BC1FBC1F BC1FBC1F*     *................*
        ...刪除60行
        1FD0  *BC1FBC1F BC1FBC1F BC1FBC1F BC1FBC1F*     *................*
        1FE0  *01002000 01000000 B8A4B605 00000000*     *................*
        1FF0  *00000000 00000000 00000000 00000000*     *................*
   Table object report phase end.
--------------------------------------------------------------------------

4,匯出十六進位制資料塊,/DP /v y選項
*匯出命令
db2dart sample /dp /tsi 2 /oi 6 /ps 1856 /np 1 /v y
*匯出結果
輸出與3相同。

5,匯出格式化索引塊,/DI /v y選項
*該表上共有2個索引
db2 => select indname,index_objectid,tbspaceid from syscat.indexes where tabname
='EMPLOYEE'
INDNAME          INDEX_OBJECTID TBSPACEID
PK_EMPLOYEE                 6           2
XEMP2                       6           2

*每個索引對應的列
db2 => select indname,colname,colseq from syscat.indexcoluse where indname='PK_E
MPLOYEE' order by colseq
INDNAME       COLNAME     COLSEQ
PK_EMPLOYEE     EMPNO          1

db2 => select indname,colname,colseq from syscat.indexcoluse where indname='XEMP2' order by colseq
INDNAME       COLNAME     COLSEQ
XEMP2        WORKDEPT          1

*表資料,rid
db2 => select EMPNO,WORKDEPT,RID(E) from EMPLOYEE E ORDER BY WORKDEPT
EMPNO  WORKDEPT 3
000010 A00                         4
000110 A00                        12
000120 A00                        13
200010 A00                        36
200120 A00                        37
000020 B01                         5
000030 C01                         6
000130 C01                        14
000140 C01                        15
200140 C01                        38
000060 D11                         8
000150 D11                        16
000160 D11                        17
000170 D11                        18
000180 D11                        19
000190 D11                        20
000200 D11                        21
000210 D11                        22
000220 D11                        23
200170 D11                        39
200220 D11                        40
000070 D21                         9
000230 D21                        24
000240 D21                        25
000250 D21                        26
000260 D21                        27
000270 D21                        28
200240 D21                        41
000050 E01                         7
000090 E11                        10
000280 E11                        29
000290 E11                        30
000300 E11                        31
000310 E11                        32
200280 E11                        42
200310 E11                        43
000100 E21                        11
000320 E21                        33
000330 E21                        34
000340 E21                        35
200330 E21                        44
200340 E21                        45
  42 條記錄已選擇。

*匯出命令
db2dart sample /di /tsi 2 /oi 6 /ps 0 /np 100 /v y

*匯出結果
--------------------------------------------------------------------------
Action option: DI
Table-object-ID: 6; Tablespace-ID: 2; First-page: 0; Number-pages: 100; Verbose: y
   Index object report phase start.
   Dump format is verbose.
                           ______________________________________
      Index Object page: 0
      BPS pool page    : 384     ---&gt對應"db2dart sample /demp /tsi 2 /oi 6" Pool relative page #'s 384
      BPS object page  : 0

         BPS Page Header:
                  Page Data ffset = 48
                  Page Data Length = 8144
                          Page LSN = 0000000005B6AA54
                       Page Number = 0
                         Object ID = 6
                       Object Type = Index Object
     
         Free Page Map:
                         Page Type = x01000210
                        pg0FileLSN = 00000000054630F5
                            nextSMP= 0 flags=x0
              Allocated Page Count = 5
                   Used Page Count = 5
                Pending Page Count = 0
                Pseudo Empty Count = 0
               Pending Empty Count = 0
            Restricted Reuse Count = 0
                  PseudoInsert LSN = 0000000000000000
                   Newest Pend LSN = 0000000000000000 => n/a

                                  Legend:  U => Used Page
      Page                           P => Page Pending Deletion
      Number                         E => Page Pseudo Empty
      Number                         e => Page Pending Pseudo Empty
      Page                           R => Restricted Unused Page
                                     . => Unused Page
      00001    UUUUU                                                
                           ______________________________________

      Index Object page: 1
      BPS pool page    : 385
      BPS object page  : 1

         BPS Page Header:
                  Page Data ffset = 48
                  Page Data Length = 8144
                          Page LSN = 0000000005B6AA54
                       Page Number = 1
                         Object ID = 6
                       Object Type = Index Object

  Index Node Header:
                     Header Type = 0
                   Index Root Page = 1
                         Node Type = Root/Leaf Node
                        Page State = x(0100020D)
                        Tree Level = 1
                     Previous Node = Start of Chain
                         Next Node = End of Chain
                  Total Free Space = 6744
                Maximum Free Space = 6766
                 Free Space ffset = 1448
                    Reserved Space = 0
                        Slot count = 615
     
         Index Root Vector:
                  Minimum Key Size = 11
                        Key Length = 4
                      Info Page ID = Does not exist
                 Leaf Percent Free = 0
                     Root Life LSN = 0000000005B6AA54

            Index Definition:
            Index Type = Unique Bi-directional
            Collation ID in hex = x00000002FF00FFFF
            Collation name = IDENTITY
            # of Key Parts = 2 (uniq:2)

            Key Part 1: (dms field id=65535)
                Ascending Order
                Codepage = 0
                SMALLINT
                Length = 2
                Prohibits Nulls
            Key Part 2: (dms field id=65535)
                Ascending Order
                Codepage = 0
                SMALLINT
                Length = 2
                Prohibits Nulls
     
         Collated Key Directory:
        Number of Prefixes in Node = 0
            Number of Keys in Node = 2
              Dummy Hi Key Present = No
                     Vector length = 1242
                         # of Rids = 2
                 # of Deleted Rids = 0
                        # of slots = 615
                     Usable bytes =  6766, from 1426 to 8192

         Index Key Records:
         Key 0:
            Offset Location = 1426  (x592)
            Record Length   = 11  (xB)
            Key Part 1:
                Small Integer
                Value = 0
                Hex Format =       0000                                                  
            Key Part 2:
                Small Integer
                Value = 1
                Hex Format =       0100                                                  
            Table RID: x(0000 0002) r(000000;02) d(0;2) ridFlags=x0

         Key 1:
            Offset Location = 1437  (x59D)
            Record Length   = 11  (xB)
            Key Part 1:
                Small Integer
                Value = 0
                Hex Format =       0000                                                  
            Key Part 2:
                Small Integer
                Value = 2
                Hex Format =       0200                                                  
            Table RID: x(0000 0004) r(000000;04) d(0;4) ridFlags=x0

      Total Record bytes on this page = 22
                           ______________________________________

      Index Object page: 2
      BPS pool page    : 386
      BPS object page  : 2

         BPS Page Header:
                  Page Data ffset = 48
                  Page Data Length = 8144
                          Page LSN = 0000000005B6AA54
                       Page Number = 2
                         Object ID = 6
                       Object Type = Index Object
     
         Index Node Header:
                     Header Type = 0
                   Index Root Page = 2  --&gt該索引root page,包含Index Root Vector,索引定義
                         Node Type = Root/Leaf Node / Large RID
                        Page State = x(4100020D)
                        Tree Level = 1
                     Previous Node = Start of Chain
                         Next Node = End of Chain
                  Total Free Space = 6436
                Maximum Free Space = 7066
                 Free Space ffset = 1756
                    Reserved Space = 0
                        Slot count = 471      --&gtslot個數
     
         Index Root Vector:
                  Minimum Key Size = 15
                        Key Length = 6
                      Info Page ID = Page 3   --&gtpage 3
                 Leaf Percent Free = 10
                     Root Life LSN = 0000000005B6AA54

            Index Definition:
            Index Type = Unique Bi-directional Large RID  --&gtunique
            Collation ID in hex = x00000002FF00FFFF
            Collation name = IDENTITY
            # of Key Parts = 1 (uniq:1)

            Key Part 1: (dms field id=0)    --&gt對應syscat.columns.colno
                Ascending Order
                Codepage = 1208
                CHAR
                Length = 6                  --&gt定長6
                Prohibits Nulls
     
         Collated Key Directory:
        Number of Prefixes in Node = 0
            Number of Keys in Node = 42
              Dummy Hi Key Present = No
                     Vector length = 954
                         # of Rids = 42   --&gtrid個數
                 # of Deleted Rids = 0
                        # of slots = 471
                     Usable bytes =  7066, from 1126 to 8192

         Index Key Records:
   Key 0:
            Offset Location = 1126  (x466)
            Record Length   = 15  (xF)
            Key Part 1:
                Fixed Length Character String
          30303030 3130                          000010         
      Table RID: x(0000 0000 0004) r(00000000;0004) d(0;4) ridFlags=x0 ---&gt4對應該頁的slot#

   Key 1:
      Offset Location = 1141  (x475)
      Record Length   = 15  (xF)
      Key Part 1:
          Fixed Length Character String
          30303030 3230                          000020         
      Table RID: x(0000 0000 0005) r(00000000;0005) d(0;5) ridFlags=x0

   ...

   Key 41:
      Offset Location = 1741  (x6CD)
      Record Length   = 15  (xF)
      Key Part 1:
          Fixed Length Character String
          32303033 3430                          200340         
      Table RID: x(0000 0000 002D) r(00000000;002D) d(0;45) ridFlags=x0

Total Record bytes on this page = 630
                           ______________________________________
      Index Object page: 3
      BPS pool page    : 387
      BPS object page  : 3

         BPS Page Header:
                  Page Data ffset = 48
                  Page Data Length = 8144
                          Page LSN = 0000000005B6AA54
                       Page Number = 3
                         Object ID = 6
                       Object Type = Index Object
     
         Index Node Header:
                       Header Type = 0
                   Index Root Page = 2      --&gt該索引root page,包含Index Root Vector,索引定義
                         Node Type = Last Leaf Node / Large RID / Info Page
                        Page State = x(4100030C)
                        Tree Level = 1
                     Previous Node = Start of Chain    --&gt pointer to previous node
                         Next Node = End of Chain      --&gt pointer to next node
                  Total Free Space = 7195
                Maximum Free Space = 7244
                 Free Space ffset = 997
                    Reserved Space = 0
                        Slot count = 426
     
         Collated Key Directory:
        Number of Prefixes in Node = 0
            Number of Keys in Node = 1
              Dummy Hi Key Present = No
                     Vector length = 864
                         # of Rids = 1
                 # of Deleted Rids = 0
                        # of slots = 426
                     Usable bytes =  7244, from 948 to 8192

         Index Key Records:
         Key 0:
            Offset Location = 948  (x3B4)
            Record Length   = 49  (x31)
            Key Part 1:
                Small Integer
                Value = 1
                Hex Format =       0100                                                  
                Index statistics
            Key Part 2:
                Small Integer
                Value = 0
                Hex Format =       0000                                                  
            Key Part 3:
                Small Integer
                Value = 0
                Hex Format =       0000                                                  
            Key Part 4:
                Variable Length Character String
                Actual Length = 32
                      2A000000 00000000 01000000 FFFFFFFF    *...............
                FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF    ................

                Full key card plus del = 42
                Number of leaf pages   = 1
            Table RID: x(0001 0000 0000) r(00010000;0000) d(65536;0) ridFlags=x0
      Total Record bytes on this page = 49
                           ______________________________________
      Index Object page: 4
      BPS pool page    : 388
      BPS object page  : 4

         BPS Page Header:
                  Page Data ffset = 48
                  Page Data Length = 8144
                          Page LSN = 0000000005B6AA54
                       Page Number = 4
                         Object ID = 6
                       Object Type = Index Object
     
         Index Node Header:
                     Header Type = 0
                   Index Root Page = 4   --&gt該索引root page,包含Index Root Vector,索引定義
                         Node Type = Root/Leaf Node / Large RID
                        Page State = x(4100020D)
                        Tree Level = 1
                     Previous Node = Start of Chain
                         Next Node = End of Chain
                  Total Free Space = 6598
                Maximum Free Space = 6940
                 Free Space ffset = 1594
                    Reserved Space = 0
                        Slot count = 534  --&gtslot個數

  Index Root Vector:
                  Minimum Key Size = 13
                        Key Length = 4
                      Info Page ID = Page 5   --&gtpage 5
                 Leaf Percent Free = 10
                     Root Life LSN = 0000000005B6AA54

            Index Definition:
            Index Type = NonUnique Bi-directional Large RID
            Collation ID in hex = x00000002FF00FFFF
            Collation name = IDENTITY
            # of Key Parts = 1 (uniq:1)
            Key Part 1: (dms field id=4)  --&gt對應syscat.columns.colno
                Ascending Order
                Codepage = 1208
                CHAR
                Length = 3                --&gt定長3
                Allows Nulls
     
         Collated Key Directory:
        Number of Prefixes in Node = 0
            Number of Keys in Node = 8    --&gtnode個數
              Dummy Hi Key Present = No
                     Vector length = 1080
                         # of Rids = 42   --&gtrid個數
                 # of Deleted Rids = 0
                        # of slots = 534
                     Usable bytes =  6940, from 1252 to 8192

         Index Key Records:
   Key 0:
            Offset Location = 1252  (x4E4)
            Record Length   = 41  (x29)
            Key Part 1:
                Fixed Length Character String
          413030                                 A00            
      Table RID: x(0000 0000 0004) r(00000000;0004) d(0;4) ridFlags=x0
      Table RID: x(0000 0000 000C) r(00000000;000C) d(0;12) ridFlags=x0
      Table RID: x(0000 0000 000D) r(00000000;000D) d(0;13) ridFlags=x0
      Table RID: x(0000 0000 0024) r(00000000;0024) d(0;36) ridFlags=x0
      Table RID: x(0000 0000 0025) r(00000000;0025) d(0;37) ridFlags=x0

   Key 1:
      Offset Location = 1293  (x50D)
      Record Length   = 13  (xD)
      Key Part 1:
          Fixed Length Character String
          423031                                 B01            
      Table RID: x(0000 0000 0005) r(00000000;0005) d(0;5) ridFlags=x0

   Key 2:
      Offset Location = 1306  (x51A)
      Record Length   = 34  (x22)
      Key Part 1:
          Fixed Length Character String
          433031                                 C01            
      Table RID: x(0000 0000 0006) r(00000000;0006) d(0;6) ridFlags=x0
      Table RID: x(0000 0000 000E) r(00000000;000E) d(0;14) ridFlags=x0
      Table RID: x(0000 0000 000F) r(00000000;000F) d(0;15) ridFlags=x0
      Table RID: x(0000 0000 0026) r(00000000;0026) d(0;38) ridFlags=x0

   Key 3:
      Offset Location = 1340  (x53C)
      Record Length   = 83  (x53)
      Key Part 1:
          Fixed Length Character String
          443131                                 D11            
      Table RID: x(0000 0000 0008) r(00000000;0008) d(0;8) ridFlags=x0
      Table RID: x(0000 0000 0010) r(00000000;0010) d(0;16) ridFlags=x0
      Table RID: x(0000 0000 0011) r(00000000;0011) d(0;17) ridFlags=x0
      Table RID: x(0000 0000 0012) r(00000000;0012) d(0;18) ridFlags=x0
      Table RID: x(0000 0000 0013) r(00000000;0013) d(0;19) ridFlags=x0
      Table RID: x(0000 0000 0014) r(00000000;0014) d(0;20) ridFlags=x0
      Table RID: x(0000 0000 0015) r(00000000;0015) d(0;21) ridFlags=x0
      Table RID: x(0000 0000 0016) r(00000000;0016) d(0;22) ridFlags=x0
      Table RID: x(0000 0000 0017) r(00000000;0017) d(0;23) ridFlags=x0
      Table RID: x(0000 0000 0027) r(00000000;0027) d(0;39) ridFlags=x0
      Table RID: x(0000 0000 0028) r(00000000;0028) d(0;40) ridFlags=x0

   Key 4:
      Offset Location = 1423  (x58F)
      Record Length   = 55  (x37)
      Key Part 1:
          Fixed Length Character String
          443231                                 D21            
      Table RID: x(0000 0000 0009) r(00000000;0009) d(0;9) ridFlags=x0
      Table RID: x(0000 0000 0018) r(00000000;0018) d(0;24) ridFlags=x0
      Table RID: x(0000 0000 0019) r(00000000;0019) d(0;25) ridFlags=x0
      Table RID: x(0000 0000 001A) r(00000000;001A) d(0;26) ridFlags=x0
      Table RID: x(0000 0000 001B) r(00000000;001B) d(0;27) ridFlags=x0
      Table RID: x(0000 0000 001C) r(00000000;001C) d(0;28) ridFlags=x0
      Table RID: x(0000 0000 0029) r(00000000;0029) d(0;41) ridFlags=x0

   Key 5:
      Offset Location = 1478  (x5C6)
      Record Length   = 13  (xD)
      Key Part 1:
          Fixed Length Character String
          453031                                 E01            
      Table RID: x(0000 0000 0007) r(00000000;0007) d(0;7) ridFlags=x0

   Key 6:
      Offset Location = 1491  (x5D3)
      Record Length   = 55  (x37)
      Key Part 1:
          Fixed Length Character String
          453131                                 E11            
      Table RID: x(0000 0000 000A) r(00000000;000A) d(0;10) ridFlags=x0
      Table RID: x(0000 0000 001D) r(00000000;001D) d(0;29) ridFlags=x0
      Table RID: x(0000 0000 001E) r(00000000;001E) d(0;30) ridFlags=x0
      Table RID: x(0000 0000 001F) r(00000000;001F) d(0;31) ridFlags=x0
      Table RID: x(0000 0000 0020) r(00000000;0020) d(0;32) ridFlags=x0
      Table RID: x(0000 0000 002A) r(00000000;002A) d(0;42) ridFlags=x0
      Table RID: x(0000 0000 002B) r(00000000;002B) d(0;43) ridFlags=x0

   Key 7:
      Offset Location = 1546  (x60A)
      Record Length   = 48  (x30)
      Key Part 1:
          Fixed Length Character String
          453231                                 E21            
      Table RID: x(0000 0000 000B) r(00000000;000B) d(0;11) ridFlags=x0
      Table RID: x(0000 0000 0021) r(00000000;0021) d(0;33) ridFlags=x0
      Table RID: x(0000 0000 0022) r(00000000;0022) d(0;34) ridFlags=x0
      Table RID: x(0000 0000 0023) r(00000000;0023) d(0;35) ridFlags=x0
      Table RID: x(0000 0000 002C) r(00000000;002C) d(0;44) ridFlags=x0
      Table RID: x(0000 0000 002D) r(00000000;002D) d(0;45) ridFlags=x0

Total Record bytes on this page = 342
                           ______________________________________

      Index Object page: 5
      BPS pool page    : 389
      BPS object page  : 5

         BPS Page Header:
                  Page Data ffset = 48
                  Page Data Length = 8144
                          Page LSN = 0000000005B6AA54
                       Page Number = 5
                         Object ID = 6
                       Object Type = Index Object
     
         Index Node Header:
                     Header Type = 0
                   Index Root Page = 4     --&gt該索引root page,包含Index Root Vector,索引定義
                         Node Type = Last Leaf Node / Large RID / Info Page
                        Page State = x(4100030C)
                        Tree Level = 1
                     Previous Node = Start of Chain
                         Next Node = End of Chain
                  Total Free Space = 7195
                Maximum Free Space = 7244
                 Free Space ffset = 997
                    Reserved Space = 0
                        Slot count = 426
     
         Collated Key Directory:
        Number of Prefixes in Node = 0
            Number of Keys in Node = 1
              Dummy Hi Key Present = No
                     Vector length = 864
                         # of Rids = 1
                 # of Deleted Rids = 0
                        # of slots = 426
                     Usable bytes =  7244, from 948 to 8192

         Index Key Records:
         Key 0:
            Offset Location = 948  (x3B4)
            Record Length   = 49  (x31)
            Key Part 1:
                Small Integer
                Value = 1
                Hex Format =       0100                                                  
                Index statistics
            Key Part 2:
                Small Integer
                Value = 0
                Hex Format =       0000                                                  
            Key Part 3:
                Small Integer
                Value = 0
                Hex Format =       0000                                                  
            Key Part 4:
                Variable Length Character String
                Actual Length = 32
                      08000000 00000000 01000000 FFFFFFFF    ................
                FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF    ................

                Full key card plus del = 8
                Number of leaf pages   = 1
            Table RID: x(0001 0000 0000) r(00010000;0000) d(65536;0) ridFlags=x0

      Total Record bytes on this page = 49
   Index object report phase end.
--------------------------------------------------------------------------


6,db2dart其他用途:
*設定索引為無效
/MI  Marks index object as invalid.

*降低表空間高水位標記(包括EMP塊)
/DHWM  Dumps highwater mark information.---  db2dart sample /dhwm /tsi 2,db2 list tablespaces show detail
/LHWM  Suggests ways of lowering highwater mark.
/RHWM  Reduces highwater mark through empty SMP extents.

*改變資料庫狀態
/CHST  Change a state of the database.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18922393/viewspace-706932/,如需轉載,請註明出處,否則將追究法律責任。

相關文章