DB2 space allocation

Calculate the DB2® space allocations using these assumptions and guidance.

In the following calculations, the following assumptions apply:
  • All data spaces and indexes in CICS® IA use Bufferpool BP0, which is a 4 KB page.
  • Number of bytes available in a 4 KB page is 4089.
  • You have to calculate the PRIQTY for all tables and indexes.
  • SECQTY is set to 10% of the PRIQTY. For more information on SECQTY, see the DB2 Administration Guide.

To calculate the PRIQTY for tablespaces and indexes, use the calculation in Figure 1:

Figure 1. Calculation for PRIQTY for tablespaces and indexes
ROWS_PER_PAGE = 4089/ROW_SIZE
FREE_BYTES = 4089/100 * PERCENT_FREE
FREE_ROWS = FREE_BYTES/ROW_SIZE

NUM_OF_4K_PAGES = NUM_ROWS / (ROWS_PER_PAGE – FREE_ROWS)
PRIQTY = 4 * NUM_OF_4K_PAGES

The calculation in Figure 1 has three variables:

  • ROW_SIZE
  • PERCENT_FREE
  • NUM_ROWS

The ROW_SIZE and PERCENT_FREE for each tablespace and the indexes are in the tables provided for each DB2 table. To calculate the number of rows for each tablespace and index, see CICS tables and indexes: CIUCICS1 and CIUCICSX.

However, until you know how many EXEC CICS statements are used by the applications, it is difficult to estimate the number of rows for a DB2 table.

The DB2 table update jobs, CIUUPDB1, CIUUPDB2, CIUUPDB3, CIUUPDB4, CIUUPDBN, and CIUAFFLD, include a step to report on the number of rows in a table. For example:
--Show me the number of rows in the CIU_CICS_DATA table  
***INPUT STATEMENT:  
SELECT COUNT(*) FROM CIU_CICS_DATA READONLY;  
+----------------+  
1_| 3037         |  
+----------------+
For the CIU_CICS_DATA table use the row count from the load module scanner jobs CIUJCLTS and CIUJCLTD. Or run the sample SQL member, CIUSPACE, to report on the row count for all of the CICS IA tables. Use the reported values to re-create the table space and index if required.