Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
   
The Basics of Oracle Architecture




By Budi Raharjo
Feb 13, 2006

Digg! digg!     Print    email to friend Email to Friend

Note: This article was written for educational purpose only. Please refer to the related vendor documentation for detail.




Download Free Confio Software

The Basics of Oracle Architecture


By: Budi Raharjo
http://mbraharjo.blogspot.com


As an Oracle DBA, you must be understand the concepts of Oracle architecture clearly. It is a basic step or main point that you need before you go to manage your database. By this article, I will try to share my knowledge about it. Hope it can be useful for you.

What is An Oracle Database?


Basically, there are two main components of Oracle database 末 instance and database itself. An instance consists of some memory structures and the background processes, whereas a database refers to the disk resources. Figure 1 will show you the relationship.





Figure 1. Two main components of Oracle database


Instance



As we cover above, the memory structures and background processes contitute an instance. The memory structure itself consists of System Global Area (SGA), Program Global Area (PGA), and an optional area 末 Software Area Code. In the other hand, the mandatory background processes are Database Writer (DBWn), Log Writer (LGWR), Checkpoint (CKPT), System Monitor (SMON), and Process Monitor (PMON). And another optional background processes are Archiver (ARCn), Recoverer (RECO), etc. Figure 2 will illustrate the relationship for those components on an instance.




Figure 2. The instance components

System Global Area

SGA is the primary memory structures. When Oracle DBAs talk about memory, they usually mean the SGA. This area is broken into a few of part memory 末 Buffer Cache, Shared Pool, Redo Log Buffer, Large Pool, and Java Pool.

Buffer Cache

Buffer cache is used to stores the copies of data block that retrieved from datafiles. That is, when user retrieves data from database, the data will be stored in buffer cache. Its size can be manipulated via DB_CACHE_SIZE parameter in init.ora initialization parameter file.

Shared Pool

Shared pool is broken into two small part memories 末 Library Cache and Dictionary Cache. The library cache is used to stores information about the commonly used SQL and PL/SQL statements; and is managed by a Least Recently Used (LRU) algorithm. It is also enables the sharing those statemens among users. In the other hand, dictionary cache is used to stores information about object definitions in the database, such as columns, tables, indexes, users, privileges, etc.

The shared pool size can be set via SHARED_POOL_SIZE parameter in init.ora initialization parameter file.

Redo Log Buffer

Each DML statement (insert, update, and delete) executed by users will generates the redo entry. What is a redo entry? It is an information about all data changes made by users. That redo entry is stored in redo log buffer before it is written into the redo log files. To manipulate the size of redo log buffer, you can use the LOG_BUFFER parameter in init.ora initialization parameter file.

Large Pool

Large pool is an optional area of memory in the SGA. It is used to relieves the burden place on the shared pool. It is also used for I/O processes. The large pool size can be set by LARGE_POOL_SIZE parameter in init.ora initialization parameter file.

Java Pool

As its name, Java pool is used to services parsing of the Java commands. Its size can be set by JAVA_POOL_SIZE parameter in init.ora initialization parameter file.

Program Global Area

Although the result of SQL statemen parsing is stored in library cache, but the value of binding variable will be stored in PGA. Why? Because it must be private or not be shared among users. The PGA is also used for sort area.

Software Area Code

Software area code is a location in memory where the Oracle application software resides.

Oracle Background Processes

Oracle background processes is the processes behind the scene that work together with the memories.

DBWn

Database writer (DBWn) process is used to write data from buffer cache into the datafiles. Historically, the database writer is named DBWR. But since some of Oracle version allows us to have more than one database writer, the name is changed to DBWn, where n value is a number 0 to 9.

LGWR

Log writer (LGWR) process is similar to DBWn. It writes the redo entries from redo log buffer into the redo log files.

CKPT

Checkpoint (CKPT) is a process to give a signal to DBWn to writes data in the buffer cache into datafiles. It will also updates datafiles and control files header when log file switch occurs.

SMON

System Monitor (SMON) process is used to recover the system crach or instance failure by applying the entries in the redo log files to the datafiles.

