Analyze DB2 storage by using the SM options

The DB2® dump formatter provides a way to analyze the usage of DB2 storage with the Storage Manager (SM) options. Each level of the SM option provides more detailed information than the previous level.

Table 1 summarizes the information generated for each value of SM and for SMSA.

All storage manager reports show information about local storage, global storage (z/OS® CSA/ECSA), and EDM pool statistics.

To obtain the simplest local storage report, run the DSNWDMP statement with SM=1. The local storage report is divided into two sections: one for fixed storage and one for variable storage. Fixed storage is storage that has a predetermined length, and each element has the same length.

The following example shows a local storage report that is generated for the following DSNWDMP statement:

DSNWDMP 'SUBSYS=VA1A,SM=1'
Figure 1. Local storage report for DSNWDMP with SM=1 option
==Storage (Local) VARIABLE POOLS                                  
      PHB       Subpool name             F/V                 CL SP 
      ---       ------------             ---                 -- -- 
        1               2                 3              4   5   6 
      7E9CB630  ADMF AGL 31 .pA.         Var           136K  12 229
      66D109C0  ADMF AGL 31 .\..         Var             0K  12 229
      50C22EC0  ADMF AGL VL .Z..         Var            28K  12 229
      589B7D90  ADMF AGL VL ....         Var           180K  12 229
      7E9BF7F0  ADMF AGL VL '...         Var            56K  12 229
      7E983AB0  ADMF AGL VL '.!.         Var            28K  12 229
      7E97CB20  ADMF AGL 31 'm..         Var           992K  12 229
      7E968C60  ADMF AGL 31 '.N.         Var          1204K  12 229
Figure Label Description
 1  Pool header block address
 2  Pool name
 3  Fixed (fix) or variable (var) storage
 4  Size of pool
 5  DB2 storage class
 6  z/OS subpool

When you specify SM=1, DSNWDMP also generates storage statistics. The following shows an example of a storage statistics report.

Figure 2. Storage statistics report for DSNWDMP with SM=1 option
 Storage statistics 
 ------------------
    QSSTGPLF Get Fixed length pool in dataspace     149   QSSTGPLV Variable pool getmains             1081508
    QSSTFPLF Free Fixed length pool in dataspace     72   QSSTFPLV Variable pool freemains            1076402
    QSSTFREF Fixed pools                              6   QSSTFREV Variable pools                      570252
    QSSTEXPF Fixed pool extensions                 5153   QSSTEXPV Variable pool extensions            924971
    QSSTCONF Fixed contracted blocks                748   QSSTCONV Variable contracted blocks          333901
    QSSTGETM Getmains(GETM)                      190487   QSSTFREM Freemains (GETM)                    188142
    QSSTRCNZ Non RC=0 Getmains                        0   QSSTCRIT Short on storage                     10812
    QSSTCONT Contractions initiated               11238   QSSTABND Abends due to insufficient storage      51

To obtain a local storage report with SHB control blocks, run the DSNWDMP statement with SM=2. In a fixed storage pool, the storage always follows the SHB, so only the SHB address is listed in the report. Each block of variable storage has a varying length. With variable storage, the SHB is not in the same place as the storage, so the address of the storage is listed after the address of the SHB.

The following shows an example of a local storage report that is generated for the following DSNWDMP statement:

DSNWDMP 'SUBSYS=VA1A,SM=2,SMSA=2D'
Figure 3. Local storage report for DSNWDMP with SM=2 option
==Storage (Local) VARIABLE POOLS                                     
      PHB       Subpool name             F/V                 CL SP    
      ---       ------------             ---                 -- --    
      7E9CB630  ADMF AGL 31 .pA.         Var           136K  12 229   
                SHB: 65BC2D88  52A32000         136K                  
      66D109C0  ADMF AGL 31 .\..         Var             0K  12 229   
      50C22EC0  ADMF AGL VL .Z..         Var            28K  12 229   
                      1           2               3 

                SHB: 50CB8B08  2CA5A000          16K                  
                SHB: 50CB8AB8  5089F000           8K                  
                SHB: 50CB8A18  50A3A000           4K 
