RDF/IMP, IMPX, and ZLT System Management Manual
NonStop SQL/MX and RDF
HP NonStop RDF/IMP, IMPX, and ZLT System Management Manual—524388-002
15-4
Creating NonStop SQL/MX Primary and Backup
Databases from Scratch
For example, the following command creates a table called TAB1 in schema
PCAT.SCH, with three partitions, located on volumes $DATA02, $DATA03,
$DATA04, respectively.
CREATE TABLE PCAT.SCH.TAB1 (a int not null, b int, primary key (a))
LOCATION $DATA02
PARTITION ( ADD FIRST KEY (100) LOCATION $DATA03,
ADD FIRST KEY (200) LOCATION $DATA04 );
You should specify only the desired volume to allow NonStop SQL/MX to generate
the complete Guardian filenames. This is true for non-partitioned objects as well as
for partitioned objects. Thus, you specify only the volume name in the LOCATION
clause, and NonStop SQL/MX constructs the fully qualified Guardian name for the
object, using:
•
The volume you specified for the object in the LOCATION clause.
•
The subvolume associated with the object's ANSI schema (as indicated in that
portion of the object's ANSI name).
•
The system-generated Guardian filename. In this case, you must obtain the
underlying Guardian filename using SHOWDDL or a metadata query before
you can set up your backup database.
Now, the full CREATE TABLE statement for CAT.SCH.TAB1, including the full
Guardian names of the partitions, can be displayed in MXCI by using the
command:
SHOWDDL PCAT.SCH.TAB1;
Assume the system generates the following Guardian file names:
$DATA02.ZSDXYZ3A.KQY8KY00
$DATA03.ZSDXYZ3A.KQY8RK00
$DATA04.ZSDXYZ3A.KQY8YG00
Note that the volumes specified in the LOCATION clauses of the CREATE TABLE
statement are used and that the subvolume is the subvolume created by the
CREATE SCHEMA statement in Step 3.
If you want to specify the complete Guardian filename for your object yourself, you
must use the LOCATION clause specifying the volume on which you want the
object placed and using the Guardian subvolume associated with the object's
schema. The Guardian filename must be exactly eight characters long and end in
"00" (zero-zero).
You cannot specify a volume and subvolume portion without also specifying the
filename. Note that all NonStop SQL/MX partitions for a table must have the same
Guardian subvolume name but the Guardian filename will not normally be the
same, even if the partitions are on different volumes.