Professional Documents
Culture Documents
These two are very closely related but a database can be mounted and opened by many instances. An instance
may mount and open only a single database at any one point in time.
• Parameter Files - These files tells Oracle were to find the control files. Also they detail how big the
meory area will be, etc
• Data Files - These hold the tables indexes and all other segments
• Redo Log Files - Our transaction logs
• Control Files - Details the location of data and log files and other relevant information about their state.
• Temp Files - used for disk-based sorting and temporary storage
• Password Files - Used to authenticate users logining into the database.
Parameter Files
The parameter file for Oracle is the commonly know file init.ora (or init<oracle sid>.ora). The file itself is a
very simple plain text file (on oracle 9i is can also be a binary file) and details information regarding block size,
location of the control files, etc. On a windows server the file can be found in
[ORACLE_HOME]/admin/<sid>/pfile but can be in any location by using the "startup pfile = <location>" .
Sometimes a parameter may start with a underscore this normally refers to a undocumented parameter and is
normally only requested by Oracle support.
Data Files
Normally there are at least two data files, one for System data and the other for User data.
• Segments - are database objects, a table, a index, rollback segments. Every object that consumes space is
a segment. Segments themselves consist of one or more extents.
• Extents - are a contiguous allocation of space in a file. Extents, in turn, consist of blocks
• Blocks - are the smallest unit of space allocation in Oracle. Blocks normally are 2KB, 4KB or 8KB in
size but can be larger.
The relationship between segments, extents and blocks looks like this
Oracle Architecture
Every block within the Oracle database will be the same size and all block generally have the same format,
which looks something like the below, note that the block size will normally be 2KB, 4KB or 8KB.
contains information regarding the type of block (a table block, index block,
Header etc), transaction information regarding active and past transactions on the block
and the address (location) of the block on the disk
Table
contains information about the tables that store rows in this block
Directory
contains information describing the rows that are to be found on the block. This
Row
is an array of pointers to where the rows are to be found in the data portion of
Directory
the block.
Block The three above pieces are know as the Block Overhead and are used by Oracle
overhead to manage the block itself.
A tablespace is a container which holds segments. Each and every segment belongs to exactly one tablespace.
Segments never cross tablespace boundaries. A tablespace itself has one or more files associated with it. An
extent will be contained entirely within one data file.
• A segment (table, index, etc) is made up of one or more extents. A segment exists in a tablespace but
may have data in many data files within a tablespace.
• An extent is a continuous set of blocks on a disk. An extent is in a single tablespace and is always in a
single file within that tablespace.
• A block is the smallest unit of allocation in the database. A block is the smallest unit of i/o used by the
database.
Temp Files
Oracle will use temorary files to store results of a large sort operation when there is insufficient memory to hold
all of it in RAM. Temporary files never have redo generaed for them, although they have UNDO generated.
Temporary data files never need to be backed up.
Control Files
The control files contain a directory of the other files Oracle needs. The control files tell the instance where the
database and online redo log files are. The control files also tell Oracle about checkpoints that have taken place,
the name of the database, archive redo log history, etc. Control files should be duplicated across different disks
as it make recovery much harder without them.
Redo log files are used for recover purposes only. There are two types of redo log files online and archive.
There are at least 2 online redo log files and they are used in a circular fashion when one fills up oracle will
switch to the next log file.
When a redo log file fills up and before it is used again the file is archived for safe keeping, this archive file
with other redo log files can recover a database to any point in time. It is best practice to turn on
ARCHIVELOG mode.
There are five memory stuctures that make up the System Global Area (SGA). The SGA will store many
internal data structures that all processes need access to, cache data from disk, cache redo data before writing to
disk, hold parsed SQL plans and so on.
SGA
Oracle Architecture
Library cache includes the shared SQL area, private SQL areas, PL/SQL procedures and
packages the control structures such as locks and library cache handles
Shared Pool Dictionary cache is a collection of database tables and views containing information about the
database, its structures and users.
DB_2K_CACHE_SIZE
DB_4K_CACHE_SIZE
DB_8K_CACHE_SIZE
DB_16K_CACHE_SIZE
DB_32K_CACHE_SIZE
Memory
Memory area Displaying the information
location
SGA sql> show sga;
SGA (detailed) use table v$sgastat;
If you have MTS configured then the UGA must be stored in a memory stucture that everyone has access to and
this would be the SGA. However if you are using a dedicated server connection then the UGA becomes part of
the PGA
Each process connected to the database requires its own area of memeory this is know as the Program Global
Area (PGA). This area stores variables, arrays and other information that do not need to be shared with other
processes.
Oracle Architecture
There could be upto 11 server process depending on the server configuration, Windows will only have one
process called Oracle, this process will have one thread for each of the below processes.
• When the redo log buffer is a third full or contains 1 Mb of bufferd data
Copy online redo log file to another location when LGWR fills up, these log files
Archive process ARCn
would be used to perform media recovery.
Used in OPS and keeps each servers SGA in the clusters consistent with each
Block server process BSP
other.
Used in OPS and monitors all instances in a cluster to detect a failure of an
Lock monitor process LMON
instance.
Used in OPS and controls the global locks and global resources for the block
Lock manager daemon LMD
buffer cache in a clustered environment.
Used in OPS and is the same as the LMD daemon but handles requests for all
Lock process LCKn
global resources other than database block buffers