Friday 20 June 2014

Oracle Concepts - Tablespaces

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 tablespaces. 
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 sizes.
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 physical datafiles.

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 index creation. 

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 different tablespaces.

After completing above introduction goto this link for tablespace creation

No comments:

Post a Comment