Oracle Tablespace Concepts
Tablespaces are the bridge between certain physical and
logical components of the Oracle database. Tablespaces are where you store
Oracle database objects such as tables, indexes and rollback segments. You can
think of a tablespace like a shared disk drive in Windows. You can store files
on your shared drive, move files around and remove files. The same is true with
A tablespace is made up of one or more database
datafiles. The total amount of storage space available in a tablespace is the
sum of the physical disk size of all the datafiles associated with that
tablespace (less some system overhead). The datafiles are created automatically
when the tablespace is defined. In most cases, all datafile space is
pre-allocated; that is, the space is set aside when the datafile is created.
Thus, when you create a tablespace, you define the initial size of the
associated datafile. We will discuss the specifics of creating tablespaces later
in this book.
Tablespaces are given names as they are created. For
example, the first tablespaces that are created are named SYSTEM and SYSAUX
(though SYSAUX is only created in 10g).
Tablespaces are generally named based on the objects
within the tablespace. For example you might name a tablespace PAYROLL_DATA if
it?s going to store payroll related information. We will be discussing
tablespaces in great detail in later chapters in this book.
Oracle Block Concept
As we discussed earlier, a block is the smallest unit of
storage in Oracle. The size of a database block is fixed when the database is
created, and can not be changed except by rebuilding the database from scratch.
The database block size is fixed at 2K, 4K, 8K, 16K, or 32K in size. Once the
base block size is defined, you can create new tablespace with alternate block
Remember that the Oracle instance also includes a RAM
buffer cache which is made-up of RAM blocks which map to the data block in the
Oracle Extents Concepts
An extent is an uninterrupted (or contiguous) allocation
of blocks within a segment. Extents are assigned to a segment automatically by
Oracle, so you will rarely deal directly with an extent, rather you will deal
directly with its associated segment.
An extent must be on contiguous blocks within a single
datafile, so an extent cannot span multiple Oracle datafiles. Oracle will
allocate the size of the extents based on the type of tablespace. We will
discuss more about extent allocation in later chapters when we discuss table and
Oracle Segments Concepts
Segments are the storage objects within the Oracle
database. A segment might be a table, an index, a cluster or any one of more
than 20 object types.
The DBA creates the segments and assigns them to a
specific tablespace. In most cases a single segment cannot reside in more than
one tablespace. However, you can split up, or partition, a segment into
When you create a segment, you define its initial size.
We will look at the creation of segments in Oracle in much more detail in
chapters to come.
Logical Oracle Structures - The Big Picture
The following picture shows the relationship between
segments, extents and blocks in the database. In this example we see that we
have created a single segment. This segment actually consists of two extents.
Each of the two extents consists of a number of contiguous blocks.
Well, here we are at the end of Chapter One, and we are
now ready to see a complete map of an Oracle database.
Don?t worry if you don?t get everything yet. As you
proceed through the next chapters, and actually work with the database, this
will all make much more sense!
Here we see the RAM region (the system global area)
interacting with Oracle?s programs (CKPT, ARC0) and we see how Oracle programs
read and write data to our disk files.
The main points of this chapter include:
* Oracle is the world? most powerful, flexible and
* Oracle is very complex.
* Oracle 10g administration can be simplified with
* The configuration of Oracle is governed by
initialization parameters, called init.ora.
* An Oracle instance consists of a RAM memory region
called the SGA, plus a set of Oracle programs called background processes.
This is an excerpt from the bestselling "Easy
Oracle Jumpstart" by Robert Freeman and Steve Karam (Oracle ACE and Oracle
Certified Master). It?s only $19.95 when you buy it directly from the
If you like Oracle tuning, you may enjoy the new book "Oracle
Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning
tips & scripts.
You can buy it direct from the publisher for 30%-off and get instant access to
the code depot of Oracle tuning scripts.