CREATE SCHEMA (Define schema)

Function

CREATE SCHEMA defines a schema.

Privileges

Users with the schema definition privilege

These users can define schemas for themselves only.

Users with the DBA privilege

Can define schemas of other users who have the CONNECT or DBA privilege.

Format

CREATE SCHEMA schema-name-clause
schema-name-clause::=[AUTHORIZATION authorization-identifier]

Operands

Specifies the authorization identifier of the user for whom a schema is to be defined. The default is the executing user's own authorization identifier.

Notes

  1. Once a schema has been defined, tables, indexes, abstract data types, index types, functions, procedures, triggers, and access privileges can be defined.
  2. Only one schema can be defined for each user.
  3. The authorization identifier specified as the owner of a table or an index must be the same authorization identifier specified in the schema definition for that user.
  4. A user who receives a schema defined for that user by a user with the DBA privilege is granted the schema definition privilege.
  5. The CREATE SCHEMA statement cannot be specified from an X/Open-compliant UAP running under OLTP.

Example

Define a schema for a user (USER1):

CREATE SCHEMA
 AUTHORIZATION USER1