The DSN1COMP stand-alone utility estimates space savings that are to be achieved by data compression in table spaces, including LOB table spaces, and indexes. You can estimate the space savings for fixed-length Db2 data compression, Huffman compression, or both.
You can run this utility on the following types of data sets:
- Db2 full image copy data sets
- VSAM data sets that contain Db2 table spaces
- Sequential data sets that contain Db2 table spaces (for example, DSN1COPY output)
These data sets can contain compressed or uncompressed data.
- You cannot run DSN1COMP on concurrent copies.
- If you run DSN1COMP on a table space in which the data is the same for all rows, message DSN1941I is issued. In this case, DSN1COMP does not compute any statistics.
- Do not run DSN1COMP on table spaces in DSNDB01, DSNDB06, or DSNDB07.
Run DSN1COMP as a z/OS® job.
You can run DSN1COMP even when the Db2 subsystem is not operational. Before you use DSN1COMP when the Db2 subsystem is operational, issue the Db2 STOP DATABASE command. Issuing the STOP DATABASE command ensures that Db2 has not allocated the Db2 data sets.
DSN1COMP does not require authorization. However, if any of the data sets are RACF®-protected, the authorization ID of the job must have RACF authority.
If any of the data sets are encrypted using ICSF key label, the authorization ID of the job must have access to the key label.
Required data sets
DSN1COMP uses the following data definition (DD) statements:
- Defines the data set that contains output messages from DSN1COMP and all hexadecimal dump output.
- Defines the input data set, which can be a sequential data set or a VSAM data set.
Specify the disposition for this data set as OLD (DISP=OLD) to ensure that it is not in use by Db2. Specify the disposition for this data set as SHR (DISP=SHR) only in circumstances where the Db2 STOP DATABASE command does not work.
The requested operation takes place only for the specified data set. . In the following situations, ensure that you specify the data set name for the partition or first piece:
- The input data set belongs to a nonpartitioned table space.
- The index space is larger than 2 GB.
- The table space or index space is partitioned.
If you are running the online REORG utility with FASTSWITCH behavior, verify the data set name before running the DSN1COMP utility. The fifth-level qualifier in the data set name alternates between 'I0001' and 'J0001' when using FASTSWITCH. If the table space has cloning, the fifth-level qualifier can be 'n0002.' You cannot specify FASTSWITCH YES if the table space has cloning; however, a FASTSWITCH YES REORG might have been done before the clone was created so you might still have a mixture of 'I' and 'J' data sets. Specify the correct fifth-level qualifier in the data set name to successfully execute the DSN1COMP utility. To determine the correct fifth-level qualifier, query the IPREFIX column of SYSIBM.SYSTABLEPART for each data partition or the IPREFIX column of SYSIBM.SYSINDEXPART for each index partition. If the object is not partitioned, use zero as the value for the PARTITION column in your query.
- DSN1DICT is required only if you specify the EXTNDICT parameter to create an external copy of
the compression dictionary that DSN1COMP produces.DSN1DICT defines the output data set to which the external copy of the compression dictionary is written. This data set must:
- Be a sequential data set or a member of a partitioned data set
- Have fixed record format with a record length of 80
The data set or data set member that is produced is an object module that can be link-edited into a program.
Before using DSN1COMP, make sure that you know the page size and data set size (DSSIZE) for the table space. Use the following query on the Db2 catalog to get the information that you need. This example is for the DEPT table:
SELECT T.CREATOR,T.NAME,S.NAME AS TABLESPACE,S.PARTITIONS,S.PGSIZE, CASE S.DSSIZE WHEN 0 THEN CASE WHEN S.TYPE = 'G' THEN 4194304 WHEN S.TYPE = 'O' THEN 4194304 WHEN S.TYPE = 'P' THEN 4194304 WHEN S.TYPE = 'R' THEN 4194304 ELSE CASE WHEN S.PARTITIONS > 254 THEN CASE WHEN S.PGSIZE = 4 THEN 4194304 WHEN S.PGSIZE = 8 THEN 8388608 WHEN S.PGSIZE = 16 THEN 16777216 WHEN S.PGSIZE = 32 THEN 33554432 ELSE NULL END WHEN S.PARTITIONS > 64 THEN 4194304 WHEN S.PARTITIONS > 32 THEN 1048576 WHEN S.PARTITIONS > 16 THEN 2097152 WHEN S.PARTITIONS > 0 THEN 4194304 ELSE 2097152 END END ELSE S.DSSIZE END AS DSSIZE FROM SYSIBM.SYSTABLES T, SYSIBM.SYSTABLESPACE S WHERE T.NAME = 'DEPT' AND T.TSNAME = S.NAME;