A tablespace is a logical container in which Oracle stores table and index data. Physically, tablespaces consist of one or more
data files. The CREATE TABLESPACE statement is used to create a tablespace. The following mouseover presents a somewhat simplified version of the syntax:
CREATE TABLESPACE
The command to create a new tablespace.
tablespace_name
The name that you want to give the tablespace.
DATAFILE 'filename'
Specifies the name of the first file to create for the tablespace.
SIZE filesize
Specifies the file size in bytes. Optionally follow this number with K or M to specify the size in kilobytes or megabytes.
MINIMUM EXTENT minsize
Specifies a minimum extent size for the tablespace.
LOGGING
Causes the creation of the tablespace to be logged in the database's redo log. This is done by default.
NOLOGGING
Creates the tablespace without generating any redo log entries.
DEFAULT STORAGE storage_clause
Specifies default storage attributes for objects created in the tablespace.
ONLINE
Brings the tablespace online after it is created. This is done by default.
OFFLINE
Creates the tablespace, but leaves it offline.
PERMANENT
Creates a tablespace for permanent objects.
TEMPORARY
Creates a tablespace for temporary objects.
When you create a tablespace, choosing the correct default storage settings is important. These are the settings that are used by default for any objects created in that tablespace. The following slide show describes the various options that can appear in a storage clause: