Syntax and options of the REPAIR control statement

The REPAIR utility control statement, with its multiple options, defines the function that the utility job performs.

You can create a control statement with the ISPF/PDF edit function. After creating it, 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.

REPAIR syntax diagram

>>-REPAIR------------------------------------------------------->

>--+----------------------------------------------------+------->
   |                           .------------------.     |   
   | .-OBJECT-. .-LOG--YES-.   V                  |     |   
   '-+--------+-+----------+-+---| locate block |-+---+-'   
                '-LOG--NO--' +-| set statement |------+     
                             +-| dbd-statement |------+     
                             +-| level-id statement |-+     
                             '-| versions statement |-'     

>--+-------+---------------------------------------------------><
   '-CLONE-'   

locate block:

>>-LOCATE------------------------------------------------------->

                                      .---------------------------.                          
                                      V                           |                          
>--+-+-| locate-table-space-spec |-+----+-| verify statement |--+-+--+-----------------+-+-><
   | '-| locate-index-spec |-------'    +-| replace statement |-+    '-SHRLEVEL CHANGE-' |   
   |                                    +-| delete statement |--+                        |   
   |                                    '-| dump statement |----'                        |   
   +-| LOB-table-space-spec |------------------------------------------------------------+   
   '-| xml-table-space-spec |------------------------------------------------------------'   

locate-table-space-spec:

Read syntax diagram
>>-TABLESPACE--+----------------+-table-space-name-------------->
               '-database-name.-'                    

>--+-PAGE-X--'--byte-string--'--------+------------------------><
   +-+---------------+--PAGE--integer-+   
   | '-PART--integer-'                |   
   +-RID--X--'--byte-string--'--------+   
   '-KEY--literal--INDEX--index-name--'   

locate-index-spec:

Read syntax diagram
>>-+-INDEX--index-name------------+----------------------------->
   '-INDEXSPACE--index-space-name-'   

>--+-PAGE-X--'--byte-string--'---------------------+-----------><
   '-+---------------+--PAGE----integer----integer-'   
     '-PART--integer-'                                 

LOB-table-space-spec:

>>-TABLESPACE--+----------------+-table-space-name-------------->
               '-database-name.-'                    

>--ROWID--X'byte-string'--VERSION--X'byte-string'--------------->

>--+-| delete statement |-+------------------------------------><
   '-| dump statement |---'   

Start of changexml-table-space-spec:End of change

>>-TABLESPACE--+----------------+-xml-table-space-name---------->
               '-database-name.-'                        

>--DOCID--X'byte-string'----| delete statement |---------------><

verify statement:

           .-OFFSET--0------------------.         
>>-VERIFY--+----------------------------+--DATA----------------->
           '-OFFSET--+-integer--------+-'         
                     '-X'byte-string'-'           

>--+-X'byte-string'-----+--------------------------------------><
   '-'character-string'-'   

replace statement:

>>-REPLACE------------------------------------------------------>

>--+-RESET--------------------------------------------------------+-><
   | .-OFFSET--0------------------.                               |   
   '-+----------------------------+--DATA--+-X'byte-string'-----+-'   
     '-OFFSET--+-integer--------+-'        '-'character-string'-'     
               '-X'byte-string'-'                                     

delete statement:

>>-DELETE--+--------------------------------------+------------><
           '-Start of changeDATAONLYEnd of change-'   

dump statement:

>>-DUMP--------------------------------------------------------->

     .-OFFSET--0------------------.                                                                  
>--+-+----------------------------+--+---------------------------+--+--------------------------+-+-><
   | '-OFFSET--+-integer--------+-'  '-LENGTH-+-X'byte-string'-+-'  '-PAGES-+-X'byte-string'-+-' |   
   |           '-X'byte-string'-'             '-integer--------'            +-integer--------+   |   
   |                                                                        '-*--------------'   |   
   '-+-MAP--+-------+--+-------------------------------------------------------------------------'   
     |      '-pages-'  |                                                                             
     '-DATA--+-------+-'                                                                             
             '-pages-'                                                                               

set statement:

>>-SET---------------------------------------------------------->