PMON

Process Monitor (PMON) process is used to clean up work after failed processes by rolling back the transactions and releasing other resources.

Database



The database refers to disk resources, and is broken into two main structures 末 Logical structures and Physical structures.

Logical Structures

Oracle database is divided into smaller logical units to manage, store, and retrieve data effeciently. The logical units are tablespace, segment, extent, and data block. Figure 3 will illustrate the relationships between those units.




Figure 3. The relationships between the Oracle logical structures

Tablespace

A Tablespace is a grouping logical database objects. A database must have one or more tablespaces. In the Figure 3, we have three tablespaces 末 SYSTEM tablespace, Tablespace 1, and Tablespace 2. Tablespace is composed by one or more datafiles.

Segment

A Tablespace is further broken into segments. A segment is used to stores same type of objects. That is, every table in the database will store into a specific segment (named Data Segment) and every index in the database will also store in its own segment (named Index Segment). The other segment types are Temporary Segment and Rollback Segment.

Extent

A segment is further broken into extents. An extent consists of one or more data block. When the database object is enlarged, an extent will be allocated. Unlike a tablespace or a segment, an extent cannot be named.

Data Block

A data block is the smallest unit of storage in the Oracle database. The data block size is a specific number of bytes within tablespace and it has the same number of bytes.

Physical Structures

The physical structures are structures of an Oracle database (in this case the disk files) that are not directly manipulated by users. The physical structure consists of datafiles, redo log files, and control files.

Datafiles

A datafile is a file that correspondens with a tablespace. One datafile can be used by one tablespace, but one tablespace can has more than one datafiles.

Redo Log Files

Redo log files are the files that store the redo entries generated by DML statements. It can be used for recovery processes.

Control Files

Control files are used to store information about physical structure of database, such as datafiles size and location, redo log files location, etc.

 

 



Comments/Reviews on this article:
shailesh  shirurkar
Apr 02, 2006

VERY GOOD
keep sharing keep going

deepak  sony
Apr 03, 2006

very good

Kushal  ratnaker
Apr 06, 2007

This graphical representation is very good for Oracle DBA.

PRABODH  SRIVASTAVA
Apr 13, 2006

Excellent work ! prabodh

Bharat  Pardeshi
Feb 13, 2008

Thanks... very good explaination. It is really helpful

rob  
Feb 14, 2006

Wow.. Great. Now I understand it clearly. Thanks man.

Jayanta  Sur
Feb 22, 2006

great way to explain

Surya  Kuchur
Jun 15, 2006

Excellent... keep going...

Amit  Yadav
Mar 02, 2006

Thanks for posting such a stupendous article.
Everything is to the point in very simple language.
Thanks again Budhi!!!1

Raj  K
Mar 08, 2006

Must read article for the budding DBA... Great Work Budi Raharjo.

Udaya  Bhaskar
Mar 10, 2006

Good Work man

Arindam  Ray
Mar 16, 2006

Very Good Article for the Beginner

Asad  Ahmed
Mar 17, 2006

Excellent work cheif .Hope to see such help in future as well for boys like us who are preparing
DBA exams

VGOPAL  RAO
Mar 20, 2006

Thanks for u r extreme knowledge sharing with us.
and hope the same in future.

quresh  gohria
Mar 21, 2006

great work man keep going on u will soon be the mastermind

Hemant  Patel
Mar 25, 2006

Excellent work buddy !

Hemant.

murali  mani
Mar 25, 2006

Good job. Keep going...
Murali

Lachman  Orie
May 17, 2006

You are great man. Thank you for sharing your knowledge.

Devesh  Ghule
May 31, 2006

Diagramatic representation of architecture really impressed every ions in oracle schema. Great!!

rashi  sivaraman
Nov 06, 2006

Super.Thank you so much.

 
About author:

Budi Raharjo is a professional software engineer from Indonesia (PT. Sigma Delta Duta Nusantara, Bandung). He is an author of C++, C++Builder, Pascal, and Oracle books in his country.

 

Please login to post your comments





  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software