SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
D-79
Examples—DUP
table will be described in the current default catalog because the CATALOG option
is not specified. The JOB table has no dependent objects.
>> DUP $VOL1.PERSNL.JOB, $NEWVOL.PERSNL.JOB LISTALL;
This command does the same thing:
>> DUP $VOL1.PERSNL.JOB, $NEWVOL.*.* LISTALL;
This example copies table $VOL1.PERSNL.JOB to the remote volume
\SYS2.$NEWVOL, using the same table name as the original. The CATALOG
option specifies a catalog on the remote node in which to describe the new table.
>> DUP $VOL1.PERSNL.JOB,\SYS2.$NEWVOL.PERSNL.JOB,
+> CATALOG \SYS2.$NEWVOL.CAT FOR \SYS2.$NEWVOL.PERSNL.JOB;
This example copies a partitioned table, PARTLOC, that has a primary partition on
$VOL1 and secondary partitions and indexes on $WHS2 and $WHS3. PARTLOC
has an index, PARTIX, and a dependent protection view, PARTVW. The example
copies PARTLOC to subvolumes of the same name on three different volumes,
copying PARTIX and PARTVW also, because the default options INDEXES
IMPLICIT and VIEWS IMPLICIT apply.
>> DUP $VOL1.INVENT.PARTLOC, *.TESTINV.*;
DUPLICATED TABLE $VOL1.INVENT.PARTLOC TO
$VOL1.TESTINV.PARTLOC
PARTS (1, $WHS2 TO $WHS2,
2, $WHS3 TO $WHS3)
INDEX $VOL1.INVENT.PARTIX TO $VOL1.TESTINV.PARTIX
PVIEW $VOL1.INVENT.PARTVW TO $VOL1.TESTINV.PARTVW
This example copies the partitioned table from the previous example to a different
node, \NEWSYS, by using the MAP NAMES option. Objects on $VOL1 are placed
on $NVOL1, objects on $WHS2 are placed on $NVOL2, and objects on $WHS3
are placed on $NVOL3. Subvolume and table names remain the same. The
CATALOG clause specifies a catalog on \NEWSYS in which to describe the new
objects.
>> DUP $VOL1.INVENT.PARTLOC,
+> MAP NAME ( $VOL1.*.* TO \NEWSYS.$NVOL1.*.*,
+> $WHS2.*.* TO \NEWSYS.$NVOL2.*.*,
+> $WHS3.*.* TO \NEWSYS.$NVOL3.*.* )
+> CATALOG \NEWSYS.$NVOL.DB FOR \NEWSYS.*.*.* NO LISTALL;
This example duplicates all tables, collations, and files, but no indexes or views,
that reside on subvolume $VOL1.PERSNL to subvolume $VOL1.NWPERS:
>> DUP $VOL1.PERSNL.*, *.NWPERS.*, INDEXES OFF, VIEWS OFF
+> NO LISTALL;