tablespace
is the name of the tablespace to be created.
DATAFILE
specifies the data file or files to comprise the tablespace. See the syntax description of filespec .
AUTOEXTEND
enables or disables the automatic extension of datafile.
OFF disable autoextend if it is turned on. NEXT and MAXSIZE are set to zero. Values for NEXT and MAXSIZE must be respecified in further ALTER TABLESPACE AUTOEXTEND commands.
ON enable autoextend.
NEXT disk space to allocate to the datafile when more extents are required.
MAXSIZE maximum disk space allowed for allocation to the datafile.
UNLIMITED set no limit on allocating disk space to the datafile.
DEFAULT STORAGE
specifies the default storage parameters for all objects created in the tablespace. For information on storage parameters, see the STORAGE clause.
ONLINE
makes the tablespace available immediately after creation to users who have been granted access to the tablespace.
OFFLINE
makes the tablespace unavailable immediately after creation.
If you omit both the ONLINE and OFFLINE options, Oracle7 creates the tablespace online by default. The data dictionary view DBA_TABLESPACES indicates whether each tablespace is online or offline.
PERMANENT
specifies that the tablespace will be used to hold permanent objects. This is the default.
TEMPORARY
specifies that the tablespace will only be used to hold temporary objects. For example, segments used by implicit sorts to handle ORDER BY clauses.
When you create a tablespace, it is initially a read-write tablespace. After creating the tablespace, you can subsequently use the ALTER TABLESPACE command to take it offline or online, add data files to it, or make it a read-only tablespace.
Many schema objects have associated segments that occupy space in the database. These objects are located in tablespaces. The user creating such an object can optionally specify the tablespace to contain the object. The owner of the schema containing the object must have space quota on the object's tablespace. You can assign space quota on a tablespace to a user with the QUOTA clause of the CREATE USER or ALTER USER commands.
Warning: For operating systems that support raw devices, be aware that the STORAGE clause REUSE keyword has no meaning when specifying a raw device as a datafile in a CREATE TABLESPACE command; such a command will always succeed even if REUSE is not specified.
Example I
This command creates a tablespace named TABSPACE_2 with one datafile:
CREATE TABLESPACE tabspace_2 DATAFILE 'diska:tabspace_file2.dat' SIZE 20M DEFAULT STORAGE (INITIAL 10K NEXT 50K MINEXTENTS 1 MAXEXTENTS 999 PCTINCREASE 10) ONLINE
Example II
This command creates a tablespace named TABSPACE_3 with one datafile; when more space is required, 50 kilobyte extents will be added up to a maximum size of 10 megabytes:
CREATE TABLESPACE tabspace_3 DATAFILE 'diskb:tabspace_file3.dat' SIZE 500K REUSE AUTOEXTEND ON NEXT 500K MAXSIZX 10M