Oracle7 Server Concepts

Contents Index Home Previous Next

An Introduction to Tablespaces and Datafiles

Oracle stores data logically in tablespaces and physically in datafiles associated with the corresponding tablespace. Figure 4 - 1 illustrates this relationship.

Figure 4 - 1. Datafiles and Tablespaces

Although databases, tablespaces, datafiles, and segments are closely related, they have important differences:

databases and tablespaces An Oracle database is comprised of one or more logical storage units called tablespaces. The database's data is collectively stored in the database's tablespaces.
tablespaces and datafiles Each tablespace in an Oracle database is comprised of one or more operating system files called datafiles. A tablespace's datafiles physically store the associated database data on disk.
databases and datafiles A database's data is collectively stored in the datafiles that constitute each tablespace of the database. For example, the simplest Oracle database would have one tablespace and one datafile. A more complicated database might have three tablespaces, each comprised of two datafiles (for a total of six datafiles).
schema objects, segments, and tablespaces When a schema object such as a table or index is created, its segment is created within a designated tablespace in the database. For example, suppose you create a table in a specific tablespace using the CREATE TABLE command with the TABLESPACE option. Oracle allocates the space for this table's data segment in one or more of the datafiles that constitute the specified tablespace. An object's segment allocates space in only one tablespace of a database. See Chapter 3, "Data Blocks, Extents, and Segments", for more information about extents and segments and how they relate to tablespaces.
The following sections further explain tablespaces and datafiles.


Contents Index Home Previous Next