>--+-TABLESPACE-+----------------+-table-space-name-+---------------+-+-----------------+--------------+-><
   |            '-database-name.-'                  '-PART--integer-' +-NOCOPYPEND------+              |   
   |                                                                  +-NORCVRPEND------+              |   
   |                                                                  +-NOCHECKPEND-----+              |   
   |                                                                  +-NOAUXWARN-------+              |   
   |                                                                  +-NOAUXCHKP-------+              |   
   |                                                                  +-NOAREORPENDSTAR-+              |   
   |                                                                  +-NOAREORPEND-----+              |   
   |                                                                  +-PRO-------------+              |   
   |                                                                  '-NOPRO-----------'              |   
   '-+-INDEX-+-(index-name-+---------------+-)----------------------------+------+-+-----------------+-'   
     |       |             '-PART--integer-'                              |      | +-NOCOPYPEND------+     
     |       '-(--ALL--)--TABLESPACE--+----------------+-table-space-name-'      | +-NORCVRPEND------+     
     |                                '-database-name.-'                         | +-NORBDPEND-------+     
     '-INDEXSPACE-+-(-+----------------+-index-space-name-+---------------+-)--+-' +-NOCHECKPEND-----+     
                  |   '-database-name.-'                  '-PART--integer-'    |   +-NOAREORPENDSTAR-+     
                  '-(--ALL--)--TABLESPACE--+----------------+-table-space-name-'   +-NOAREORPEND-----+     
                                           '-database-name.-'                      +-RBDPEND---------+     
                                                                                   '-PSRBDPEND-------'     

dbd statement:

>>-DBD---------------------------------------------------------->

>--+-DROP--DATABASE--database-name--DBID--X'dbid'--------------+-><
   '-+-TEST-----+--DATABASE--database-name--+----------------+-'   
     +-DIAGNOSE-+                           '-OUTDDN--ddname-'     
     '-REBUILD--'                                                  

level-id statement:

>>-LEVELID------------------------------------------------------>

>--+-TABLESPACE--+----------------+-table-space-name----+------->
   |             '-database-name.-'                     |   
   '-+-INDEX-+-------------+-index-name---------------+-'   
     |       '-creator-id.-'                          |     
     '-INDEXSPACE-+----------------+-index-space-name-'     
                  '-database-name.-'                        

>--+---------------+-------------------------------------------><
   '-PART--integer-'   

versions statement:

>>-VERSIONS----------------------------------------------------->

>--+-TABLESPACE--+----------------+-table-space-name----+------><
   |             '-database-name.-'                     |   
   '-+-INDEX-+-------------+-index-name---------------+-'   
     |       '-creator-id.-'                          |     
     '-INDEXSPACE-+----------------+-index-space-name-'     
                  '-database-name.-'                        

REPAIR option descriptions

OBJECT
Indicates that an object is to be repaired. This keyword is optional.
LOG
Indicates whether the changes that REPAIR makes are to be logged. If the changes are to be logged, they are applied again if the data is recovered.
YES
Indicates that the changes are to be logged.

REPAIR LOG YES cannot override the LOG NO attribute of a table space.

NO
Indicates that the changes are not to be logged. You cannot use this option with a DELETE statement.

REPAIR LOG NO can override the LOG YES attribute of a table space.

TABLESPACE database-name.table-space-name
Specifies the table space (and, optionally, the database to which it belongs) whose level identifier is to be reset (if you specify LEVELID) or whose version identifier is to be updated (if you specify VERSIONS).
database-name
Specifies the name of the database to which the table space belongs.

The default value is DSNDB04.

table-space-name
Specifies the name of the table space.
INDEX
Specifies the index whose level identifier is to be reset (if you specify LEVELID) or whose version identifier is to be updated (if you specify VERSIONS).
creator-id
Specifies the creator of the index. Specifying this qualifier is optional.
index-name
Specifies the name of the index. Enclose the index name in quotation marks if the name contains a blank.
You can specify either INDEX or INDEXSPACE to identify an index. To specify multiple indexes, repeat the keyword.
INDEXSPACE
Specifies the index space for the index whose level identifier is to be reset (if you specify LEVELID) or whose version identifier is to be updated (if you specify VERSIONS). You can obtain the index space name for an index from the SYSIBM.SYSINDEXES catalog table. The index space name must be qualified.
database-name
Specifies the name of the database to which the index space belongs.
index-space-name
Specifies the name of the index space.
You can specify either INDEX or INDEXSPACE to identify an index. To specify multiple indexes, repeat the keyword.
PART
Identifies a partition of the table space or index (including a partition of a data-partitioned secondary index).

