An NDB full or region canceled event can corrupt an NDB. To recover the data, use the NDB ALTER OPT=BLDX command to rebuild the indexes.
Note: This procedure applies to an IPLOG file. Similar steps apply to all NDBs.
To fix a corrupted NDB
The following shows some sample JCL:
//DEFWRK EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE (hlq.TEST.NDBWORK) CL DEFINE CLUSTER (NAME(hlq.TEST.NDBWORK) - MGMTCLAS(DEFAULT) - STORCLAS(NMDPOOL) - INDEXED - RECORDS(1000000 100000) - SPEED - SHAREOPTIONS(2 3) - ) - DATA (NAME(hlq.TEST.NDBWORK.D) - CONTROLINTERVALSIZE(4096) - RECORDSIZE(1017 4089) - FREESPACE(0 0) - KEYS(4 0) - ) - INDEX (NAME(hlq.TEST.NDBWORK.I) - CONTROLINTERVALSIZE(1024)) /*
ALLOCATE DD=NDBWORK DSN=hlq.TEST.NDBWORK DISP=SHR
Issue the following command to open the work file as a VSAM file.
UDBCTL OPEN=NDBWORK STRNO=3 BUFNI=5 BUFND=6
NDB PURGE IPLOG
NBD STOP IPLOG IMM
NDB ALTER IPLOG OPT=CHKX DB WORK=NDBWORK DETAIL=YES SORT=100000
Minimizing I/O on the work file by specifying the maximum value for sort memory reduces execution time.
UDBCTL CLOSE=NDBWORK UNALLOC DD=NDBWORK
NDB ALTER IPLOG OPT=BLDX DB WORK=NDBWORK DETAIL=YES SORT=100000
Minimizing I/O on the work file by specifying the maximum value for sort memory reduces execution time.
If the NDB ALTER BLDX action fails, the work file must be unallocated and the file must be redefined before you reissue the command.
| Copyright © 2010 CA. All rights reserved. |
|