Figure Label Description
 1  SHB address
 2  Address of storage that SHB relates to
 3  Length of storage

Within a storage pool, the sum of the segment (SHB) lengths should always equal the length that is described by the pool header block (PHB). In the previous example, the PHB length, 32 KB, is equal to the sum of the SHB lengths: 12 KB+8 KB+8 KB+4 KB.

Use SM=4 and SM=5 to check for fragmentation within blocks and storage use within individual variable storage pool blocks. The report includes the total length of allocated and free elements for each segment of storage and the total for the storage pool. The total for the storage pool appears after the last SHB for the pool.

The following shows an example of a local storage report that is generated for the following DSNWDMP statement:

DSNWDMP 'SUBSYS=VA1A,SM=4,SMSA=2D'
Figure 4. Local storage report for DSNWDMP with SM=4 option
Jobname VA1ADBM1 ASID(002D)
==Storage (Local) FIXED POOLS
     PHB       Subpool name             F/V              CL SP
     ---       ------------             ---              -- --
     7F7594B8  EDM FIXED LENGTH POOL    Fix          4K  12 229
               SHB: 7F2DE000                     4K
     7F759518  EDM FIXED LENGTH POOL    Fix          4K  12 229
               SHB: 7F0AF000                     4K
     7F759810  RDS STPM LOCAL POOL      Fix          0K  12 229
     7F75B290  SHBS FOR LOCAL V-POOLS   Fix          4K  12 229
               SHB: 7F705000                     4K
==Storage (Local) VARIABLE POOLS
     PHB       Subpool name             F/V              CL SP
     ---       ------------             ---              -- --
     7F2C4510  ADMF AGENT LOCAL POOL    Var         32K  12 229
               SHB: 7F705AD8  7EF50000          12K      Free: 00000578    1K Alloc: 00002A48   10K
               SHB: 7F705AB8  7EF53000           8K      Free: 00001FD0    7K Alloc: 00000000    0K
               SHB: 7F7059D8  7EF6B000           8K      Free: 000003E0    0K Alloc: 00001BD0    6K
               SHB: 7F7059B8  7EF80000           4K      Free: 00000160    0K Alloc: 00000E20    3K
                                          Total:    Free: 00002A88    10K Alloc: 00005438       21K

Use SM=5 to display the first 16 bytes, with their hexadecimal equivalents, of each allocated element. For the module that made a request to DB2 storage manager for storage, DSNWDMP attempts to display the following extra information:

  • The owner token for the storage
  • The CSECT and offset within the CSECT of the storage allocation request
  • The maintenance level of the module

It is not always possible to determine the CSECT name. Therefore, this name might be incorrect or absent in some cases.

The following shows an example of a local storage report that is generated for the following DSNWDMP statement:

