-- syntax:
CREATE [<BIGFILE | SMALLFILE>] TABLESPACE <tablespace_name>
DATAFILE '<path_and_file_name>'
SIZE <integer><K | M | G | T | P | E> [REUSE] AUTOEXTEND <OFF | ON>
BLOCKSIZE <bytes>
[<LOGGING | NOLOGGING | FILESYSTEM_LIKE_LOGGING>]
[FORCE LOGGING]
[ENCRYPTION USING '<encryption_algorithm>'
IDENTIFIED BY <password> [NO] SALT]
[DEFAULT <COMPRESS [FOR <ALL | DIRECT_LOAD> OPERATIONS] | NOCOMPRESS>]
[<ONLINE | OFFLINE>]
EXTENT MANAGEMENT LOCAL <AUTOALLOCATE | UNIFORM SIZE <extent_size>>
[SEGMENT SPACE MANAGEMENT <AUTO | MANUAL>]
[FLASHBACK <ON | OFF>];
-- example:
CREATE TABLESPACE sales_data DATAFILE
'c:\oracle\test\sales_region_1.dbf' SIZE 100M,
'c:\oracle\test\sales_region_2.dbf' SIZE 200M
AUTOEXTEND OFF
BLOCKSIZE 8192
FORCE LOGGING
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 512K
FLASHBACK ON;
DESC dba_tablespaces
SET linesize 121
col tablespace_name format a20
SELECT tablespace_name, block_size, status, contents,
retention, extent_management, allocation_type,
plugged_in, segment_space_management
FROM dba_tablespaces;
DESC dba_data_files
col file_name format a45
SELECT file_name, tablespace_name, bytes, blocks, autoextensible, increment_by
FROM dba_data_files;
SELECT DBMS_METADATA.get_ddl('TABLESPACE', 'SALES_DATA')
FROM dual;