Start of changeinteger is the physical partition number. It must be in the range from 1 to the number of partitions that are defined for the table space. The maximum is 4096.End of change

CLONE
Indicates that REPAIR is to process only the specified objects that are table spaces that contain clone tables, indexes on clone tables, or index spaces that contain indexes on clone tables. If you specify CLONE, you cannot specify VERSIONS. Clones cannot be created for tables with active versions.

If you specify SET with CLONE, the status is changed for only the specified table spaces and their indexes. The CLONE keyword applies to all SET statements and LOCATE statements within the same REPAIR utility control statement.

LOCATE block

A LOCATE block is a set of statements, each with its own options, that begins with a LOCATE statement and ends with the next LOCATE or SET statement, or with the end of the job. You can include more than one LOCATE block in a REPAIR utility statement.

In any LOCATE block, you can use VERIFY, REPLACE, or DUMP as often as you like; you can use DELETE only once.

LOCATE block: LOCATE TABLESPACE statement option descriptions

The LOCATE TABLESPACE statement locates data that is to be repaired within a table space.

One LOCATE statement is required for each unit of data that is to be repaired. Several LOCATE statements can appear after each REPAIR statement.

If a REPAIR statement is followed by more than one LOCATE statement, all processing that is caused by VERIFY, REPLACE, and DUMP statements is committed before the next LOCATE statement is processed.
Start of changeTABLESPACEEnd of change
Start of changeSpecifies the base table space or XML table space (and, optionally, the database to which it belongs) in which data is to be located for repair.
database-name
The name of the database to which the base table space or XML table space belongs. This is optional.
table-space-name
The name of the base table space that contains the data to be repaired.
xml-table-space-name
The name of the XML table space that contains the data to be repaired.
End of change
PAGE
Specifies the relative or absolute page number within the table space, partitioned table space, or index that is to be operated on. The first page, in either case, is 0 (zero). For a table space with absolute page numbering, you can specify a PAGE keyword with a relative or absolute page number. For a table space with relative page numbering, you must specify a PAGE keyword with a relative page number.
integer
integer is a decimal number from one to six digits in length.
X'byte-string'
Specifies that the data of interest is an entire page. The specified offsets in byte-string and in subsequent statements are relative to the beginning of the page. The first byte of the page is at offset 0.

byte-string is a hexadecimal value from one to eight characters in length. You do not need to enter leading zeros. Enclose the byte-string between apostrophes, and precede it with X.

PART integer
Specifies the partition that contains the page that is to be located. Part is valid only for partitioned table spaces.

integer is the number of the partition.

RID X'byte-string'
Specifies that the data that is to be located is a single row. The specified offsets in byte-string and in subsequent statements are relative to the beginning of the row. The first byte of the stored row prefix is at offset 0.

byte-string can be a hexadecimal value from one to eight characters in length. You do not need to enter leading zeros. Enclose the byte string between apostrophes, and precede it with an X.

KEY literal
Specifies that the data that is to be located is a single row, identified by literal. The specified offsets in subsequent statements are relative to the beginning of the row. The first byte of the stored row prefix is at offset 0.

literal is any SQL constant that can be compared with the key values of the named index.

Character constants that are specified within the LOCATE KEY option cannot be specified as ASCII or Unicode character strings. No conversion of the values is performed. To use this option when the table space is ASCII or Unicode, you should specify the values as hexadecimal constants.

If more than one row has the value literal in the key column, REPAIR returns a list of record identifiers (RIDs) for records with that key value, but does not perform any other operations (verify, replace, delete, or dump) until the next LOCATE TABLESPACE statement is encountered. To repair the proper data, write a LOCATE TABLESPACE statement that selects the row that you want, using the RID option, the PAGE option, or a different KEY and INDEX option. Then, execute REPAIR again.

