Entering content frame

Background documentation Schema Locate the document in the library structure

You can use schemas to group database objects that logically belong together. A database object can belong to precisely one schema.

Schemas are created in the following situations:

     When you create a new database user, the database system creates a schema with the name of the database user.

Note

When you create a new database instance, the database system creates the database system administrator (SYSDBA user) and implicitly creates a schema with the same name. The database system also creates the following schemas for the database system administrator: SYS, DOMAIN, SYSINFO.

     Database administrators can create schemas explicitly.

New database object are assigned to a schema in the following manner:

     The database user who creates the database object can explicitly assign the database object to a schema.

Example

The database user BORIS creates the table person and assigns it to the schema OFFICE .

CREATE TABLE OFFICE.person
(pno       FIXED(6),
 name      CHAR(20),
 city      CHAR(20))

     If the database user does not enter a schema when creating the database object, the database system assigns the database object automatically to the schema of the database user who is currently logged on.

Example

The database user BORIS creates the table person . The database system assigns the table to the schema BORIS .

CREATE TABLE person
(pno       FIXED(6),
 name      CHAR(20),
 city      CHAR(20))

See also:

SQL Reference Manual, Schema Name (schema_name)

 

Leaving content frame