DSNWDMP 'SUBSYS=VA1A,SM=5,SMSA=2D'
Figure 5. Local storage report for DSNWDMP with SM=5 option
==Storage (Local) VARIABLE POOLS                                                                                    
     PHB       Subpool name             F/V                 CL SP                                                   
     ---       ------------             ---                 -- --                                                   
     7E9CB630  ADMF AGL 31 .pA.         Var           136K  12 229                                                  
                                                                                        1         2              3 
       52A53F88: 00000060 20B20058 D7C3C220 00000000 00000000   ....PCB.........   00000000 DSNB1REL +0D25   12.28  
               SHB: 65BC2D88  52A32000         136K         Free: 00021F60  135K Alloc: 00000060    0K              
                                          Total:    Free: 00021F60      135K Alloc: 00000060        0K              
     66D109C0  ADMF AGL 31 .\..         Var             0K  12 229                                                  
     50C22EC0  ADMF AGL VL .Z..         Var            28K  12 229                                                  
       2CA5A080: 00000048 201C003C E2E3C1C3 00000000 00000000   ....STAC........   2FE99C30 DSNIALLI +2387   15.28  
       2CA5A0D8: 00000038 001C0030 C9D8E4C5 00000000 2FE99C30   ....IQUE.....Z..   2FE99C30 DSNIALLI +1A33   15.28  
       2CA5A120: 00003EC8 20FE3EC0 C4D4E3D9 2CA5A160 2CA5B860   ...{DMTR.v~-.v.-   2FE99C30 DSNIALLI +174D   15.28 
Figure Label Description
 1  Owner token for the storage
 2  CSECT and offset of the storage allocation request
 3  Maintenance level

You can specify DS options with SM options to display storage information by thread. This information includes the short, long and vlong pool addresses. These addresses are addresses of storage pools within the DBM1 address space.

The following shows an example of a storage report that is generated for the following DSNWDMP statement:

DSNWDMP 'SUBSYS=VA1A,DS=1,SM=5,SMSA=2D'

This example shows that a CICS® thread signed on as user USRT001, running plan TSTA85, on correlation ID PT01XA85 is using ADMF local pool 7F2C4510. The thread uses 32 KB of storage, of which 21 KB is currently allocated.

Figure 6. Storage by thread report for DSNWDMP with DS=1 and SM=5 option
Jobname CICS41F  ASID(0021)
 ACE: 0624C008 Status: T   Req: 0003    Allied Chain
 CT:  7F2E5030 Short:  7F2C43C0 Long:  7F2C43C0 Vlong:  7F2C4350
 Authid: USRT001  Plan: TSTA85   Corrid: PT03XA85     Corrname: CICS41   Token: 00000028
 EB       Primary(Asid)  Home(Asid)     EBSPAWND TCB/SRB  -Status-- R14
 0624C098 CICS41F (0021) CICS41F (0021) 00000000 006A67D0 Running   00000000
 ACE: 0624BE38 Status: T   Req: 0003    Allied Chain
 CT:  7F2E3030 Short:  7F2C44A0 Long:  7F2C44A0 Vlong:  7F2C4430
 Authid: USRT001  Plan: TSTA85   Corrid: PT02XA85     Corrname: CICS41   Token: 00000027
 EB       Primary(Asid)  Home(Asid)     EBSPAWND TCB/SRB  -Status-- R14
 0624BEC8 CICS41F (0021) CICS41F (0021) 00000000 006A6A60 Running   00000000
 ACE: 0624BC78 Status: T   Req: 0004    Allied Chain
 CT:  7F2E1030 Short:  7F2C4580 Long:  7F2C4580 Vlong:  7F2C4510
 Authid: USRT001  Plan: TSTA85   Corrid: PT01XA85     Corrname: CICS41   Token: 00000026
 EB       Primary(Asid)  Home(Asid)     EBSPAWND TCB/SRB  -Status-- R14
 0624BD08 CICS41F (0021) CICS41F (0021) 00000000 006A6CF0 Running   861EF578

For all storage reports, DSNWDMP displays EDM pool statistics. Those statistics are the same ones that you obtain through DB2 statistics trace reports. The following shows an example report.

Figure 7. EDM pool statistics report for DSNWDMP with SM option
==EDM statistics
  --------------
  Fails due to POOL full:                              0
  Pages in EDM POOL:                                 225
  REQ for CT sections:                                28
  Load CT sections from DASD:                          3
  Pages used for CT:                                   8
  Free pages in free chain:                          194
  Pages used for DBDs:                                18
  Pages used for SKCT:                                 3
  Requests for DBD:                                   24
  Loads of DBDS from DASD:                             3
  Requests for PT sections:                            6
  Loads of PT sections from DASD:                      2
  Pages used for PT:                                   0
  Pages used for SKPT:                                 2
  Inserts for dynamic cache:                           0
  Requests for dynamic cache:                          0
  Pages used for dynamic cache:                        0