SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)

Performing Recovery Operations
HP NonStop SQL/MX Installation and Management Guide523723-004
12-21
Recovering Views and Indexes
that was the case, you should re-create the dropped views now, using the DDL you
saved when the view was created.
13. Update the statistics for the recovered table. For more information about the
UPDATE STATISTICS command used for this operation, see the SQL/MX
Reference Manual.
14. Use the DISPLAY USE OF command to identify any SQL modules that access the
recovered table, and perform an explicit SQL recompilation for those modules
using MXCMP or mxCompileUserModule. For more information about DISPLAY
USE OF, see the SQL/MX Reference Manual. For more details about SQL
recompilation, see the SQL/MX Programming Manual for C and COBOL and the
SQL/MX Programming Manual for Java.
Recovering Views and Indexes
If the SQL/MX object purged is a view or an index and its related table still exists in the
system, you can recover the object by simply re-creating it:
An SQL/MX view does not contain data. The data referenced by the view is stored
in the underlying tables. Therefore, you can easily return a purged view to the
database by re-creating the view definition through the original CREATE VIEW
statement, which you should have saved by using the SHOWDDL command when
the view was created. After you recover the view, be sure to make a new online
dump of the view and its related table or tables.
An SQL/MX index specifies an alternate access path to a table. You can recover a
purged index by re-creating it using the original CREATE INDEX statement, which
you should have saved using the SHOWDDL command when the index was
created. This approach ensures that the new index includes keys for all rows of the
table. After you recover the index, be sure to make a new online dump of the index
and its related table.
For more information about SQL/MX views and indexes, see Section 7, Creating an
SQL/MX Database and the SQL/MX Reference Manual.
Restoring Objects With BRCOM RESTORE
Use the BRCOM RESTORE command of Backup and Restore 2 to recover SQL/MX
objects that have been backed up on tape. For this discussion, restoring SQL/MX
objects and databases means you are replacing existing objects in the same location.
Restoring SQL/MP objects is not discussed here. For information on this topic, see the
Backup and Restore 2 Manual and the SQL/MP Installation and Management Guide.
Caution. To ensure that you can recover the table and its indexes again in the future, take
new online dumps of the recovered files now. Also dump any newly created views.