Monday 17 October 2011

Tablespace, Datafiles

Table Space: Tablespace is a logical area of data storage. It is made up of one or more datafiles.
A table space is an area of disk, comprised of one or more disk files. A tablespace can contain many tables, indexes, or clusters. Because a table space has a fixed size, it can get full as rows are added to its tables. When this happens then someone who has DBA authority can expand the table space. When a database is created two table spaces are created.
a) System Table space: This data file stores all the tables related to the system and dba tables
b) User Table space: This data file stores all the user related tables
We should have separate table spaces for storing the tables and indexes so that the access is fast.
A tablespace can be online (accessible) or offline (not accessible). A tablespace is generally online, so that users can access the information in the tablespace. However, sometimes a tablespace is taken offline to make a portion of the database unavailable while allowing normal access to the remainder of the database. This makes many administrative tasks easier to perform.
Data file: Oracle database has one or more physical datafiles (a datafile is a unit of physical data storage). A database data i.e. tables, indexes, etc. are stored in datafiles.
A datafile is associated with only one tablespace.
Once created, a datafile cannot change in size, (in release 7.1 datafiles can be appended but existing datafile size cannot be altered, however, later versions support change in existing datafile size).
Datafiles can have certain characteristics set to let them automatically extend when the database runs out of space.
One or more datafiles form a logical unit of database storage called a tablespace

No comments:

Post a Comment