SHRLEVEL
Indicates the type of access that is to be allowed for the index, table space, or partition that is to be repaired during REPAIR processing.

If you do not specify SHRLEVEL and you do specify DUMP or VERIFY, applications can read but not write the area.

If you do not specify SHRLEVEL and you do specify DELETE or REPLACE, applications cannot read or write the area.

CHANGE
Specifies that applications can read and write during the VERIFY, REPLACE, DELETE, and DUMP operation.
ROWID X'byte-string'
Specifies that the data that is to be located is a LOB in a LOB table space.

byte-string is the row ID that identifies the LOB column.

Use the ROWID keyword to repair an orphaned LOB row. You can find the ROWID in the output from the CHECK LOB utility. If you specify the ROWID keyword, the specified table space must be a LOB table space.

VERSION X'byte-string'
Specifies that the data that is to be located is a LOB in a LOB table space.

byte-string is the version number that identifies the version of the LOB column.

Use the VERSION keyword to repair an orphaned LOB column. You can find the VERSION number in the output of the CHECK LOB utility or an out-of-synch LOB that is reported by the CHECK DATA utility. If you specify the VERSION keyword, the specified table space must be a LOB table space.

LOCATE block: LOCATE INDEX statement and LOCATE INDEXSPACE statement option descriptions

The LOCATE INDEX (or INDEXSPACE) statement locates data that is to be repaired within an index. You can specify indexes by either their index name or their index space name.

One LOCATE statement is required for each unit of data that is to be repaired. Multiple LOCATE statements can appear after each REPAIR statement.

If a REPAIR statement is followed by multiple LOCATE statements, all processing that is caused by VERIFY, REPLACE, and DUMP statements is committed before the next LOCATE statement is processed.
INDEX index-name
Specifies a particular index that is to be used to find the row that contains the key. When you are locating an index by key, the index that you specify must be a single-column index.

index-name is the qualified or unqualified name of the index. If you omit the qualifier creator ID, the user identifier for the utility job is used. Enclose the index name in quotation marks if the name contains a blank.

INDEXSPACE index-space-name
Specifies the index space for a particular index that is to be used to find the row that contains the key. Look in the SYSIBM.SYSINDEXES catalog table to find the index space name for an index. When you are locating an index by key, the index that you specify must be a single-column index.

index-space-name is the qualified name of the index space, in the form database-name.index-space-name.

PAGE integer
Specifies the relative page number within the index space that is to be operated on. The first page is 0 (zero).
integer
integer is a decimal number from one to six digits in length.
X'byte-string'
Specifies that the data of interest is an entire page. The specified offsets in byte-string and in subsequent statements are relative to the beginning of the page. The first byte of the page is at offset 0.

byte-string is a hexadecimal value from one to eight characters in length. You do not need to enter leading zeros. Enclose the byte-string between apostrophes, and precede it with X.

PART integer
Specifies the partition number of the partitioning index that contains the page that is to be located. The PART keyword is valid only for indexes of partitioned table spaces.

integer is the number of the partitioning index.

LOCATE block: VERIFY statement

The VERIFY statement tests whether a particular data area contains a specified value. Depending on the outcome of this test, the REPAIR utility performs the following actions:
  • If the data area does contain the value, subsequent operations in the same LOCATE block are allowed to proceed.
  • If any data area does not contain its specified value, all subsequent operations in the same LOCATE block are inhibited.

LOCATE block: VERIFY statement option descriptions

OFFSET
Locates the data that is to be tested by a relative byte address (RBA) within the row or page.
integer
Identifies the offset as an integer.

The default value is 0, the first byte of the area that is identified by the previous LOCATE statement.

X'byte-string'
Identifies the offset as one to four hexadecimal characters. You do not need to enter leading zeros. Enclose the byte string between apostrophes, and precede it with X.
DATA
Specifies what data must be present at the current location before a change is made.
Character constants that are specified within the VERIFY DATA option cannot be specified as ASCII or Unicode character strings. No conversion of the values is performed. To use this option when the table space is ASCII or Unicode, you should specify the values as hexadecimal constants.
X'byte-string'
Specifies an even number, from 2 to 32, of hexadecimal characters that must be present. You do not need to enter leading zeros. Enclose the byte string between apostrophes, and precede it with X.
'character-string'
Specifies any character string that must be present.

