CATMAINT

Start of changeThe CATMAINT utility updates the catalog; run this utility during migration to Db2 12, before you activate a function level that requires a new catalog level, or when instructed by IBM® Support.End of change

You can tailor and run the DSNTIJTC job to run the CATMAINT utility. For more information, see Migration step: Tailor Db2 13 catalog: DSNTIJTC or Installation step: Tailor the Db2 catalog: DSNTIJTC.

Important: Start of changeDo not attempt to start Db2 at a lower code level after any part of the CATMAINT job for a higher function level completes. Run the CATMAINT job only after you are satisfied that Db2 can continue to run at the required code level. The code to tolerate catalog changes is contained in the code level that delivers the CATMAINT job. End of change
Restriction: Start of change Before you can run CATMAINT to tailor the Db2 catalog for function level 502 or higher, you must first activate function level 500 or 501. That is, the DISPLAY GROUP command output must indicate HIGHEST ACTIVATED FUNCTION LEVEL (V12R1M500) or higher. This restriction prevents tailoring the Db2 catalog for function levels higher than 500 while fallback to Db2 11 remains possible. However, later activating a lower function level such as function level 100* does not restrict the CATMAINT operation.End of change

Output

Output for CATMAINT UPDATE is the updated catalog.

Authorization required

Start of changeThe required authorization for CATMAINT is the installation SYSADM or installation SYSOPR authority. The installation SYSOPR authority enables you to install or migrate Db2 without access to user objects.End of change

Execution phases of CATMAINT

The CATMAINT utility operates in the following phases:
  1. UTILINIT performs initialization.
  2. UTILTERM performs cleanup

If the catalog contains plans or packages that were bound with DBPROTOCOL(PRIVATE), the CATMAINT utility executes successfully; however, plans and packages that were bound with DBPROTOCOL(PRIVATE) and access remote locations cannot execute in DB2® 10 and later. To enable the plans or packages to execute, convert them to use the DRDA protocol by rebinding them.

Before running CATMAINT

During migration, the work file database is used for CATMAINT sorting. If you are migrating from a previous version, calculate the size of the work file database.

Start of changeIf you are migrating to Db2 12 or activating a function level that requires a new catalog level, ensure that no incompatible applications will interfere with the catalog update. For details, see Identify applications that are incompatible with online catalog migration.End of change

Data sets for CATMAINT

Include DD statements for all data sets that your job uses. The following table lists the data sets that CATMAINT uses. The table lists the DD name that is used to identify the data set, a description of the data set, and an indication of whether it is required.

Table 1. Data sets that CATMAINT uses
Data set Description Required?
SYSIN An input data set that contains the utility control statement Yes
SYSPRINT An output data set for messages Yes

Concurrency and compatibility for CATMAINT

Many catalog and directory indexes are not available while CATMAINT is running. The unavailability of these indexes can cause other jobs to time out with messages DSNT318I, DSNT376I or DSNT501I.

CATMAINT syntax and options

Use the ISPF/PDF edit function to create a control statement and to save it in a sequential or partitioned data set. When you create the JCL for running the job, use the SYSIN DD statement to specify the name of the data set that contains the utility control statement.

Read syntax diagramSkip visual syntax diagram CATMAINT UPDATE LEVEL( level)switch-specutilx-specUNLDDNaction-token
switch-spec
Read syntax diagramSkip visual syntax diagramSCHEMASWITCH( schema-name, new-schema-name)OWNERFROM(,owner-name)TO ROLEVCATSWITCH( catalog-name, new-catalog-name)
utilx-spec
Read syntax diagramSkip visual syntax diagram UTILX BASICEXTENDEDRESET
UPDATE
Indicates that you want to update the catalog.
Start of changeLEVEL(level)End of change
Start of changeSpecifies the target function level or catalog level for the CATMAINT job. The format is VvvRrMmmm, where vv is the version, r is the release, and mmm is the modification level.

If you specify a function level value, Db2 determines the appropriate target catalog level and message DSNU777I indicates the result. The resulting catalog level might be lower than the value that you specify because not every function level requires a new catalog level.

If the target function level requires multiple catalog level updates, the CATMAINT job processes each update in sequential order. If a later update in the sequence fails, the previous successful updates do not roll back, and the catalog level remains at the highest level reached. If that occurs, you can correct the reason for the failure and resubmit the same CATMAINT job.

