Exforsys.com
 
Home Tutorials Oracle 10g
 

Oracle 10g Free Training: Oracle Concepts and Database Architecture

 

Oracle 10g Free Training: Oracle Concepts and Database Architecture - Page 2

Page 2 of 2


Oracle Instance and Database


In Oracle to access the data in the database, Oracle uses a set of Background processes that are shared by every user. Also, along with this there is some memory structure that stores the most recently queried data from the database.

A Database Instance (also save as Server) is set of memory structures and background processes that access a set of database files. It is possible for the single database to contain multiple instances, which is known as Real Application Cluster. The parameters that determine the size and composition of an oracle instance are either stored in an initialization file called init.ora or in spfile.ora. The initialization parameter file is read during instance start up and may be modified by the DBA. Any modification made will not be affected until the next start up.



Figure-1 Instance and database


System Global Area (SGA)

Oracle uses an area of shared memory called the system global area (SGA) and a private memory area for each process called the program global area (PGA). The SGA consists of:

System global area:

The SGA is a shared memory region that contains data and control information for one oracle instance. Oracle allocates the SGA when an instance starts and de-allocates it when the instance shut downs. Every instance has the SGA .The entire SGA should be large as possible to increase the system performance and to reduce disk I/O.

The information stored in the SGA is divided into three memory structures,

1) Database buffers cache.

2) Redo log buffers.

3) Shared pool.

Database buffers cache: The database buffer stores the most recently used blocks of data. The set of database buffers in an instance is the database buffer cache. The buffer cache contains modified as well as unmodified blocks. Because the most recently and most frequently used data is kept in memory. It improves the performance of system by reducing the disk I/O operations.

Redo log buffers: The redo log buffer stores redo entries. This is a log of changes made to the database. The redo entries stored in the redo log buffers are written to an online redo log. An online redo log is a set of two or more files that record all the changes made to oracle data files and control files.


Shared pool: The shared pool caches various constructs that can be shared among users, for example SQL shared area. For example’s SQL statements are cached so that they can be reused. Stored procedures can be cached for faster access. Note that in previous versions “out of memory” error were occurs if the shared memory was full. In oracle 10g it does not happen. It provides automatic shared memory tuning.


Program global area

PGA is a memory buffer that contains data and control information for a server process. A server process is a process that services a client’s requests. A PGA is created by oracle when a server process is started. The information in a PGA depends on the oracle configuration. The PGA area is a non-shared area of memory created by oracle when a server process is started.

The basic difference between SGA and PGA is that PGA cannot be shared between multiple processes in the sense that it is used only for requirements of a particular process whereas the SGA is used for the whole instance and it is shared.


Processes

The relationships between the databases’ physical and memory structures are maintained and enforced by the Background Process. These are database’s own background processes that may vary in the number depending in your database configuration. The Trace files are only created when there is any problem. Some of the Background Processes are:


SMON:




SMON stands for System Monitor and this database background process performs instance recovery at the start of the database. In a multiple instance system, SMON of one instance can also perform instance recovery for other instances that have failed. SMON also cleans up temporary segments that are no longer in use and recovers dead transactions skipped during crash and instance recovery because of file-read or offline errors. It coalesces i.e. combines contiguous free extents into larger free extents.

PMON:

PMON stands for the Process Monitor and this database background process cleans up failed user processes. PMON is responsible for releasing the lock i.e. cleaning up the cache and freeing resources that the process was using. Its effect can be seen when a process holding a lock is killed.

DBWR:

The DBWR (Database Writer) background process is responsible for managing the contents of the data block buffer cache and dictionary cache. DBWR performs batch writes of changed block. Since Oracle uses write-ahead logging, DBWR does not need to write blocks when a transaction commits. In the most common case, DBWR writes only when more data needs to be read into the system global area and too few database buffers are free. The least recently used data is written to the datafiles first.

Although there is only one SMON and one PMON process running per database instance, one can have multiple DBWR processes running at the same time. Note the number of DBWR processes running is set via the DB_WRITER_PROCESSES.

LGWR:

The LGWR (Log Writer) background process manages the writing of the contents of the redo log buffer to the online redo log files. LGWR writes the log entries in the batches form. The Redo log buffers entries always contain the most up-to-date status of the database. Note LGWR is the only one process that writes to the online redo log files and the only one that directly reads the redo log buffer during to the normal database operation.


Archiver (ARCH):

The Archiver process reads the redo log files once Oracle has filled them and writes a copy of the used redo log files to the specified archive log destination(s). Actually, for most databases, ARCH has no effect on the overall system performance. On some large database sites, however, archiving can have an impact on system performance. We can specify up to ten ARCn processes for each database instance LGWR will start additional Archivers as needed, based on the load, up to the limit specified by the initialization parameter LOG_ARCHIVE_MAX_PROCESSES.


Checkpoint process (CKPT):

All modified information in database buffer in the SGA is written to the datafiles by a database write process (DBWR). This event indicates a checkpoint. The checkpoint process is responsible for signaling DBWR at checkpoints and updating all of the datafiles and control files of the database.

Recover (RECO)

The recover process automatically cleans up failed or suspended distributed transactions.




Frequently Asked Questions

  1. What is a schema?
  2. What is an instance?
  3. What is a tablespace?
  4. What are the differences between SGA and PGA?
  5. What is the significance of background processes?]
  6. What is the difference between instance and database?
  7. Can I have multiple instances of database?
  8. What is the use of control files?
  9. What is the use of redo log files?
  10. What is checkpoint process?


First Page: Oracle 10g Free Training: Oracle Concepts and Database Architecture