LOCATE block: REPLACE statement

The REPLACE statement replaces data at a particular location. The statement is contained within a LOCATE block. If any VERIFY statement within that block finds a data area that does not contain its specified data, the REPLACE operation is inhibited.

LOCATE block: REPLACE statement option descriptions

RESET
Specifies that the inconsistent data indicator is to be reset. A page for which this indicator is on is considered in error, and the indicator must be reset before you can access the page. Numbers of pages with inconsistent data are reported at the time that they are encountered.

The option also resets the PGCOMB flag bit in the first byte of the page to agree with the bit code in the last byte of the page.

OFFSET
Indicates where data is to be replaced by a relative byte address (RBA) within the row or page. Only one OFFSET and one DATA specification are acted on for each REPLACE statement.
integer
Specifies the offset as an integer.

The default value is 0, the first byte of the area that is identified by the previous LOCATE statement.

X'byte-string'
Specifies the offset as one to four hexadecimal characters. You do not need to enter leading zeros. Enclose the byte string between apostrophes, and precede it with X.
DATA
Specifies the new data that is to be entered. Only one OFFSET and one DATA specification are acted on for each REPLACE statement.
Important: Start of changeDo not run REPAIR with the REPLACE, OFFSET, and DATA options on a compressed table space.End of change
Character constants that are specified within the VERIFY DATA option cannot be specified as ASCII or Unicode character strings. The values are not converted. To use this option when the table space is ASCII or Unicode, specify the values as hexadecimal constants.
X'byte-string'
Specifies an even number, from 2 to 32, of hexadecimal characters that are to replace the current data. You do not need to enter leading zeros. Enclose the byte string between apostrophes, and precede it with X.
'character-string'
Specifies any character string that is to replace the current data.

LOCATE block: DELETE statement

The DELETE statement deletes a single row of data that has been located by a RID or KEY option. The statement is contained within a LOCATE block. If any VERIFY statement within that block finds a data area that does not contain its specified data, the DELETE operation is inhibited.

The DELETE statement operates without regard for referential constraints. If you delete a parent row, its dependent rows remain unchanged in the table space.

In any LOCATE block, you can include no more than one DELETE option.

If you have coded any of the following options, you cannot use DELETE:
  • The LOG NO option on the REPAIR statement
  • A LOCATE INDEX statement to begin the LOCATE block
  • The PAGE option on the LOCATE TABLESPACE statement in the same LOCATE block
  • A REPLACE statement for the same row of data

When you specify LOCATE ROWID for a LOB table space, the LOB that is specified by ROWID is deleted with its index entry. All pages that are occupied by the LOB are converted to free space. The DELETE statement does not remove any reference to the deleted LOB from the base table space.

Start of changeWhen you specify LOCATE DOCID for an XML table space, the XML document that is specified by DOCID is deleted with its NodeID index entries. All rows that are occupied by the XML document are deleted from the XML table space. The DELETE statement does not remove any reference to the deleted XML document from the base table space. The LOCATE DOCID statement is generated by CHECK DATA SHRLEVEL CHANGE in order to remove corrupted XML documents from the XML table space.End of change

Start of changeREPAIR DELETE can delete the following data rows when the specified conditions exists: End of change

Start of change
  • A compressed row without an index defined on the table
  • A compressed row with an index defined on the table and a valid dictionary exists to decompress the row
  • A compressed or uncompressed data row that is missing an index entry
  • A compressed row with an index defined on the table, but the dictionary is invalid
  • An uncompressed row without an index
  • An uncompressed row with valid Index
End of change

LOCATE block: DELETE statement option descriptions

Start of changeDATAONLYEnd of change
Start of changeSpecifies that REPAIR should delete only the data record that is specified by the LOCATE RID statement. Any associated indexes, LOB columns, XML columns, or referential integrity constraints are not deleted.

You can specify the DATAONLY option only when REPAIR locates a single row by using a RID.

If the table has indexes or LOB or XML columns, ensure that after you run the DELETE DATAONLY statement, the data is consistent with the other associated objects.

