DBAtlas · Database operations atlas

Add a new tablespace

OracleStorage

Command

-- File system:
CREATE TABLESPACE customer_data
  DATAFILE '/u01/oradata/ORCL/customer_data01.dbf'
  SIZE 1G AUTOEXTEND ON NEXT 256M MAXSIZE 20G
  EXTENT MANAGEMENT LOCAL
  SEGMENT SPACE MANAGEMENT AUTO;

-- If you use ASM:
CREATE TABLESPACE customer_data
  DATAFILE '+DATA' SIZE 1G AUTOEXTEND ON NEXT 256M MAXSIZE 20G;

What it does

Creates a new permanent tablespace in which table/index segments can be placed.

When to use it

When allocating separate storage for a new application/schema.

Caution

Specify MAXSIZE, otherwise the disk can fill up. In ASM the file name is generated automatically.

Open in DBAtlas →

Related