Oracle8i SQL Reference Release 2 (8.1.6) A76989-01 |
|
SQL Statements (continued), 10 of 11
filespec: See "filespec".
storage_clause: See "storage_clause".
To create a tablespace. A tablespace is an allocation of space in the database that can contain schema objects. For information on tablespaces, see Oracle8i Concepts.
When you create a tablespace, it is initially a read-write tablespace. You can subsequently use the ALTER
TABLESPACE
statement to take the tablespace offline or online, add datafiles to it, or make it a read-only tablespace. See "ALTER TABLESPACE".
You can also drop a tablespace from the database with the DROP
TABLESPACE
statement. See "DROP TABLESPACE".
You must have CREATE TABLESPACE system privilege. Also, the SYSTEM
tablespace must contain at least two rollback segments including the SYSTEM
rollback segment.
Before you can create a tablespace, you must create a database to contain it, and the database must be open. See "CREATE DATABASE".
tablespace |
is the name of the tablespace to be created. |
|
|
specifies the datafile or files to make up the tablespace. See "filespec". |
|
|
Note: For operating systems that support raw devices, the filespec |
|
autoextend_clause |
enables or disables the automatic extension of the datafile. |
|
|
|
disables autoextend if it is turned on. |
|
|
enables autoextend. |
|
|
specifies the disk space to allocate to the datafile when more extents are required. |
|
maxsize_clause |
specifies the maximum disk space allowed for allocation to the datafile. |
|
|
sets no limit on allocating disk space to the datafile. |
|
controls free space fragmentation in the tablespace by ensuring that every used or free extent size in a tablespace is at least as large as, and is a multiple of, integer.
See also: Oracle8i Concepts for more information about using |
|
|
Note: This clause is not relevant for a dictionary-managed temporary tablespace. |
|
|
specifies the default logging attributes of all tables, indexes, and partitions within the tablespace. |
|
|
The tablespace-level logging attribute can be overridden by logging specifications at the table, index, and partition levels.
Only the following operations support the
DML: direct-load
DDL: |
|
|
In |
|
|
specifies the default storage parameters for all objects created in the tablespace. For a dictionary-managed temporary tablespace, Oracle considers only the |
|
|
makes the tablespace available immediately after creation to users who have been granted access to the tablespace. This is the default. |
|
|
makes the tablespace unavailable immediately after creation. |
|
|
The data dictionary view |
|
|
specifies that the tablespace will be used to hold permanent objects. This is the default. |
|
|
specifies that the tablespace will be used only to hold temporary objects, for example, segments used by implicit sorts to handle
Restriction: If you specify |
|
extent_management_clause |
specifies how the extents of the tablespace will be managed. |
|
|
|
specifies that the tablespace is managed using dictionary tables. This is the default. |
|
|
specifies that tablespace is locally managed. Locally managed tablespaces have some part of the tablespace set aside for a bitmap. For a discussion of locally managed tablespaces, see Oracle8i Concepts. |
|
|
If you do not specify either
Restriction: If you specify |
This statement 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) ONLINE;
This statement 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_5 DATAFILE 'diskb:tabspace_file3.dat' SIZE 500K REUSE AUTOEXTEND ON NEXT 500K MAXSIZE 10M;
This statement creates tablespace TABSPACE_5
with one datafile and allocates every extent as a multiple of 64K:
CREATE TABLESPACE tabspace_3 DATAFILE 'tabspace_file5.dbf' SIZE 2M MINIMUM EXTENT 64K DEFAULT STORAGE (INITIAL 128K NEXT 128K) LOGGING;
In the following statement, we assume that the database block size is 2K.
CREATE TABLESPACE tbs_1 DATAFILE 'file_1.f' SIZE 10M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
This statement creates a locally managed tablespace in which every extent is 128K and each bit in the bit map describes 64 blocks.
|
![]() Copyright © 1999 Oracle Corporation. All Rights Reserved. |
|