SQL/MP Installation and Management Guide

Moving a Database
HP NonStop SQL/MP Installation and Management Guide523353-004
9-27
Example of Moving a Database
3. Determine the dependencies with the DISPLAY USE OF command or with
catalog queries.
The layout of the dependencies determines the structure of the correct
DUP command used in Step 5. For more information about interpreting
dependencies, see Catalog Mapping Schemes for DUP
on page 9-30.
4. If you need a consistent copy of these tables, check that the SQL objects
are not in use.
5. Perform the DUP or BACKUP/RESTORE command.
This example uses the DUP command, but you can use either utility. The
DUP command requires that you create new catalogs before you perform the
move operation. You might want to create an OBEY command file for the
following statements and commands.
>>CREATE CATALOG $DATA1.INVENT;
--- SQL operation complete.
>>CREATE CATALOG $DATA1.PERSNL;
--- SQL operation complete.
>>CREATE CATALOG $DATA1.SALES;
--- SQL operation complete.
>>DUP ($DATA.INVENT.*, $DATA.PERSNL.*, $DATA.SALES.*),
+> MAP NAMES ( $DATA.INVENT.* TO $DATA1.INVENT.*,
+> $DATA.PERSNL.* TO $DATA1.PERSNL.*,
+> $DATA.SALES.* TO $DATA1.SALES.*),
+> CATALOG ($DATA1.INVENT FOR $DATA1.INVENT.*,
+> $DATA1.PERSNL FOR $DATA1.PERSNL.*,
+> $DATA1.SALES FOR $DATA1.SALES.*),
+>ALLOWERRORS ON, LISTALL;
DUPLICATED TABLE $DATA.INVENT.ERRORS TO $DATA1.INVENT.ERRORS
DUPLICATED TABLE $DATA.INVENT.PARTLOC TO
$DATA1.INVENT.PARTLOC
DUPLICATED TABLE $DATA.INVENT.PARTSUPP TO
$DATA1.INVENT.PARTSUPP
INDEX $DATA.INVENT.XSUPORD TO
$DATA1.INVENT.XSUPORD
DUPLICATED TABLE $DATA.INVENT.SUPPLIER TO
$DATA1.INVENT.SUPPLIER
INDEX $DATA.INVENT.XSUPPNAM TO
$DATA1.INVENT.XSUPPNAM
DUPLICATED TABLE $DATA.PERSNL.DEPT TO $DATA1.PERSNL.DEPT
INDEX $DATA.PERSNL.XDEPTMGR TO
$DATA1.PERSNL.XDEPTMGR
INDEX $DATA.PERSNL.XDEPTRPT TO
$DATA1.PERSNL.XDEPTRPT
DUPLICATED TABLE $DATA.PERSNL.EMPLOYEE TO
$DATA1.PERSNL.EMPLOYEE
Example 9-1. Example of Moving the Sample Database (page 2 of 5)