Databases Reference
In-Depth Information
Chapter 4
Tablespaces and Data Files
The term tablespace is something of a misnomer, in that it's not just a space for tables. Rather, a tablespace is a logical
container that allows you to manage groups of data files, the physical files on disk that consume space. Once a
tablespace is created, you can then create database objects (tables and indexes) within tablespaces, which results in
space allocated on disk in the associated data files.
A tablespace is logical in the sense that it is only visible through data dictionary views (such as DBA_TABLESPACES );
you manage tablespaces through SQL*Plus or graphical tools (such as Enterprise Manager), or both. Tablespaces only
exist while the database is up and running.
Data files can also be viewed through data dictionary views (such as DBA_DATA_FILES ) but additionally have
a physical presence, as they can be viewed outside the database through OS utilities (such as ls ). Data files persist
whether the database is open or closed.
Oracle databases typically contain several tablespaces. A tablespace can have one or more data files associated
with it, but a data file can be associated with only one tablespace. In other words, a data file can't be shared between
two (or more) tablespaces.
Objects (such as tables and indexes) are owned by users and created within tablespaces. An object is logically
instantiated as a segment. A segment consists of extents of space within the tablespace. An extent consists of a set of
database blocks. Figure 4-1 shows the relationships between these logical and physical constructs used to manage
space within an Oracle database.
physical storage
database
data files
OS blocks
users
(owners)
logical storage
segments:
- tables
- indexes
- partitions
- rollback
- and so on...
tablespaces
database
blocks
extents
schemas
Figure 4-1. Relationships of logical storage objects and physical storage
 
Search WWH ::




Custom Search