SQL/MX 2.x Installation and Management Guide (H06.10+, J06.03+)
Reorganizing SQL/MX Tables and Maintaining Data
HP NonStop SQL/MX Installation and Management Guide—544536-007
10-43
Examples of Using FASTCOPY to Copy Tables
complete, you can re-enable the triggers using the ALTER TRIGGER ENABLE
command.
The FASTCOPY command checks for the RI constraints that are defined on the
target table. RI constraint checking, like trigger actions, also has a negative
performance impact. To remove the RI and other droppable constraints that would
interfere with a FASTCOPY command, use the
ALTER TABLE...DROP CONSTRAINT command. After the fastcopy operation is
complete, you can re-create such constraints.
Please note that constraint recreation may itself be a long-running operation
because the constraint condition must be verified against the data in the involved
table(s).
•
The FASTCOPY command requires source and target tables to be equivalent.
•
If the INDEXES EXPLICIT option is specified with the FASTCOPY command, you
must specify the matching source and target indexes on the related FASTCOPY
INDEX commands.
If the INDEXES IMPLICIT option is specified (or defaulted to) with the FASTCOPY
command, the system selects a matching source index for each involved target
index.
•
The FASTCOPY command requires select privileges on the source table, and
select, insert, update, and delete privileges on the target table.
•
Use the RECOVER command to explicitly resume or cancel a failed fastcopy
operation.
To recover a failed FASTCOPY TABLE...INDEXES EXPLICIT operation, use the
RECOVER INDEX command. To recover a failed FASTCOPY TABLE...INDEXES
IMPLICIT operation, use the RECOVER TABLE command.
If the CANCEL option is specified, the fastcopy operation is canceled. Any actively
executing FASTCOPY commands associated with the affected fastcopy operation
are terminated.
If the RESUME option is specified, it affects only that target table, mentioned in the
RECOVER command.
Examples of Using FASTCOPY to Copy Tables
Consider a source table ST with indexes SI1 and SI2 and a target table TT with index
TI1.
The following command copies all the rows from the source table to the target table
and automatically maintains index TI1 as part of that copy process.
FASTCOPY TABLE ST TO TT INDEXES IMPLICIT;
The following command copies all the rows from the source table to the target table.
An explicit FASTCOPY of source index SI1 to target index TI1 is required to complete










