SQL/MP Installation and Management Guide

Moving a Database
HP NonStop SQL/MP Installation and Management Guide523353-004
9-9
Moving the System Catalog
Moving the System Catalog
Although you can move the system catalog to a new location after SQL/MP has been
installed, this operation is extremely complex. You should consider moving the system
catalog only in special cases.
These instructions are based on the assumptions that the TMF subsystem is
operational, that the user is the super ID, and that the SQLCI2 program is on the
$SYSTEM.SYSTEM subvolume and is described in the system catalog.
To move the system catalog, follow these steps:
1. Check that no SQL/MP operations or transactions are in progress during the move
operation. The system catalog should not be moved on an active system.
2. If your system catalog contains SQL objects, perform a BACKUP of the objects
that you want to save, or move the objects to another catalog. You must save the
information because the system catalog must be empty for you to drop it. You can
use this BACKUP command to save the user-defined objects in the system
catalog; enter the command at the command interpreter prompt:
20> BACKUP $TAPE, *.*.* FROM CATALOG sys-catalog, AUDITED,
OPEN, LISTALL
In the BACKUP command, sys-catalog is the volume and subvolume on which
your system catalog resides.
3. If you have only a few objects in the system catalog, purge all objects from the
system catalog except for the CATALOGS table and SQLCI2. Remove the objects
one at a time by using the DROP statement or PURGE command.
If the previous method is impractical because you have many objects, save a copy
of your SQLCI2 program, and then purge everything in the system catalog
(including the SQLCI2 program) with a single command. To save the SQLCI2
program, use DUP to copy the program to a file named ZZSQLCI2. After the
PURGE operation, the INITIALIZE SQL command renames and SQL compiles the
saved copy of SQLCI2.
This command sequence accomplishes these operations:
21> VOLUME $SYSTEM.SYSTEM
22> FUP DUP SQLCI2, ZZSQLCI2, SAVEALL
23> SQLCI
>> PURGE *.*.* FROM CATALOG sys-catalog, ALLOWERRORS ON;
>> INITIALIZE SQL;
In the PURGE command, sys-catalog is the volume and subvolume on which
your system catalog resides.