End of change

LOCATE block: DUMP statement

The DUMP statement produces a hexadecimal dump of data that is identified by offset and length. DUMP statements have no effect on VERIFY or REPLACE operations.

When you specify LOCATE ROWID for a LOB table space, one or more map or data pages of the LOB are dumped. The DUMP statement dumps all of the LOB column pages if you do not specify either the MAP or DATA keyword.

LOCATE block: DUMP statement option descriptions

OFFSET
Optionally, locates the data that is to be dumped by a relative byte address (RBA) within the row or page.
integer
Specifies the offset as an integer.

The default value is 0, the first byte of the row or page.

X'byte-string'
Specifies the offset as one to four hexadecimal characters. You do not need to enter leading zeros. Enclose the byte string between apostrophes, and precede it with X.
LENGTH
Optionally, specifies the number of bytes of data that are to be dumped. If you omit both LENGTH and PAGE, the dump begins at the specified OFFSET and continues to the end of the row or page.
If you specify a number of bytes (with LENGTH) and a number of pages (with PAGE), the dump contains the same relative bytes from each page. That is, from each page you see the same number of bytes, beginning at the same offset.
X'byte-string'
Specifies one to four hexadecimal characters. You do not need to enter leading zeros. Enclose the byte string between apostrophes, and precede it with X.
integer
Specifies the length as an integer.
PAGES
Optionally, specifies a number of pages that are to be dumped. You can use this option only if you used PAGE in the preceding LOCATE TABLESPACE control statement.
X'byte-string'
Specifies one to four hexadecimal characters. You do not need to enter leading zeros. Enclose the byte string between apostrophes, and precede it with X.
integer
Specifies the number of pages as an integer.
*
Specifies that all pages from the starting point to the end of the table space or partition are to be dumped.
MAP pages
Specifies that only the LOB map pages are to be dumped.

pages specifies the number of LOB map pages that are to be dumped. If you do not specify pages, all LOB map pages of the LOB that is specified by ROWID and version are dumped.

DATA pages
Specifies that only the LOB data pages are to be dumped.

pages specifies the number of LOB data pages that are to be dumped. If you do not specify pages, all LOB data pages of the LOB that is specified by ROWID and version are dumped.

SET statement

The SET TABLESPACE statement resets the COPY-pending, RECOVER-pending, CHECK-pending, auxiliary warning (AUXW), auxiliary CHECK-pending (ACHKP), and advisory REORG-pending (AREO* and AREOR) statuses for a table space or data set. Start of changeThe SET TABLESPACE statement also turns on and off Persistent Read Only (PRO) restricted status for a table space partition.End of change The SET INDEX statement resets the informational COPY-pending (ICOPY), RECOVER-pending, REBUILD-pending, CHECK-pending , and advisory REORG-pending (AREO* and AREOR) statuses for an index.

Start of changeIf you do not specify a status to reset, REPAIR takes no action.End of change

SET statement option descriptions

SET TABLESPACE database-name.table-space-name
Specifies the table space (and, optionally, the database to which it belongs) whose pending status is to be reset.
database-name
Specifies the name of the database to which the table space belongs.

The default value is DSNDB04.

table-space-name
Specifies the name of the table space.
SET INDEX
Specifies the index whose RECOVER-pending, CHECK-pending, REBUILD-pending, or informational COPY-pending status is to be reset.
(index-name)
Specifies the index that is to be processed. Enclose the index name in quotation marks if the name contains a blank.
(ALL)
Specifies that all indexes in the table space will be processed.

You can also repair all indexes by specifying INDEX(ALL) followed by a table-space-spec.

SET INDEXSPACE
Specifies the index space for the index whose RECOVER-pending, CHECK-pending, REBUILD-pending, or informational COPY-pending status is to be reset.
(database-name.index-space-name)
Specifies the index space that is to be processed.
(ALL)
Specifies that all indexes in the table space will be processed.
PART integer
Specifies a particular partition whose COPY-pending, or RECOVER-pending status is to be reset. If you do not specify PART, REPAIR resets the pending status of the entire table space or index.

integer is the number of the partition and must be in the range from one to the number of partitions that are defined for the

