Creating a schema

A schema provides a logical grouping of SQL objects. To create a schema, use the CREATE SCHEMA statement.

A schema consists of a library, a journal, a journal receiver, a catalog, and optionally, a data dictionary. Tables, views, and system objects (such as programs) can be created, moved, or restored into any system libraries. All system files can be created or moved into an SQL schema if the SQL schema does not contain a data dictionary. If the SQL schema contains a data dictionary then:

  • Source physical files or nonsource physical files with one member can be created, moved, or restored into an SQL schema.
  • Logical files cannot be placed in an SQL schema because they cannot be described in the data dictionary.

You can create and own many schemas.

You can create a schema using the CREATE SCHEMA statement. For example, create a schema called DBTEMP:

CREATE SCHEMA DBTEMP