SQL/MP Installation and Management Guide
Adding, Altering, Removing, and Renaming
Database Objects
HP NonStop SQL/MP Installation and Management Guide—523353-004
7-2
Adding Catalogs
This table summarizes the objects that can be added to the database and the SQL
statements you use to add the objects:
As with any change to the database, the first step is careful planning. Additional
information on creating (adding) objects is located in Section 3, Understanding and
Planning Database Tables, and Section 5, Creating a Database.
All changes to a database require the specified authority for protection of the database.
The authority to add new SQL objects is given to anyone with authority to write to the
catalog in which the object is registered. The authority to add to existing objects is
controlled by the ownership and security of that object. For details on the authorization
requirements, see Authorization Requirements for Database Operations on page 4-5.
Adding Catalogs
To add new catalogs to an existing data dictionary, use the CREATE CATALOG
statement. Adding catalogs does not affect existing dictionary objects and items. The
catalog format version of a new catalog is the same as the version of the SQL/MP
software that creates the catalog, as explained in the SQL/MP Version Management
Guide.
To create a new catalog and also secure the catalog in one statement, use the
CREATE CATALOG statement with the SECURE option. For more information, see
Altering Catalog Attributes on page 7-15. For general guidelines about the CREATE
CATALOG statement, see Creating Catalogs on page 5-1.
To add a catalog:
1. Start an SQLCI session. Enter a LOG command to initiate a log file for the
statements and commands entered in this session. Keep the log for your records.
2. Query the CATALOGS table of the system catalog to determine if the catalog name
is available, or use the FILEINFO catalog-name TABLES command to verify that
the catalog does not exist.
Object Operation SQL Statement
Catalog (all tables) Add CREATE CATALOG
Table Add CREATE TABLE
View Add CREATE VIEW
Index Add CREATE INDEX
Collation Add CREATE COLLATION
Partition Add ALTER TABLE PARTONLY MOVE
ALTER INDEX PARTONLY MOVE
Column Add ALTER TABLE ADD COLUMN
Constraint Add CREATE CONSTRAINT
Comment Add/Append COMMENT