IBM Support

Guidelines for Saving and Restoring Access Paths

Troubleshooting


Problem

This document explains the requirements that must be met in order for access paths to be rebuilt if they have been saved.

Resolving The Problem

Saving access paths
You can reduce the time of access path recovery by saving access paths. To save access paths, you can use the access path (ACCPTH) parameter on the Save Changed Objects (SAVCHGOBJ), Save Library (SAVLIB), and Save Object (SAVOBJ) commands.
Normally, the system saves only descriptions of logical files; however, the system saves access paths under the following conditions:

o ACCPTH(*YES) is specified.

o All physical files under the logical file are being saved and are in the same library.

o The logical file is MAINT(*IMMED) or MAINT(*DLY).


Note(s): 

  • The logical file itself is not saved when you have specified the ACCPTH(*YES) parameter. You must save the logical file explicitly. 
     
  • Usage of SAVACT(*SYSDFN) can cause an Access Path to rebuild due to the objects not being guaranteed to be saved in the same state.


Restoring access paths

The system has the ability to restore access paths. It usually restores an access path faster than it rebuilds an access path.
The system can restore access paths if:

o They were previously saved.

o All the physical files on which they depend are restored at the same time.

For example, assume that a logical file is built over a physical file that contains 500,000 records. You have determined through the Display Object Description (DSPOBJD) command that the size of the logical file is about 15 megabytes. In this example, it takes about 50 minutes to rebuild the access path for the logical file. It takes about 1 minute to restore the same access path from a tape. (This assumes that the system builds approximately 10,000 index entries per minute.)

After restoring the access path, you might need to update the file by applying the latest journal changes. For example, the system applies approximately 80,000 to 100,000 journal entries to the file per hour. This assumes that each of the physical files to which entries are being applied has only one access path built over it. This rate drops proportionally for each access path of *IMMED maintenance that is present over the physical file. Even with this additional recovery time, you usually find that it is faster to restore access paths than to rebuild them.

o If the logical file exists on the system, it does not specify MAINT(*REBLD). 

o The logical file owned the access path at the time it was saved. If the logical file is created again by the restore operation and it 
shares an access path that already exists, the key length for the access path must be equal to the maximum key length of the logical file or you receive an error. 

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Component":"DB2 for IBM i","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB68","label":"Power HW"}}]

Historical Number

550536194

Document Information

Modified date:
12 November 2025

UID

nas8N1012506