SQL/MP Installation and Management Guide
Moving a Database
HP NonStop SQL/MP Installation and Management Guide—523353-004
9-3
COPY and LOAD
Services Shell and Utilities Reference Manual. The remainder of this subsection
applies to SQL tables, indexes, views, and SQL programs stored in Guardian files.
COPY and LOAD
The COPY and LOAD utilities operate only on tables. You must create a table before
you can copy or load data into it. The CREATE TABLE LIKE statement creates a new
table identical to the original one; this operation simplifies creating a new table. For
additional information about using the COPY and LOAD utilities, see Section 8,
Reorganizing Tables and Maintaining Data, or the SQL/MP Reference Manual.
You can use the COPY command for operations similar to those of the LOAD
command. These differences, however, exist between the two operations:
•
The COPY command can run within a user-defined TMF transaction, but you must
ensure that the audit trails are large enough to contain the data. For LOAD, the
table must be nonaudited; therefore, a TMF transaction is not allowed.
•
The COPY command does not allow the SLACK option.
•
The COPY command can insert data into a table that has data or is empty. The
LOAD command removes any data in the target table before inserting data.
•
A COPY operation is usually slower than an equivalent LOAD operation.
•
COPY can handle two tables whose columns use different collations, while LOAD
cannot.
The success of the COPY and LOAD operations depends upon various factors,
including the software releases of the source and target SQL/MP systems and the
versions of the source and target objects.
A column in a source object can use a different collation than a column in a target
object. COPY and LOAD do not consider whether the source object uses collations;
this situation can cause duplicate key errors.
Caution. Some utilities, as well as SQLCI, let you request purge operations on target files that
fall within the context of the command issued. When you refer to qualified file-set lists in such a
command, the utility might inadvertently purge an object you did not expect to be purged. You
can protect your catalogs, tables, and indexes against the effects of an incorrectly specified file
set list by using SQLCI to assign the NOPURGEUNTIL attribute to these objects.
NOPURGEUNTIL lets you specify an expiration date and time for the objects and prevents
them from being removed before that time.