How to restore physical files containing corrupt records

Source: Internet
Author: User
How to restore a physical file if a corrupted log occurs when a physical file is not activated.
Follow these steps to restore the records that are not damaged in the physical file:

1. On the OS/400 command line, type the following command:

Ovrdbf file (LIBA/file) seqonly (* Yes 1)

Note: This command ensures that the physical file is processed sequentially and only one record is processed.

2. Run the following command:

Cpyf fromfile (LIBA/file) tofile (qtemp/x) crtfile (* yes) +
Fromrcd (1) errlvl (999) compress (* yes)

Note: The file qtemp/X is also saved on the tape.

3. Delete physical files containing damage records:

Dltf file (LIBA/file)

Note: If the physical file is related to a logical file, rename the relevant logical file first,
Stored in the same database.

4. Put the files stored in qtemp back into the original Library:

Movobj OBJ (qtemp/x) objtype (* file) tolib (LIBA)

Note: If the physical file is related to a logical file, re-create it on the new physical file.
The corresponding logical file.

5. Delete all old logical and physical files:
Dltf file (LIBA/all_logicals_over_renamed_physical)
Dltf file (LIBA/renamed_physical)

Note:
-Run the command cpyf to obtain a record file containing all the accessible files, and the corrupted records will be written into the job log (joblog ).
The errlvl parameter is considered as a tolerable threshold for the maximum damage records. When the threshold value is exceeded, the cpyf command stops. -After the command cpyf is executed, you can compare the number of records of two files (qtemp/X and LIBA/file). If the number of records is the same,
This indicates that the data in the physical file is not lost. If the number of records is different, data is lost.
Recover the data, such as the backup tape.

-When the parameter compress in the Command cpyf is set to * No, the deleted records in the old file will also be copied to the new file.

-The fromrcd (1) parameter in the Command cpyf is specified to avoid the destruction of the access path of the physical file when the command is run.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.