SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)
Performing Recovery Operations
HP NonStop SQL/MX Installation and Management Guide—523723-004
12-10
Recovering Tables
For most cases, the recommended approach for recovering a table and its indexes
involves these tasks:
•
Determine what dependent objects (views, indexes, and other tables) might have
been dropped along with the table.
•
Use MXCI to re-create the table, its indexes, and any privileges that you have
granted or revoked. If the SAVE_DROPPED_TABLE_DDL attribute has remained
set ON, use the saved DDL information for re-creating the objects. This information
is preserved in the /usr/tandem/sqlmx/ddl folder.
For complete information on saving DDL and using it to re-create SQL/MX objects,
see these discussions:
°
In this manual, see Retrieving Saved DDL on page 5-26.
°
In the SQL/MX Reference Manual, see the information about the DROP
TABLE statement and table management for metadata tables.
The DDL definition of the newly created table must match exactly the DDL
definition of the dropped table. When you re-create the table, execute all of the
statements in the exact order indicated in the saved DDL. Then use TMF to
recover the files for the tables and indexes.
•
Use the TMFCOM ALTER DUMPS command to reset the INVALID and
RELEASED attributes of the online dumps for the dropped objects to OFF.
•
Recover the partitions of the re-created table and indexes with the TMFCOM
RECOVER FILES command, using the FROMARCHIVE and TOFIRSTPURGE
options. To determine the Guardian names of the purged objects, you can use the
MXGNAMES utility. This utility can also be used to build lists of these Guardian
files for use with TMFCOM commands.
•
For the recovered objects, verify that the creation and redefinition timestamps in
the file labels match those in the SQL/MX metadata, using the mxtool VERIFY
command.
•
For all objects for which VERIFY identifies a mismatch, update the timestamps in
the file labels to match those in the SQL/MX metadata, using the mxtool FIXUP
command.
•
If any views were dropped because of the CASCADE option, be sure to re-create
them.
•
Update the statistics for the recovered table.
Note. If you have granted or revoked table privileges, see Example: Recovering Table
Privileges on page 12-11 for guidelines on how to recover the privileges.
Note. If you use the SHOWDDL output to re-create the table, execute all the statements
in the exact order indicated. Doing so ensures that the table and all associated objects are
properly re-created and can be recovered.