The associated records need to be dumped, deleted and then modified within limits before they are reloaded, so that they are no longer hitting the 32K limit.
- The exported information will show the content of the records and specifically that of the key fields, which will provide further clues as to what is causing the record expansion.
- While only the recids in question need to be fixed, it is recommend to also take a look at those records in this table that are approaching the record limit and may cause similar problems in the near future.
1. Isolate records approaching 32K limits
DEFINE VARIABLE i AS INTEGER NO-UNDO.
FOR EACH <tablename> NO-LOCK:
IF RECORD-LENGTH(<tablename>) >= 30100 THEN
IF AVAILABLE <tablename> THEN DO:
OUTPUT TO bigrecs.txt APPEND.
PUT RECID(<tablename>) RECORD-LENGTH(<tablename>) SKIP.
EXPORT <tablename>.
OUTPUT CLOSE.
i = i + 1.
END.
END.
DISP i.
2. Delete these RecordsThe records can be deleted using the reported RECIDS through IDXFIX, Option 6. Refer to Article
or by using the recid to delete the record with ABL:
FIND FIRST <tablename> WHERE RECID(<tablename>) = <RECID>.
DELETE <tablename>.
3. Modify the record content and import the records back
Open ‘
bigrecs.txt’ created in Step 1. After reviewing and amending the content accordingly, rename the file (
fixthisrecord2) to use to import the records.
INPUT FROM VALUE ('./fixthisrecord2.out').
DO WHILE NOT ERROR-STATUS:ERROR TRANSACTION:
CREATE <tablename>.
IMPORT <tablename>.
END.
Similarly, LKE index key are limited to approximately 1970 characters. This means that while the record length may not be anywhere near 32 KB, the sum of the key-fields may be approaching the index size limit. This is not an exact undertaking due to the dynamic nature of the tree structure and in particular index compression algorithms. Never-the-less, an exercise worth undertaking to re-consider the value of having indexes with such large values.
1. Dump the .df for the table through the Data Admin Utility
2. Isolate the key fields for the index
3. Report on the isolated records associated with large key-fields for further investigation
DEFINE VARIABLE i AS INTEGER NO-UNDO.
FOR EACH < tablename > NO-LOCK:
IF LENGTH(< tablename >.< key-field1 >,"RAW") + LENGTH(< tablename >.< key-field2 >,"RAW") > 1900 THEN
IF AVAILABLE < tablename > THEN DO:
OUTPUT TO bigidxContent.txt APPEND.
PUT RECID(< tablename >) RECORD-LENGTH(< tablename >) LENGTH(< tablename >.< key-field1 >,"RAW") + LENGTH(< tablename >.< key-field2 >,"RAW") SKIP.
// EXPORT < tablename >.< key-field1 > < tablename >.< key-field2 >.
OUTPUT CLOSE.
i = i + 1.
END. /* if avail */
END. /* for each */
DISP i.