Un tablespace es el archivo donde se almacenarán las tablas y datos de usuario. No es mas que un archivo físico donde oracle almacenará esos datos
CREATE TABLESPACE MD_DATA
DATAFILE
'mddata01.dbf' SIZE 1000M,
'mddata02.dbf' SIZE 1000M
AUTOEXTEND ON NEXT 5M MAXSIZE 200000M;
CREATE TABLESPACE tablespace [DATAFILE clause] [MINIMUM EXTENT integer[K|M]] [BLOCKSIZE integer [K]] [LOGGING|NOLOGGING] [DEFAULT storage_clause ] [ONLINE|OFFLINE] [PERMANENT|TEMPORARY] where:tablespace is the name of the tablespace to be created
DATAFILE specifies the data file or data files that make up the tablespace
MINIMUM EXTENT
ensures that every used extent size in the tablespace is
a multiple of the integer. Use Kor M to specify this
size in kilobytes or megabytes.
specifies that, by default, all tables, indexes, and partitions
LOGGING
within the tablespace have all changes written to redo.
LOGGING is the default.
specifies that, by default, all tables, indexes, and partitions
NOLOGGING
within the tablespace do not have all changes written to redo.
NOLOGGING affects only some DML and DDL commands,
for example, direct loads.
specifies the default storage parameters for all objects created
DEFAULT
in the tablespace creation
makes the tablespace unavailable immediately after creation
OFFLINE
specifies that the tablespace can be used to hold permanent
PERMANENT
objects
specifies that the tablespace be used only to hold temporary
TEMPORARY
objects; for example, segments used by implicit sorts caused
by an ORDER BY clause extent_management_clause
specifies how the extents of the tablespace are managed. This
clause is discussed in a subsequent section of this lesson.
datafile_clause :== filename
[SIZE integer[K|M] [REUSE] | REUSE ] [ autoextend_clause ]
where: is the name of a data file in the tablespace
filename
specifies the size of the file. Use K or M to
SIZE
specify the size in kilobytes or megabytes.
allows the Oracle server to reuse an existing file
REUSE
enables or disables the automatic extension of
autoextend_clause
the data file. This clause is discussed in a
subsequent section of this lesson.
ALTER DATABASE DATAFILE '/mi/tablespace/datafile.dbf' RESIZE 300M;
alter database datafile 'mi/tablespace.dbf' autoextend on maxsize 1000M
alter tablespace MI_TABLESPACE add datafile '/path/del/datafile.dbf' size 2048M AUTOEXTEND ON NEXT 50M MAXSIZE 4096M;
DROP TABLESPACE tablespace_name [INCLUDING CONTENTS [AND DATAFILES]
[CASCADE CONSTRAINTS]];