Managing Tablespaces

Before you can create a tablespace, you must create a database to contain it.The primary tablespace in any database is the SYSTEM tablespace, which contains information basic to the functioning of the database server, such as the data dictionary
and the system rollback segment.


The SYSTEM tablespace is the first tablespace created at database creation.
It is managed as any other tablespace, but requires a higher level of privilege and
is restricted in some ways. For example, you cannot rename or drop the SYSTEM
tablespace or take it offline.


The SYSAUX tablespace, which acts as an auxiliary tablespace to the SYSTEM tablespace, is also always created when you create a database.
It contains information about and the schemas used by various Oracle products and features, so that those products do not require their own tablespaces.

As for the SYSTEM tablespace, management of the SYSAUX tablespace requires a higher level of security and you cannot rename or drop it.

The steps for creating tablespaces vary by operating system, but the first step is always
to use your operating system to create a directory structure in which your datafiles will be allocated. On most operating systems, you specify the size and fully specified filenames of datafiles when you create a new tablespace or alter an existing tablespace by adding datafiles. Whether you are creating a new tablespace or modifying an existing one, the database automatically allocates and formats the datafiles as specified.

To create a new tablespace, use the SQL statement CREATE TABLESPACE or CREATE TEMPORARY TABLESPACE. You must have the CREATE TABLESPACE system privilege to create a tablespace. Later, you can use the ALTER TABLESPACE or ALTER DATABASE
statements to alter the tablespace. You must have the ALTER TABLESPACE or ALTER
DATABASE system privilege, correspondingly.


You can also use the CREATE UNDO TABLESPACE statement to create a special type of tablespace called an undo tablespace, which is specifically designed to contain undo records. These are records generated by the database that are used to roll back, or undo, changes to the database for recovery, read consistency, or as requested by a ROLLBACK statement.

The creation and maintenance of permanent and temporary tablespaces are discussed
in the following sections:

Locally Managed Tablespaces.
Bigfile Tablespaces.
Temporary Tablespaces .
Multiple Temporary Tablespaces: Using Tablespace Groups.

No comments:

Post a Comment