SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)

Creating an SQL/MX Database
HP NonStop SQL/MX Installation and Management Guide523723-004
7-19
Additional Guidelines for Creating Tables
Example for Creating an SQL/MX Table With a Single Hash
Partition
CREATE TABLE cat1.sch1.ordersh
(location char(16) not null not droppable,
ordernumber integer unsigned not null not droppable,
ordertime timestamp,
primary key (location, ordernumber) not droppable)
location $DATA01
hash partition;
Example for Creating an SQL/MX Table With Multiple Hash
Partitions
CREATE TABLE cat1.sch1.ordersh
(location char(16) not null not droppable,
ordernumber integer unsigned not null not droppable,
ordertime timestamp,
primary key (location, ordernumber) not droppable)
location $DATA01
hash partition(
add location $DATA02,
add location $DATA03);
Additional Guidelines for Creating Tables
When moving a table from a development environment to a production
environment, changes made to the partitioning scheme of the table from one
environment to the next can cause similarity check failures in embedded SQL
programs that query the table. These would include:
°
Changing the columns that compose the table’s partitioning key.
°
Changing from range partitioning to hash partitioning.
°
Changing the number of partitions in the table.
For more information, see similarity check criteria in the SQL/MX Programming
Manual for C and COBOL and the SQL/MX Programming Manual for Java.
Specify table attributes that are best for the performance, access, size, and
protection of the data in the table:
°
Use EXTENTS, MAXEXTENTS, and ALLOCATE, if applicable, for controlling
the size of the table.
°
Use AUDITCOMPRESS to minimize the amount of audit-trail resources
required. Use NO AUDITCOMPRESS if you need to read the complete
before-images and after-images directly from the audit trails.
°
Use the CLEARONPURGE attribute to control the security and the ability to
write to or drop a table. CLEARONPURGE controls the erasure of data from
the disk when an SQL/MX table or index is dropped. When you drop an object