Oracle Create Tablespace: Quick Guide

To create a new tablespace in Oracle database, you can use the following SQL statement:

CREATE TABLESPACE tablespace_name
DATAFILE 'path_to_datafile'
SIZE size_of_tablespace
AUTOEXTEND ON;

tablespace_name is the name of the tablespace to be created, path_to_datafile is the file path and name of the data file, and size_of_tablespace is the initial size of the tablespace. Setting AUTOEXTEND ON means that the tablespace will automatically increase in size to accommodate data growth.

For instance, to create a tablespace named “users” with a data file located at ‘/u01/oracle/users01.dbf’ and an initial size of 100M, you can use the following SQL statement:

CREATE TABLESPACE users
DATAFILE '/u01/oracle/users01.dbf'
SIZE 100M
AUTOEXTEND ON;

Please note that creating a table space requires appropriate permissions, usually only database administrators or users with the corresponding permissions can perform this operation.

bannerAds