Name

CREATE TABLE

Synopsis

CREATE TABLE
[schema.]table_name
   (
    [table_constraint_clause]
    [table_ref_clause]
 [column
datatype [DEFAULT
expression]
[column_ref_clause]
[column_contraint_clause] ]
    )
    {
[CLUSTER
(column[,column
...]]
[ORGANIZATION INDEX
index_organization_clause ]
[ORGANIZATION HEAP [segment_attrib_clause]
]
    [segment_attrib_clause]
    }
    [partition_clause]
[PARALLEL ( {DEGREE {integer | DEFAULT} |
INSTANCES {integer | DEFAULT} } ) ]
    [NOPARALLEL]
    [ENABLE
     {
      ALL TRIGGERS
UNIQUE (column[,
column...] [CASCADE]
      PRIMARY KEY [CASCADE]
      CONSTRAINT constraint_name
     }]
   [DISABLE
     {
      ALL TRIGGERS
UNIQUE (column[,
column...] [CASCADE]
      PRIMARY KEY [CASCADE]
      CONSTRAINT constraint_name
     }]
   [AS subquery]
   [CACHE | NOCACHE]

Creates a table (table_name) either by specifying the structure or by referencing an existing table.

Keywords

table_constraint_clause

Specifies a table constraint; the syntax is shown in the later table_constraint_clause section.

table_ref_clause

Allows you to specify additional information about a column of type REF. The syntax is shown in the later table_ref_clause section.

column_ref_clause

Allows you to specify additional information about a column of type REF. The syntax is shown in the later column_ref_clause section.

column_constraint_clause

Adds or removes a column constraint; the syntax is shown in the later column_constraint_clause section.

CLUSTER

Specifies that the table is to be created in the specified cluster.

ORGANIZATION INDEX

Specifies that the table is to be an indexed organized table.

index_organization_clause

Specifies how the indexed organized table is to be created. The syntax is shown in the later index_organization_clause section.

ORGANIZATION HEAP

Specifies that the table is a tradition table. The table will default to ORGANIZATION HEAP if an organization is not specified.

segment_attrib_clause

Specifies the storage characteristics of the table; the syntax is shown in the later segment_attrib_clause section.

partition_clause

Specifies the partition key and the various partitions; the syntax is shown in the later partition_clause section.

PARALLEL

Specifies the level of parallelism to be supported, based on the following parameters:

DEGREE

Specifies the degree of parallelism. An integer value specifies how many slave processes can be used. Specify DEFAULT to use the default value for the tablespace.

INSTANCES

Specifies the number of instances that can be used to execute slave processes. Specify DEFAULT to use the default value specified for the tablespace.

NOPARALLEL

Specifies that no parallel processing will be supported for the table.

ENABLE ALL TRIGGERS

Enables all triggers associated with the table.

ENABLE UNIQUE

Enables the UNIQUE constraint on the specified columns.

ENABLE PRIMARY KEY

Enables the integrity constraints on the table’s primary key.

ENABLE CONSTRAINT

Enables the named integrity constraint.

CASCADE

Specifies that all other constraints that depend on the enabled constraints should also be enabled.

DISABLE

Disables a single constraint or ALL TRIGGERS. See ENABLE for specific keywords.

AS

Specifies a subquery to be used to insert rows into the table upon creation. If column definitions are omitted from the CREATE TABLE statement, the column names, datatypes, and constraints will be copied from the table referenced in the subquery.

CACHE

Specifies that blocks retrieved from this table during full table scans are placed at the beginning of the least-recently-used (LRU) list. This allows small lookup tables to remain in the SGA.

NOCACHE

Specifies that blocks retrieved from this table during full table scans are placed at the end of the LRU list. This is the default behavior.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.239.118