How to estimate space needed before MASSADD
search cancel

How to estimate space needed before MASSADD

book

Article ID: 247211

calendar_today

Updated On:

Products

Datacom Datacom/AD Datacom/DB

Issue/Introduction

Whenever we acquire a new customer that often requires several million of records to be mass loaded to our existing databases that utilizes DB compression.  This causes a problem in being able to estimate the amount of DASD space needed to be available to a DBID to hold all of the new set of records. Is there anything that would estimate the space needed before a MASSADD?

Environment

Release : 15.1

Component : Datacom/DB

Resolution

Here is a process to determine how many tracks or cylinders to add to your DATA area through the MASSADD function. You may need to also increase your INDEX areas, but we cannot tell you that amount here.

  1. (If not using compression, skip to step 3.) Run DBUTLTY REPORT TYPE=WHATIFCP function to get the average compression on the data as it exists in the table today before adding the new data with MASSADD. We’ll assume for this procedure that the new data will compress similarly. Syntax of report is below

    DBUTLTY REPORT DBID=dddd,TABLE=ttt,TYPE=WHATIFCP (note: don’t specify OPTION2=)

  2. From the report, note down the PERCENT OF UNCOMPRESSED for later use
    AREA TABLE         RECORDS                                                                                                                                                                                
      C02            43,194                                
      TOTAL          43,194                                  
                                                                                                                                                                                                                                  
    CASE                 NO COMPRESSION    EXTRACT INPUT               DB    
    COMPRESSION TYPE               NONE               DB               DB    
    STORED BYTES              4,146,624        2,935,906        2,935,906    
    PERCENT OF UNCOMPRESSED                                          70.8      
    CPU TO COMPRESS                                      000:00:00.023669    
    CPU TO EXPAND                                        000:00:00.014594
  3. Run DBUTLTY REPORT DEVICE to determine the amount you will want to EXTEND the table by before the MASSADD. Syntax of report is down below.

    DBUTLTY REPORT DEVICE=3390,RECSIZE=n,COMPER=x,COMPRESS=YES,GROWTH=p,RECORDS=r,RECOVERY=YES
    • n is the uncompressed record size of the table involved.
    • x is 100 minus the PERCENT OF UNCOMPRESSED from the above report, rounded down to a whole number. For example, the above report shows 70.8, so 100 - 70.8 = 29.2, rounded down, x = 29. If you are not using compression, use zero here.
    • p is a percentage of additional space to allow for growth (0-999). Suggested minimum of 10 should be used for rounding error
    • r is the number of records to be added to the table with MASSADD.

  4. The REPORT DEVICE produces two charts. The first chart facilitates choosing an optimal blocksize for a brand new table. You
    can ignore that since your table exists and you are not planning to change your blocksize. Find the 2nd chart from the REPORT DEVICE output. 
    ...+....10...+....20...+....30...+....40...+....50...+....60...+....70...+....80...+..|

    ---------------------------------------------------------------------------------------
    # RCD #  MINM # DEVICE #    LOGICAL    #           DATA SPACE REQUIRED                #
    # PER # BLOCK #  BLOCK #  RECORDS PER  # PRIMARY #  GROWTH #   TOTAL ##     TOTAL     #
    # BLK #  SIZE #   SIZE # TRACK # CYLIN #  TRACKS #  TRACKS #  TRACKS ##  CYLIN  / TRK
    #-----#-------#--------#-------#-------#---------#---------#---------##---------/-----#
    #   1 #   576 #    588 #    46 #   690 #  760870 #       0 #  760870 ##   50724 /  10 #
    #   2 #  1150 #   1154 #    64 #   960 #  546875 #       0 #  546875 ##   36458 /   5 #
    #   3 #  1724 #   1748 #    72 #  1080 #  486112 #       0 #  486112 ##   32407 /   7 #
    #   4 #  2298 #   2376 #    76 #  1140 #  460527 #       0 #  460527 ##   30701 /  12 #
    #   5 #  2872 #   2942 #    80 #  1200 #  437500 #       0 #  437500 ##   29166 /  10 #
    #   6 #  3446 #   3768 #    78 #  1170 #  448718 #       0 #  448718 ##   29914 /   8 #
    #   7 #  4020 #   4136 #    84 #  1260 #  416667 #       0 #  416667 ##   27777 /  12 #
    #   8 #  4594 #   5064 #    80 #  1200 #  437500 #       0 #  437500 ##   29166 /  10 #
    #   9 #  5168 #   5726 #    81 #  1215 #  432099 #       0 #  432099 ##   28806 /   9 #
  5. Find the largest entry in the DEVICE BLOCK SIZE column that is equal to or less than your current area block size. For example, if your current blocksize is 4096, the largest value equal to or less than 4096 is 3768 (6 records per block) shown in the highlighted row of the report

  6. Using the highlighted row found in the previous step, locate the TOTAL TRACKS or TOTAL CYLIN/TRK column to get the amount of storage that is estimated to be required for the planned MASSADD.

Additional Information

If you need further assistance understanding these reports, please open a support case for Datacom and include a full CXX report for the database, the Data Area Space Estimation Report (the DEVICE report), and the WHATIFCP report.