What is a block, extent and segment?
****Summary of How this page can help you******************

This page contains information about a block , extent,segment etc.

To go back to the 50 dba terms for the new dba please click the link.

*********************************************************

Block

Imagine this as a small rectangular box where your table rows are stored.

Extent

Imagine this as a big rectangular box tightly packed with large number of blocks.

Segment

Imagine this a huge rectangular box tightly packed with many number of extents.

datafile

Imagine this as a huge word document which is filled up with multiple number of Segments.

so until now all the above mentioned components exist physically on the hard disk.

Tablespace

Imagine this as an imaginary big circle which contains lot of data files.so this big imaginary circle
doesnt exist on the disk but it is a logical way to group the datafiles as one single set and to call them
with a name called as tablespace name.

its like you group 11 people and call it a football team. The people exist physically but can you
physically see the football team?

In the same way all the datafiles exist physically on the hard disk but the tablespace is a logical way
to group the datafiles.

what happens internally when i create a table in oracle?
when you create a table , oracle internally creates a segment for the table.when you create a table
you mention a tablespace name ,so oracle can know the data files which belong to the tablespace
and so allocates the necessary segment for the table.in this datafile.


redolog

one fine day you are deleting , inserting or updating data  in your database tables. oracle initially
s
aves those changes in the redo log files . only after that are the changes saved into datafiles.
so in case of a database crash you always need redo log files to recover your database.
imagine redo log file as a word document with one page . what happens when you completely fill the
page? oracle will overwrite it. so how do you recover from a database crash if oracle overwrites the
page? that is why oracle has a functionality to save this page with another name. so it means once
your word document with 1 page is full , oracle automatically saves this page with a different name
and then will overwrite the original page. so when there is a database crash then oracle can use these
backed up files to recover the database. This concept is called archiving. These backed up files are
called archived redo logs or simply archive logs. so it means redo logs are automatically backed up
as archive logs. so what should you do after creating a database? you should manually enable
archive log mode of your database. only then will oracle automatically start backing up your redo log
files.


archive log

we just talked above about what an archive log is.

control file

control file is like a brain of the database. you use your brain to store information about your friends,
family and about oracle. Same way oracle uses the control file to find out what are the different
tablespaces , datafiles , redo log files , temp files , undo files  belonging to it and whether they are
undamaged or damaged etc. so without a control file you cant start your database .

undo file

You need undo file when you are deleting , updating or selecting data from a table. if you have made
some changes to your table , as you know the rows are stored in blocks so it means you are actually
changing the blocks. This information is also maintained in the undo file so if you want to rollback
your changes then this information in undo file is used to rollback the changes.

rollback segments

before oracle 9i there was no undo file , there were only rollback segments which a dba had to
configure.so rollback segments has the same functionality as the undo file but before 9i a dba was
using rollback segments and from 9i onwards a dba uses the undo file and oracle internally manages
the rollback segments as an undo file is nothing but a set of rollback segments.


you can read m
ore  detailed information about the above topics here

overview of data blocks

overview of extents

overview of segments

overview of tablespaces

controlfile

redolog

archived redo log

undo data file


To go back to the 50 dba terms for the new dba please click the link.