fbpx

How to Create a Tablespace in Oracle

adventure alpine background black and white

From time to time you’ll need to create a new tablespace in your Oracle database.

Here is how to create a tablespace in Oracle.

Permanent tablespace

CREATE tablespace TS_NAME datafile
size 1G AUTOEXTEND ON NEXT 500M MAXSIZE UNLIMITED;

Temporary tablespace

CREATE temporary tablespace TS_TEMP tempfile
size 1G AUTOEXTEND ON NEXT 500M MAXSIZE UNLIMITED;

Undo tablespace

CREATE undo tablespace TS_UNDO datafile size 3G;

How to increase a tablespace size in Oracle

ALTER TABLESPACE TS_NAME ADD DATAFILE 
SIZE 100M AUTOEXTEND ON NEXT 500M MAXSIZE UNLIMITED;

How to Check Oracle Database Character Set

time lapse photography of river

Many times you need to validate the Oracle database characterset, maybe because it is an old Oracle database that did not have UTF8 (which is the recommended charset) or maybe because someone created the database with a different charset for a given reason…

Anyways, here is how you can check the Oracle database characterset:

select *
from NLS_DATABASE_PARAMETERS
where parameter='NLS_CHARACTERSET';