You can specify PART for NOCHECKPEND on a table space, and for NORCVRPEND on indexes.

The PART keyword is not valid for a LOB table space or an index on the auxiliary table.

Start of changeThe PART keyword is not valid when NOAREORPEND is specified because the AREOR state can only be reset for the entire table space or index space.End of change

NOCOPYPEND
Specifies that the COPY-pending status of the specified table space, or the informational COPY-pending (ICOPY) status of the specified index is to be reset.
NORCVRPEND
Specifies that the RECOVER-pending (RECP) status of the specified table space or index is to be reset.
NORBDPEND
Specifies that the REBUILD-pending (RBDP) status, the page set REBUILD-pending status (PSRBDP), or the RBDP* status of the specified index is to be reset.
NOCHECKPEND
Specifies that the CHECK-pending (CHKP) status of the specified table space or index is to be reset.
NOAUXWARN
Specifies that the auxiliary warning (AUXW) status of the specified table space is to be reset. The specified table space must be a base table space or a LOB table space.
NOAUXCHKP
Specifies that the auxiliary CHECK-pending (ACHKP) status of the specified table space is to be reset. The specified table space must be a base table space.
NOAREORPENDSTAR
Resets the advisory REORG-pending (AREO*) status of the specified table space or index.
Start of changeNOAREORPENDEnd of change
Start of changeResets the advisory REORG-pending (AREOR) status of the specified table space or index.End of change
Start of changePROEnd of change
Start of changeTurns on Persistent Read Only (PRO) restricted status for a table space partition. The PART keyword is required for this option.End of change
Start of changeNOPROEnd of change
Start of changeTurns off Persistent Read Only (PRO) restricted status for a table space partition. The PART keyword is required for this option.End of change
RBDPEND
Specifies that the REBUILD-pending (RBDP) status is to be set on the specified index.
PSRBDPEND
Specifies that the PAGE SET REBUILD-pending (PSRBDP) status is to be set on the specified index.

DBD statement

Use the DBD statement to perform one or more of the following actions:

  • Compare the database definition (DBD) in the DB2® catalog with its definition in the DB2 directory
  • Rebuild a database definition in the directory by using the information, including LOB information, in the DB2 catalog
  • Drop an inconsistent database definition from the DB2 catalog and the DB2 directory

For more information about how to use the DBD statement to perform these actions, see Repairing DBDs.

DBD statement option descriptions

DROP
Specifies that the named database is to be dropped from both the DB2 catalog and the DB2 directory. When you specify this option, DB2 also drops databases that contain tables that have been created with RESTRICT ON DROP. Use this keyword if the SQL DROP DATABASE statement fails because the description of the database is not in both the DB2 catalog and the DB2 directory. If you cannot use the ALTER command to remove the with RESTRICT ON DROP option on tables in a database that is badly damaged and you need to drop the database, you can use this keyword to drop the database.
Attention: Use the DROP option with extreme care. Using DROP can cause additional damage to your data. For more assistance, you can contact IBM® Software Support.
DATABASE database-name
Specifies the target database.

database-name is the name of the target database, which cannot be DSNDB01 (the DB2 directory) or DSNDB06 (the DB2 catalog).

If you use TEST, DIAGNOSE, or REBUILD, database-name cannot be DSNDB07 (the work file database).

If you use DROP, database-name cannot be DSNDB04 (the default database).

DBID X'dbid'
Specifies the database descriptor identifier for the target database.

dbid is the database descriptor identifier.

TEST
Specifies that a DBD is to be built from information in the DB2 catalog, and is to be compared with the DBD in the DB2 directory. If you specify TEST, DB2 reports significant differences between the two DBDs.

If the condition code is 0, the DBD in the DB2 directory is consistent with the information in the DB2 catalog.

If the condition code is not 0, then the information in the DB2 catalog and the DBD in the DB2 directory might be inconsistent. Run REPAIR DBD with the DIAGNOSE option to gather information that is necessary for resolving any possible inconsistency.

DIAGNOSE
Specifies that information that is necessary for resolving an inconsistent database definition is to be generated. Like the TEST option, DIAGNOSE builds a DBD that is based on the information in the DB2 catalog and compares it with the DBD in the DB2 directory. In addition, DB2 reports any differences between the two DBDs, and produces hexadecimal dumps of the inconsistent DBDs.