Read Next: Oracle 10g Free Training:Creating Database Using Database Configuration Assistant (DBCA)



 

 

Comments


sanjeev111 said:

  this information is not completed, plz give brief
July 25, 2006, 7:50 am

jibankr1983 said:

  :)PLEASE MORE DIAGRAMATIC PRESENTATION
October 8, 2006, 12:53 am

TANMAYA PRADHAN said:

  hi,

This is a nice presentation of concepts.

but i have a doubt,

What is a backup and how we take backup?

i Hope i will get the answer very soon.

Thanks & Regards
Tanmaya Pradhan.







April 13, 2007, 6:08 am

Mudit k. Sharma said:

  I found this information very use full to understand the basic architecture of oracle.

Grate job done and also help full to start your jurnery for understanding the oracle.

Regards,

Mudit K. Sharma
July 24, 2007, 5:53 pm

Radha.M said:

  This information is very useful for the beginners to understand the oracle.This helps very much for the people who want to learn oracle.
Regards,
Madadi.Radha
August 14, 2007, 12:47 am

mohammadmartak said:

  if iam issued SELECT query to database, what process happen to SGA, which background proccess handle the query?
August 20, 2007, 9:34 am

Mandeep.A said:

  Wonderfull
September 27, 2007, 11:54 pm

T.somasekhar said:

  very good explain of back ground process
October 7, 2007, 2:36 am

kishorereddy said:

  very usefull for freshers
November 16, 2007, 12:03 pm

pradeep rai said:

  Its really usefull. Good sumerization of a big topic.
November 27, 2007, 12:22 am

murtuza.r said:

  Hi,
Backup is the procedure to secure your data/Information in other storage media or other destination. Incase of any crash you can restore it back and save the information which can be lost. There is some method from which you can take the backup but before that you need to understand the different type of backup. One is Physical backup(Cold backup) and other is Logical Backup(HOT BAckup). Cold backup is where you have to shutdown the database and copy the Datafile, redologfile and controlfile to other location/media. HOT backup in that you dont need to shutdown you database. just apply some commands online and you will be able to take the backup of those files. Like say you want to take the backup of control file, apply command "Alter database backup controlfile to 'filename' or to Trace." To take the backup of datafile,
"Alter tablespace begine backup;". Than copy all the datafiles pertaining to this tablespace in other location media and after copying all the datafile of that tablespace, apply another command which isa compulsory . "Alter tablespace < tablespace_name> end backup." for more information Tanmaya , just mail me on murtuza231@rediffmail.com.
November 28, 2007, 11:30 pm

murtuza.r said:

  @mohammadmartak

When you fire the SQL Query, Besically there are three steps involved in it.
1) Parse
2) Execution
3) Fetch
In Step(1) : During the parse phase, the SQL statement is passed from user process to Oracle and a parsed representation of the SQL statement is loaded into a shared SQL area. Parsing is the process of

1) translating SQL statement, verifying it to be a valid statement
2) performing data distionary lookups to check table and column defination
3) acquiring parse locks on the required objects so that their defination do not change during the statement's parsing.
4) checking previleges to access referenced schema objects.
5) determining the optimal execution plan for the statement.
6) loading it into a shared SQL area.

A SQL statement is parsed only if a shared SQL area for an identical SQL statement does not exist in the shared pool. In this case a new shared SQL area is allocated and the statement is parsed.
Step(2) ...During execute phase, at this point Oracle has all necessary information and resources, so the statement is executed.
Step(3) .. In the fetch phase, rows are selected and ordered(if requested by the query), and each successive fetch retrieves another row of the result, until the last row has been fetched.
November 30, 2007, 4:11 am

sridhar36 said:

  Highly Appreciate the Work , the Language Used was very easy to understand and make others understand
December 23, 2007, 7:21 am

MONA said:

  Highly Appreciate the Work ,Its really usefull.
monaabdellatif;
January 14, 2009, 5:02 am

Ashraf said:

  really usefull
January 27, 2009, 6:30 am

Rajalakshmi said:

  Its very useful for beginners. But a diagrammatic representation would have been good to explain the Oracle DB Architecture.
February 6, 2009, 1:34 am

Sampson Mensah said:

  Hi, this is very wonderful, even it a kind motivation and useful for beginners like us will know more and excel higher in the Database management with DBA itself. Please i have a problem with granting a previllages to user i have created. Also i am very interested in your programe, may i know please if there could be any posible way for me to enjoy these intensive free training your are making.

Thank you all

I will be expecting your kind answer in my 'inbox' of the e-mail i have provided.

Thank you once again.
February 19, 2009, 11:23 am

Hannibal said:

  Can any one pls come up with the answer for the following questions and i would really appreciate the effort.

1)when a recovery takes place for media failure the reco process recovers using archive file, does it use db cache to write(dbwr) the lost information to datafile.(b'coz no other process can write the datafile) and where to find information.

2)export utility uses which memory area.

3)what's the status of a cursor(implicit) in shared pool.

thanks in advance.









April 3, 2009, 3:10 pm

foster shadrack said:

  I want to learn to build a platform, what do I need to start with first? I want to manage data's. How can I backup files and directories?

Thanks and better regards
April 6, 2009, 11:53 am

ora10g said:

  Can anyone please tell me what type of Oracle 10g backup strategy we use in a real time scenario?
April 16, 2009, 4:11 am

Akila said:

  Hi, This is a nice documentation for a beginners who doesn't know ABCD in oracle. Each line has important information. Good Work.
June 15, 2009, 4:00 pm

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2009 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape