How to find out which tables in a tablespace are in check pending then run a CHECK DATA utility to correct the problem.
DB2 for Z/OS
Release : R20
Records loaded to a tablespace that impact referential integrity where the data validity has not been checked by DB2.
Using the RI/TS combination RC/Query is able to display the Tablespaces in a Database that are in Check Pending status.
RQRITS 20.0 ------ RC/Q R/I Check Pending/Tablespace ------ yyyy/mm/dd hh:mm
COMMAND ===> SCROLL ===> CSR
DB2 Object ===> RI Option ===> TS Where => N
Table Space ===> * > Creator ===> * >
Database ===> DCDCYP > N/A ===> * >
Loc: LOCAL ---------- SSID: ssid ----------authid1 - LINE 01 OF 11 >
CMD TBLSPACE CREATOR CREATEDBY DATABASE STS N. TBLS
________ TDCDDSTC DCDCYP DCDADM DCDCYP P 1
________ TDCDDSTM DCDCYP DCDADM DCDCYP P 1
________ TDCDEXRL DCDCYP DCDADM DCDCYP P 1
________ TDCDIMSL DCDCYP DCDADM DCDCYP P 1
________ TDCDPCC DCDCYP DCDADM DCDCYP P 1
________ TDCDPOLR DCDCYP DCDADM DCDCYP P 1
________ TDCDPRC DCDCYP DCDADM DCDCYP P 1
________ TDCDSA DCDCYP DCDADM DCDCYP P 1
________ TDCDSCNC DCDCYP DCDADM DCDCYP P 1
________ TDCDSM DCDCYP DCDADM DCDCYP P 1
________ TDCDSRC DCDCYP DCDADM DCDCYP P 1
Display a tablespace that was listed to see the DB2 status using the "TS DISpl " tablespace options command.
RQRITS 20.0 ------ RC/Q R/I Check Pending/Tablespace ------ yyyy/mm/dd hh:mm
COMMAND ===> SCROLL ===> CSR
DB2 Object ===> RI Option ===> TS Where => N
Table Space ===> * > Creator ===> * >
Database ===> DCDCYP > N/A ===> * >
Loc: LOCAL ---------- SSID: ssid ----------authid1 - LINE 01 OF 11 >
CMD TBLSPACE CREATOR CREATEDBY DATABASE STS N. TBLS
________ TDCDDSTC DCDCYP DCDADM DCDCYP P 1
________ TDCDDSTM DCDCYP DCDADM DCDCYP P 1
________ TDCDEXRL DCDCYP DCDADM DCDCYP P 1
________ TDCDIMSL DCDCYP DCDADM DCDCYP P 1
________ TDCDPCC DCDCYP DCDADM DCDCYP P 1
________ TDCDPOLR DCDCYP DCDADM DCDCYP P 1
________ TDCDPRC DCDCYP DCDADM DCDCYP P 1
TS DISpl TDCDSA DCDCYP DCDADM DCDCYP P 1
________ TDCDSCNC DCDCYP DCDADM DCDCYP P 1
________ TDCDSM DCDCYP DCDADM DCDCYP P 1
________ TDCDSRC DCDCYP DCDADM DCDCYP P 1
------------------- DB2 Command Processor ------------------- yyyy/mm/dd hh:mm
COMMAND ===> SCROLL ===> PAGE
------------------------------------------------------------ User ID: authid1
¦ -DIS DB(DCDCYP) SPACE(TDCDSA) LIMIT(*) ¦
¦ ¦
¦ ¦
¦ ¦
********************************* TOP OF DATA *********************************
DSNT360I !ssid ***********************************
DSNT361I !ssid * DISPLAY DATABASE SUMMARY
* GLOBAL
DSNT360I !ssid ***********************************
DSNT362I !ssid DATABASE = DCDCYP STATUS = RW
DBD LENGTH = 157472
DSNT397I !ssid
NAME TYPE PART STATUS PHYERRLO PHYERRHI CATALOG PIECE
-------- ---- ----- ----------------- -------- -------- -------- -----
TDCDSA TS 0001 RW,CHKP,COPY
TDCDSA TS
******* DISPLAY OF DATABASE DCDCYP ENDED **********************
DSN9022I !ssid DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION
The status above can be seen to indeed be in CHKP.
PF3 back to the previous screen and enter the "T L" line command to see the tables in the tablespace.
RQRITS 20.0 ------ RC/Q R/I Check Pending/Tablespace ------ yyyy/mm/dd hh:mm
COMMAND ===> SCROLL ===> CSR
DB2 Object ===> RI Option ===> TS Where => N
Table Space ===> * > Creator ===> * >
Database ===> DCDCYP > N/A ===> * >
Loc: LOCAL ---------- SSID: ssid ----------authid1 - LINE 01 OF 11 >
CMD TBLSPACE CREATOR CREATEDBY DATABASE STS N. TBLS
________ TDCDDSTC DCDCYP DCDADM DCDCYP P 1
________ TDCDDSTM DCDCYP DCDADM DCDCYP P 1
________ TDCDEXRL DCDCYP DCDADM DCDCYP P 1
________ TDCDIMSL DCDCYP DCDADM DCDCYP P 1
________ TDCDPCC DCDCYP DCDADM DCDCYP P 1
________ TDCDPOLR DCDCYP DCDADM DCDCYP P 1
________ TDCDPRC DCDCYP DCDADM DCDCYP P 1
T L_____ TDCDSA DCDCYP DCDADM DCDCYP P 1
________ TDCDSCNC DCDCYP DCDADM DCDCYP P 1
________ TDCDSM DCDCYP DCDADM DCDCYP P 1
________ TDCDSRC DCDCYP DCDADM DCDCYP P 1
******************************* BOTTOM OF DATA ********************************
One table is found in the tablespace selected:
RQTL 20.0 --------------- RC/Q Table List --------------- yyyy/mm/dd hh:mm
COMMAND ===> SCROLL ===> CSR
DB2 Object ===> T Option ===> L Where => N
Table Name ===> SCANALERT > Creator ===> DCDCYP >
Qualifier ===> * > N/A ===> * >
Loc: LOCAL ---------- SSID: ssid LVL: 01 -authid1 - LINE 1 OF 1 >
CMD TABLE NAME CREATOR DATABASE TBLSPACE COL_CNT NUMBER OF ROWS
________ SCANALERT DCDCYP DCDCYP TDCDSA 3 13,858
******************************* BOTTOM OF DATA ********************************
PF3 back to the previous screen....
Using the "TS CHECK" line command combination, generate JCL to run a Check utility on the tablespace:
RQRITS 20.0 ------ RC/Q R/I Check Pending/Tablespace ------ yyyy/mm/dd hh:mm
COMMAND ===> SCROLL ===> CSR
DB2 Object ===> RI Option ===> TS Where => N
Table Space ===> * > Creator ===> * >
Database ===> DCDCYP > N/A ===> * >
Loc: LOCAL ---------- SSID: ssid ----------authid1 - LINE 01 OF 11 >
CMD TBLSPACE CREATOR CREATEDBY DATABASE STS N. TBLS
________ TDCDDSTC DCDCYP DCDADM DCDCYP P 1
________ TDCDDSTM DCDCYP DCDADM DCDCYP P 1
________ TDCDEXRL DCDCYP DCDADM DCDCYP P 1
________ TDCDIMSL DCDCYP DCDADM DCDCYP P 1
________ TDCDPCC DCDCYP DCDADM DCDCYP P 1
________ TDCDPOLR DCDCYP DCDADM DCDCYP P 1
________ TDCDPRC DCDCYP DCDADM DCDCYP P 1
TS CHECK TDCDSA DCDCYP DCDADM DCDCYP P 1
________ TDCDSCNC DCDCYP DCDADM DCDCYP P 1
________ TDCDSM DCDCYP DCDADM DCDCYP P 1
________ TDCDSRC DCDCYP DCDADM DCDCYP P 1
******************************* BOTTOM OF DATA *******************************
In this sample the RC/Query profile is set to use IBM utilities so IBM CHECK utility will be generated.
The CHECK DATA input screen is displayed.
RQLUTL 20.0 -------------- RC/Q Line Utilities ------------- yyyy/mm/dd hh:mm
COMMAND ===> SCROLL ===> CSR
CHECK DATA
TABLESPACE DCDCYP__ . TDCDSA__
CLONE S NO _ YES
SORTDEVT SYSDA___
SORTNUM 03
USE THESE OPTIONS FOR ALL SELECTED OBJECTS: S NO _ YES
JCL Generated
(job card)
//*
//* CD hlq.CDBAMDL(MJUTLCD1) authid1
//UTIL0001 EXEC PGM=DSNUTILB,REGION=4096K,PARM='ssid'
//STEPLIB DD DISP=SHR,DSN=hlq.SDSNEXIT
// DD DISP=SHR,DSN=hlq.SDSNLOAD
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSERR DD UNIT=SYSDA,DISP=(,PASS),
// SPACE=(CYL,(4,1))
//SYSUT1 DD UNIT=SYSDA,DISP=(,PASS),
// SPACE=(CYL,(4,1))
//SORTOUT DD UNIT=SYSDA,DISP=(,PASS),
// SPACE=(CYL,(4,1))
//SYSIN DD *
CHECK DATA TABLESPACE DCDCYP.TDCDSA
SCOPE ALL
SORTDEVT SYSDA SORTNUM 03
/*
After the utility has been executed a report will show if further corrective action is required or the status of CHKP will be cleared.
Note that the tablespace is also in COPY Pending. Like the CHECK Utility, a COPY utility can be generated using the "TS COPY" line command combination to create an image copy.