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

Reorganizing SQL/MX Tables and Maintaining Data
HP NonStop SQL/MX Installation and Management Guide523723-004
10-34
Using DUP to Copy Tables Into Tables
Using DUP to Copy Tables Into Tables
DUP is a syntax-based utility you can execute from MXCI to copy a source table—and
optionally its index and constraints—into an existing target table.
For more information about the DUP utility, see the SQL/MX Reference Manual.
Guidelines for Using DUP
You must have select privileges for the source table and must own the schema
where the target table will reside. An error is returned if an access violation occurs.
Referential integrity constraints and triggers are ignored.
The catalog that defines the source table or tables can exist on a remote node and
be referenced by the current DUP operation if the remote node is visible to the
local node. The target table can also exist in a catalog and schema that reside on a
visible remote node. Finally, the Guardian files associated with the source and
target tables can exist on remote nodes if those nodes are visible from the local
node. For more information about node visibility in a distributed environment, see
Section 13, Managing an SQL/MX Distributed Database.
DUP does not check disk space before running the request. You must confirm that
enough disk space is available before running the DUP request. Check the EOF
field of FILE INFO or FUP INFO to identify the size of each partition and determine
whether there is sufficient disk space for the partitions.
DUP displays errors if the source table or target table and its dependent indexes
cannot be accessed or if the load fails in response to a resource or file system
problem.
If the DUP operation fails because the DUP process does fails unexpectedly, use
the RECOVER command to complete or roll back the operation. If the DUP
operation fails after all the data has been successfully copied to the target objects,
specify RECOVER with the RESUME option to complete the DUP operation. If the
DUP operation fails before the data is successfully copied, specify RECOVER with
the CANCEL option to roll back the DUP operation. You can access this status
information by reading the DDL_LOCK metadata table. If you specify the wrong
RECOVER operation, RECOVER reports this so that you can use the correct
operation, possibly with RECOVER...CANCEL. For more information about the
RECOVER command, see the SQL/MX Reference Manual.
During the DUP operation, the target table is marked as corrupt to prevent another
process from viewing the data until the operation completes successfully.
All utility operations have the potential to run for hours, especially those that
involve a great deal of data movement. To manage systems effectively, you need
to know how far the operation has proceeded and how much longer it needs to run.
Utilities provide reports that indicate what step is in progress. Utility operations
periodically place operation progress reports in the metadata tables through the