SQL/MX 3.2 Management Manual (H06.25+, J06.14+)

Table Of Contents
5 Creating an SQL/MX Database
When you install and initialize NonStop SQL/MX on a system node, NonStop SQL/MX creates
the system catalog and several system schema. After the installation is complete, you can create
your own user catalogs and schemas. Creating a catalog updates the system schema. The definition
schema for a user catalog is created when you create the first schema in that catalog. For more
information , see the “Creating SQL/MX Metadata” (page 75).
Before you create your SQL/MX database, read:
“Preparing to Create Your SQL/MX Database” (page 72)
“SQL/MX Subvolume and File Naming Guidelines” (page 72)
Creating an SQL/MX database involves these basic tasks:
Create catalogs and schemas. See “Creating Catalogs” (page 76) and “Creating Schemas
(page 77).
Understand how to assign the appropriate user access privileges for SQL/MX objects. See
Access Privileges for SQL/MX Database Objects” (page 78)
Create SQL/MX tables. See “Creating SQL/MX Tables” (page 79).
Create partitions for the SQL/MX tables. See “Creating and Managing Partitions for SQL/MX
Tables” (page 82).
Create indexes on the tables. See “Creating Indexes for SQL/MX Tables” (page 95).
Create partitions for SQL/MX indexes. See “Creating and Managing Partitions for SQL/MX
Indexes” (page 97).
Create constraints on one or more columns of a table. See “Creating Constraints on SQL/MX
Tables” (page 98).
Create a view of a table. See “Creating Views of SQL/MX Tables” (page 100).
Create triggers. See “Creating Triggers” (page 101).
Create stored procedures. See “Creating Stored Procedures in Java” (page 101).
Improve database performance in an OLTP environment. See “Database Design Guidelines
for Improving OLTP Performance” (page 101).
For more information, see the SQL/MP Installation and Management Guide.
Preparing to Create Your SQL/MX Database
Before you begin to create your SQL/MX database, first plan the database and define its layout
as described in “Understanding and Planning SQL/MX Tables” (page 28). Also plan your security,
TMF requirements, RDF requirements, and recovery mechanisms as described in “Planning Database
Security and Recovery” (page 41).
After you create the database, you can load the data into the SQL/MX tables, compile your
application programs, and start running your applications. For more information, see “Managing
Database Applications” (page 209).
SQL/MX Subvolume and File Naming Guidelines
Before you build your SQL/MX database, familiarize yourself with the rules for naming SQL/MX
subvolumes and files. These rules are always followed when NonStop SQL/MX generates file
names and are enforced by NonStop SQL/MX for user-specified names. These rules are in addition
to Guardian naming rules already enforced by the Guardian file system.
72 Creating an SQL/MX Database