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;
- Formatting date in SQL (Oracle) -Simple date forma…
- FINDING database objects, finding valid and INVALI…
- Oracle Data types
- PL/SQL Fundamentals