Search notes:

Oracle logical database structure: Tablespace

A tablespace consists of one or more data files.
Because a tablespace is a logical storage structure and a data file a phsysical structure the tablespace/data file boundary is the connection between the logical and physical world of Oracle storage.
In the data dictionary, tablespaces are listed under dba_tablespaces, quotas are recorded in dba_ts_quotas.
A users can be assigned a default tablespace.
For each tablespace, a quote can be defined for a user (see also dba_ts_quotas)
There are three types of tablespaces:

Typical tablespaces

A database must have at least the two tablespaces

Space management (locally vs dictionary managed tablespaces)

There are two methods to manage available space (that is its extents) within a tablespace:
The variant being used for a tablespace can be queried with the following select statement:
select
   tablespace_name,
   extent_management
from
   dba_tablespaces;

Dictionary managed tablespaces

Dictionary managed tablespaces manage free and used segments in the data dictionary (hence the name) in the tables fet$ and uet$.
Dictionary managed tablespaces can only be created if the SYSTEM tablespace is also dictionary managed (error message ORA-12913: Cannot create dictionary managed tablespace)

Locally managed tablespaces

Locally managed tablespaces manages extents with bitmaps stored in the tablespace's data files. Each bit corresponds to a block or a group of blocks.
Because (except for tablespace quota information), the extent management is not tracked in the dictionary, no undo data (rollback information) is generated when extents are allocated or freed.
A locally managed tablespaces is the more modern and usually preferred variant. Oracle recommends LMTs with ASSM.
One of the main reasons to introduce locally managed tablespaces was to get rid of the enq: ST - contention event.
Another benefit of using LMTs is that SMON does not have to coalesce free extents (space is managed locally!)
Extent information of locally managed tablespaces can be queried from x$ktfbue.

Segment space management for locally managed tablespace

For a locally managed tablespace, there are again two different methods to manage space:
  • Automatic segment space management (ASSM), the default for locally managed tablespace
  • Manual segment space management (MSSM), which is considered legacy

Automatic segment space management

With ASSM, space in a tablespace is managed using bitmaps. There is only one storage attribute that controls space allocation:
  • pctfree

Manual segment space management

With MSSM, free space is managed using a linked list by the name of free list. This list records free data blocks below a segment's high water mark.
Storage attributes that control space management are:
  • pctfree
  • pctused
  • freelists
  • freelist groups

Querying space management type from the data dictionary

The space management type (for locally managed tablespace) can be queried in the column segment_space_management in tablespace.
But compare with the value of segment_subtype (which can be ASSM, MSSM, SECUREFILE and null) in dba_segments.

See also

MOS Note 93771.1: Introduction to Locally-Managed Tablespaces

See also

dbms_space_admin provides maintenance procedures for locally managed tablespaces.
A query to calculate available and free space in tablespaces.
Some views related to tablespaces include
SYSAUX, undo tablespaces
Logical structures
ORA-01950: no privileges on tablespace '…'
The SQL noun tablespace.

Index