Troubleshooting
Problem
This document provides information about running the reorganization when it is likely that the RGZPFM command will exceed the available storage on your system.
Resolving The Problem
If you have a physical file (table) that is likely to cause the RGZPFM command to exceed the available storage on your system and the physical file does NOT have any LOB (large objects - data type BLOB, CLOB, DBCLOB) columns, consider running the reorganization in the following manner:
Note that the technique in this document should not be used on files that contain LOB fields (BLOB, CLOB, or DBCLOB). There is no way to get LOB data to copy to a tape file. Only the buffer value (which would contain just the LOB pointer (or substituted value) would be copied. So the CPYF with COMPRESS(*YES) to TAPEFILE will appear to work; however, when the CPYFRMTAP is done, there may be errors that occur (such as MCH3601) or, at the very least, the LOB data will be lost.
Note: You may want to also consider the following options if the above steps are not possible.
1. If arrival sequence (first in, first out) is not required, turn on Reuse Deleted Records by CHGPF.
Check current setting via DSPFD's Reuse deleted records (REUSEDLT) value.
2. Use reorg while active. The journal receiver will take up space. Consider setting the threshold size of the Journal Receiver lower to allow them to be deleted when system no longer requires that receiver.
See TechNote N1011025 "RGZPFM - Basics on Reorganize While Active" for more details
| 1. | Ensure you have a good backup of the physical file. |
| 2. | Save the related logical files to tape. |
| 3. | Delete the related logical files (indexes) |
| 4. | On the operating system command line, type the following: OVRTAPF FILE(QTAPE) DEV(tapdev) LABEL(library_name_of_file) RCDLEN(put length of record per DSPFD) BLKLEN(*CALC) RCDBLKFMT(*FB) EXPDATE(*PERM) Press the Enter key. |
| 5. | On an operating system command line, type the following: CPYF FROMFILE(-your IBM i library-/-your IBM i file-) TOFILE(QTAPE) FROMRCD(1) ERRLVL(999) COMPRESS(*YES) Press the Enter key. Run this command two times to different tapes to reduce the chance of problems due to media errors. Note: The COMPRESS(*YES) option removes the deleted records. |
| 6. 7. |
CLRPFM of the physical. Use the CPYFRMTAP command to copy the data back to the physical file. On an operating system command line, type the following: CPYFRMTAP FROMFILE(QTAPE) TOFILE(-your IBM i library-/-your IBM i file-) TOMBR(*FIRST) FROMDEV(tapdev) FROMRCDLEN(*CALC) MBROPT(*REPLACE) FROMBLKLEN(*CALC) FROMRCDBLK(*FB) Press the Enter key. |
| 8. | On an operating system command line, type the following: DLTOVR FILE(*all) Press the Enter key. |
| 9. | Restore the logical files. The logical files will be built using the QDBSRVxx jobs. Use the EDTRBDAP command to view and maintain the rebuilds of the access paths. |
Note: You may want to also consider the following options if the above steps are not possible.
1. If arrival sequence (first in, first out) is not required, turn on Reuse Deleted Records by CHGPF.
Check current setting via DSPFD's Reuse deleted records (REUSEDLT) value.
2. Use reorg while active. The journal receiver will take up space. Consider setting the threshold size of the Journal Receiver lower to allow them to be deleted when system no longer requires that receiver.
See TechNote N1011025 "RGZPFM - Basics on Reorganize While Active" for more details
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000001hrpAAA","label":"IBM i Db2->RGZPFM - Reorganize Physical File"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Version(s)","Line of Business":{"code":"LOB57","label":"Power"}}]
Historical Number
N1018288
Was this topic helpful?
Document Information
Modified date:
07 July 2020
UID
nas8N1018288