SQL/MP Installation and Management Guide

Managing Database Applications
HP NonStop SQL/MP Installation and Management Guide523353-004
10-45
Using SQLCI DUP
Example: Method 1 (Moving Programs With DUP)
This DUP command moves these programs to new volumes; namely, $VOL1, $VOL2,
and $VOL3. The MAP NAMES option correctly defines the source and target volumes
for each program. After the DUP operation, the programs are SQL compiled to register
them in the new catalog.
>> DUP ($OLD1.PROGS.*, $OLD2.PROGS.*, $OLD3.PROGS.*)
+> WHERE SQLPROGRAM,
+> MAP NAMES ($OLD1.PROGS.* TO $VOL1.PROGS.*,
+> $OLD2.PROGS.* TO $VOL2.PROGS.*,
+> $OLD3.PROGS.* TO $VOL3.PROGS.*), SAVEALL;
19> VOLUME $VOL1
20> SQLCOMP /IN PROGS.PROGA1, OUT $S.#HOLD/ CATALOG ACCTG
21> SQLCOMP /IN PROGS.PROGB1, OUT $S.#HOLD/ CATALOG SALES
22> SQLCOMP /IN PROGS.PROGC1, OUT $S.#HOLD/ CATALOG ORDERS
23> SQLCOMP /IN PROGS.PROGD1, OUT $S.#HOLD/ CATALOG ORDERS
24> VOLUME $VOL2
25> SQLCOMP /IN PROGS.PROGA2, OUT $S.#HOLD/ CATALOG
$VOL1.ACCTG
26> SQLCOMP /IN PROGS.PROGB2, OUT $S.#HOLD/ CATALOG
$VOL1.SALES
27> SQLCOMP /IN PROGS.PROGC2, OUT $S.#HOLD/ CATALOG
$VOL1.SALES
28> SQLCOMP /IN PROGS.PROGD2, OUT $S.#HOLD/ CATALOG
$VOL1.ORDERS
29> SQLCOMP /IN PROGS.PROGE2, OUT $S.#HOLD/ CATALOG
$VOL1.ORDERS
30> VOLUME $VOL3
31> SQLCOMP /IN PROGS.PROGA3, OUT $S.#HOLD/ CATALOG
$VOL1.ACCTG
32> SQLCOMP /IN PROGS.PROGB3, OUT $S.#HOLD/ CATALOG
$VOL1.SALES
33> SQLCOMP /IN PROGS.PROGC3, OUT $S.#HOLD/ CATALOG
$VOL1.SALES
34> SQLCOMP /IN PROGS.PROGD3, OUT $S.#HOLD/ CATALOG
$VOL1.ORDERS
Example: Method 2 (Moving Programs With DUP)
This method is a multiple-step approach for moving the programs.
1. Obtain a list of the program names from the PROGRAMS table of each catalog.
2. Edit the list, specifying the program names first in DUP commands (or the
corresponding OSS command for SQL programs stored in OSS files) and then in
SQLCOMP (or c89, for OSS) commands to SQL compile the programs before
registering them in the new catalog.