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-35
Examples of Using DUP to Copy Tables
DDL lock mechanism. You can examine metadata to get the latest information.
The DUP operation has the option to log these progress reports to an OSS text file.
See Section 8, Querying SQL/MX Metadata for instructions on how to access
information from the DDL_LOCKS table.
For more information about DDL lock considerations for the DUP utility, see the
SQL/MX Reference Manual.
Examples of Using DUP to Copy Tables
This example copies the partitions of the source table (using a different catalog and
schema) to the same locations:
DUP mycat.myschema.mytable1 TO mycat1.myschema1.*;
This example copies the partitions of the source table on $data1 and $data2 to the
partitions of the target table on $data2 and $data3 respectively. If there is no PART
clause for a specific volume and source partitions exist on that volume, the target
partitions are created on the same volume as the source partitions.
DUP mycat.myschema1.mytable TO *.myschema2.*
LOCATION (PART $data1 TO $data2, PART $data2 TO $data3);
This example copies the partitions of the source table to the same locations. The target
table, if it exists, is dropped, and a new one is created:
DUP mycat1.myschema.mytable TO mycat2.*.*,TARGET PURGE;
Using PURGEDATA to Delete Data From
Tables
PURGEDATA is a syntax-based utility you can execute from MXCI to delete data from
a table and its related index or from the specified partitions of a table that has no index.
For more information about the PURGEDATA utility, see the SQL/MX Reference
Manual.
Guidelines for Using PURGEDATA
The PURGEDATA requester must own the schema where the table resides, have
SELECT and DELETE privileges on the table being purged, or be the super ID
user. An error is returned if an access violation occurs.
The table name you specify with PURGEDATA can exist in a catalog defined on a
remote node and be referenced by the current PURGEDATA operation if the
remote node is visible to the local node.
If PURGEDATA fails because of a process, processor, or system failure, use the
RECOVER command to resume the operation. RECOVER returns an error if it
cannot resume the operation.