Back Up and Restore SPD Server Table Indexes Using System Full Backups

Back Up and Restore SPD Server Table Indexes Using System Full Backups

Restoring indexes from system full backups and restores is not as clean as restoring indexes from SPD Server full backups and restores. To understand why, consider the two available methods for restoring indexes from a system full backup:
What decides which method to use? You must balance the time and resources needed to back up the index against the time needed to re-create the index when the table is restored.

Method 1 – Restore the Index Dynamically

To restore the index dynamically, you must include the table index files in the full backup and restore of the table. To determine which index files to include, use spdsls with the -i index option. The output lists component files for each table in the domain that is intended for full backup.
When restoring a table, you must first restore the table metadata, data, and index files from the last full backup archive. Then use spdsrstr to perform incremental restores. As the tables are restored, the indexes are dynamically updated to include any new or modified records.
In summary, the first method trades the additional resources required for full backup of the table index files, which can be very large, against the potentially short time that might be required to restore them. You can restore indexes for a table that has not had any incremental changes after the system full backup by using a system full restore.

Method 2 – Recreate the Index after the Table Is Restored

If you use this method, you do not need to include the index files in the table's full backup. Thus, when running spdsls to list the component files for each table in the domain that you intend to back up, leave off the -i index option. The spdsls utility then outputs a list that excludes index files.
A cautionary note about method 2: If you do not save index information, you can experience problems when you attempt to fully restore the table. The reason: the table's metadata will have information about the index files that can be missing or out of date. As a result, the metadata no longer mirrors the table.
Before you can perform an incremental restore of the table, you must first repair the table metadata. To repair the metadata, use PROC DATASETS to modify the table and delete all of the indexes, then run spdsrstr to restore the table. After performing the incremental restores of the table, use PROC DATASETS again to modify the table and create the indexes.
The second method trades the resources that you save by not fully backing up the index files against the greater amount of time it can take to recreate the indexes fully, if the table must be restored.