SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
D-77
Considerations—DUP
Be careful that you define the MAP NAMES and CATALOGS parameters
correctly for dependent tables, indexes, views, and programs. An incorrect
mapping scheme can leave the objects invalid or cause the RESTORE
process to fail.
For example, suppose that base table $A.A.TABLE has two dependent objects:
a protection view located on $A.XX.PVIEW and an index located on
$A.ZZ.IXTAB. To copy the base table and all dependent objects, you must use
a MAP NAMES option that includes all the dependent objects. This MAP
NAMES clause includes all three objects:
MAP NAMES ($A.A.* TO $D.A.*,
$A.XX.* TO $D.XX.*,
$A.ZZ.* TO $D.ZZ.* )
When changing the catalog of the base table, you must also use a complete
CATALOG mapping for all objects.
Duplicating shorthand views might produce unexpected results. For example,
this command produces a view that is identical to the source, but because the
command does not specify naming patterns with wild-card characters, DUP
cannot map the named objects in the view definition:
DUP MGRLIST, MGRLIST2, VIEW EXPLICIT;
This command does not work because DUP cannot map all the objects in the
definition of the view MGRLIST to MGRLIST2:
DUP MGRLIST, MAP NAMES *.*.* TO MGRLIST2
This command duplicates the view as intended (assuming that MGRLIST
references only EMP and DEPT, and that neither EMP nor DEPT is partitioned
or has indexes):
DUP (MGRLIST, EMP, DEPT),
MAP NAMES (MGRLIST TO MGRLIST2,
EMP TO EMP2,
DEPT TO DEPT2),
VIEW EXPLICIT;
To duplicate a table partitioned over multiple nodes, you must use the MAP
NAMES and CATALOGS clauses, and you must specify the remote nodes first
within each clause. (You must not specify the local node first because DUP
ignores a local node specification in these clauses and the resulting fileset
expression matches all nodes.)
For example, this command duplicates the PARTS table, which is partitioned
over two nodes. \LOCAL is the node where the DUP command executes and
\REMOTE is the remote node. The PARTS table partitions are duplicated to the
same volumes and subvolumes as the original table, but with different names.
DUP $VOL1.TESTSUBV.PARTS,
MAP NAMES (
\REMOTE.*.*.* TO \REMOTE.*.*.OLDPARTS,