If the condition code is 0, the information in the DB2 catalog and the DBD in the DB2 directory is consistent.

If the condition code is 8, the information in the DB2 catalog and the DBD in the DB2 directory might be inconsistent.

For further assistance in resolving any inconsistencies, you can contact IBM Software Support.

REBUILD
Specifies that the DBD that is associated with the specified database is to be rebuilt from the information in the DB2 catalog.
Attention: Use the REBUILD option with extreme care, as you can cause more damage to your data. For more assistance, you can contact IBM Software Support.
OUTDDN ddname
Specifies the DD statement for an optional output data set. This data set contains copies of the DB2 catalog records that are used to rebuild the DBD.

ddname is the name of the DD statement.

LEVELID statement

Use the LEVELID statement to accept a down-level page set by changing its level ID. You cannot run REPAIR with any other REPAIR utility control statement.

Important: Accepting the use of a down-level data set might cause data inconsistencies. Problems with inconsistent data that result from resetting the level identifier are the responsibility of the user.

LEVELID statement option descriptions

LEVELID
Indicates that the level identifier of the named table space, table space partition, index, or index space partition is to be reset to a new identifier. Use LEVELID to accept the use of a down-level data set. You cannot specify multiple LEVELID keywords in the same REPAIR control statement.

You cannot use LEVELID with a table space, table space partition, index, or index space partition that has outstanding indoubt log records or pages in the logical page list (LPL).

TABLESPACE database-name.table-space-name
Specifies the table space whose level identifier is to be reset.
database-name
Specifies the name of the database to which the table space belongs.

The default value is DSNDB04.

table-space-name
Specifies the name of the table space.
INDEX
Specifies the index whose level identifier is to be reset.
creator-id
Specifies the creator of the index. Specifying this qualifier is optional.
index-name
Specifies the name of the index. Enclose the index name in quotation marks if the name contains a blank.
You can specify either INDEX or INDEXSPACE to identify an index. To specify multiple indexes, repeat the keyword.
INDEXSPACE
Specifies the index space for the index whose level identifier is to be reset. You can obtain the index space name for an index from the SYSIBM.SYSINDEXES catalog table. The index space name must be qualified.
database-name
Specifies the name of the database to which the index space belongs.
index-space-name
Specifies the name of the index space.
PART
Identifies a partition of the table space or index (including a partition of a data-partitioned secondary index).

Start of changeinteger is the physical partition number. It must be in the range from 1 to the number of partitions that are defined for the table space. The maximum is 4096.End of change

VERSIONS statement

Use the VERSIONS statement to update version information in the catalog and directory for a table space or index with the version information from the system pages of the object. Use REPAIR VERSIONS only after you run the DSN1COPY utility with the OBIDXLAT option to move objects from one DB2 subsystem to another.

VERSIONS statement option descriptions

VERSIONS
Specifies that REPAIR updates the version information in the DB2 catalog or directory for a table space or index with the version information from the system pages of the object.
TABLESPACE database-name.table-space-name
Specifies the table space whose version information is to be updated.
database-name
Specifies the name of the database to which the table space belongs.

The default value is DSNDB04.

table-space-name
Specifies the name of the table space.
INDEX
Specifies the index whose version information is to be updated.
creator-id
Specifies the creator of the index. Specifying this qualifier is optional.
index-name
Specifies the name of the index. Enclose the index name in quotation marks if the name contains a blank.
You can specify either INDEX or INDEXSPACE to identify an index. To specify multiple indexes, repeat the keyword.
INDEXSPACE
Specifies the index space for the index whose level identifier is to be reset. You can obtain the index space name for an index from the SYSIBM.SYSINDEXES catalog table. The index space name must be qualified.
database-name
Specifies the name of the database to which the index space belongs.
index-space-name
Specifies the name of the index space.
PART
Identifies a partition of the table space or index (including a partition of a data-partitioned secondary index).

Start of changeinteger is the physical partition number. It must be in the range from 1 to the number of partitions that are defined for the table space. The maximum is 4096.End of change