End of change
Start of changeUNLDDN action-tokenEnd of change
Start of changeSpecifies service activity that CATMAINT needs to perform. Run CATMAINT UPDATE UNLDDN action-token only if the instructions for applying a PTF or IBM Support direct you to do so.
action-token
A value that is passed to CATMAINT to identify the service activity that it is to perform.
End of change
SCHEMA SWITCH(schema-name,new-schema-name)
Changes the owner, creator, and schema of database objects. The authorization IDs of the creator or owner for plans and packages that use the objects are not changed.

schema-name is a string that identifies the existing owner, creator, or schema to be changed. It will be ignored if it does not identify any owner, creator, or schema names.

schema-name cannot identify a schema or qualifier of an object on which any of the following objects depend:

  • Triggers
  • Views
  • SQL functions
  • Materialized query tables
  • Native SQL procedures
  • Expression-based indexes
  • Column masks
  • Row permissions

schema-name cannot be referenced in a check condition in any check constraints. Ownership of objects will not be changed if the owner is a role.

new-schema-name specifies the new name for the owner, creator, or schema. The name cannot be a schema that qualifies existing objects.

OWNER FROM(owner-name) TO ROLE
Changes the ownership of objects from a user to a role. A trusted context must have been created for INSTALL SYSADM before CATMAINT UPDATE OWNER can run. The authorization IDs of the creator or owner for plans and packages that use the objects are not changed.

owner-name specifies the current owner of the object. You can specify multiple owners.

VCAT SWITCH(catalog-name,new-catlog-name)
Changes the catalog name that is used by storage groups, user indexes, and table spaces.
catalog-name
Identifies the integrated catalog facility catalog that is currently used by user-managed data sets for indexes, table spaces, and storage groups.
new-catalog-name
Specifies the new user-managed data sets for indexes, table spaces, and storage groups.

The data sets are linear VSAM data sets cataloged in the integrated catalog facility catalog that catalog-name identifies. For more information about catalog-name values, see Naming conventions.

More than one Db2 subsystem can share the integrated catalog facility catalogs with the current server. To avoid the chance of those subsystems attempting to assign the same name to different data sets, specify a catalog-name value that is not used by the other Db2 subsystems.

To specify any non-alphanumeric characters, enclose each name in single quotes.

UTILX
Updates the catalog and OBD to the state specified (BASIC or EXTENDED).
  • If the table space is already in the requested state no change is made, and a successful message and return code is given.
  • If the table space is different from the requested state and the table space is not empty, it fails with a DSNU777I message.
  • If the table space is different from the requested state and the table space is empty, the table space is reset to the new state.
BASIC
Initializes SYSUTILX and its indexes to basic 6-byte RBA format. Ensure that all utilities are completed or terminated before you change the format or the command will fail with a DSNU777I message.
EXTENDED
Initializes SYSUTILX and its indexes to extended 10-byte RBA format. Ensure that all utilities are completed or terminated before you change the format or the command will fail with a DSNU777I message.
RESET
Start of changeReinitializes the DSNDB01.SYSUTILX directory table space. Because DSNDB01.SYSUTILX contains information about active and outstanding utilities, you must determine which objects have a utility in progress and resolve any utility-in-progress states and restrictive states to make the object available for access.End of change

Reinitialize the DSNDB01.SYSUTILX directory table space in any of the following situations:

  • You cannot successfully run the DISPLAY UTILITY or TERMINATE UTILITY commands.

After you run this statement, DSNDB01.SYSUTILX is reset to an empty state, and the previous contents are lost. If there were active or stopped utilities at that time, their tracking information is lost and the subsystem might experience unpredictable results. It is important that all utilities that can be terminated are terminated before you run UPDATE UTILX RESET.

Termination or restart of CATMAINT

You can terminate CATMAINT by using the TERM UTILITY command, but the termination might leave some indexes in REBUILD-pending status.

CATMAINT cannot be restarted. If you attempt to restart CATMAINT, you receive message DSNU181I, which states that the utility cannot be restarted. You must terminate the job with the TERM UTILITY command, and rerun CATMAINT from the beginning.