Oracle Tablespace, and Datafiles – Introduction

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Buffer 0 Email -- Filament.io 0 Flares ×

The data in oracle is stored logically in tablespaces and physically in datafiles.
Tablespaces collectively store all of the database’s data.
Each tablespace in an Oracle database consists of one or more files called datafiles. Datafiles conform to the operating system in which Oracle is running.
The size of a database is the collective size of the tablespaces included in that database.

Types of tablespaces:
1. A permanent tablespace contains persistent schema objects which are stored in datafiles.
2. An undo tablespace is a type of permanent tablespace used by Oracle Database to manage undo data if the database in automatic undo management mode.
3. A temporary tablespace contains schema objects only for the duration of a session.

Creating Basic Tablespaces:

Developer can use CREATE TABLESPACE statement to create a tablespace.

The following statement creates a tablespace named ‘mytabspace’ with one datafile:

CREATE TABLESPACE mytabspace1 DATAFILE 'mytabspace_1.dat' SIZE 40M  ONLINE;

Enabling Autoextend to increase size of datafiles for a Tablespace:
When more space is required, 900 kilobyte extents will be added up to a maximum size of 200 megabytes

CREATE TABLESPACE mytabspace2   DATAFILE 'mytabspace12_1.dat'
SIZE 900K REUSE  AUTOEXTEND ON NEXT 900K MAXSIZE 200M;

Creating a Temporary Tablespace:

This following statement creates temporary tablespace.

CREATE TEMPORARY TABLESPACE temptbspace TEMPFILE 'temptbspace.dbf' SIZE 5M AUTOEXTEND ON;

Also Read,

_______________________________________________________________________________

Technorati Tags:
, , , ,

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Buffer 0 Email -- Filament.io 0 Flares ×

1 thought on “Oracle Tablespace, and Datafiles – Introduction

  1. Pingback: Savepoints In SQL Transactions. - oracle SAVEPOINT | SQL and PLSQL

Leave a Reply

Your email address will not be published. Required fields are marked *

Paged comment generated by AJAX Comment Page