Background documentationSchema Name (schema_name) Locate this document in the navigation structure

 

You can define assignment of an object to a schema by specifying the name of the schema (schema_name).

Structure

Syntax Syntax

  1. <schema_name> ::=
      <identifier>
End of the code.

The identifier may not exceed 32 characters in length.

Examples

SQL Tutorial, Schemas

Explanation

Schemas create namespaces for database objects. When you create a new database, the database system creates the database system administrator and implicitly creates a schema with the same name. The database system also creates the following schemas for the database system administrator: DOMAIN, SYSINFO.

When a database user is created using the CREATE USER statement, a schema, the name of which is identical to the name of the database user, is created implicitly.

When a schema is created using the CREATE SCHEMA statement, the schema name and owner of the schema can be specified explicitly. If no owner is specified, the current database user becomes the owner of the schema.

Each schema has a maximum of one owner. The owner of the schema can create, change, and delete objects in his own schema, since he or she is granted the relevant privileges implicitly. The owner can also grant these privileges to other database users.

Schemas can be created that do not correspond to a user name. The database user DAVID can create the schemas A, B, and C and be the owner of all these. A database user A, B, or C need not exist.