You are on page 1of 14

Home | Help | Sign in

Search Toolkit

Top of Form

Bottom of Form

ORACLE 10G ARCHITECTURE WITH DIAGRAM


A ARTICLE BY UC ERTIFY, EXFORSYS

CONTENTS

• Oracle 11g Data Compression


• Oracle applications scripts - With Example
• Oracle SQL Rewriting - Faster Performance
more

Link Citation Email Print Favorite Collect this page

U PDATE N EWS : 3 N EW KNOLS (O CT 2010)

Oracle 11g New Features


http://knol.google.com/k/mayur-v/oracle-database-11g-new-features/232y3pcqwxodx/100

Oracle 12R General Ledger Features


http://knol.google.com/k/mayur-v/oracle-12r-general-ledger-features/232y3pcqwxodx/101

ORACLE 11G DATA COMPRESSION


http://knol.google.com/k/mayur-v/oracle-11g-data-compression/232y3pcqwxodx/68#

------------------------------------------------------------------------------------------------------------------------------------------------------------
--

U PDATE N EWS : 3 N EW KNOLS (A PRIL -M AY 2010)

W HAT IS A UTOMATIC D ATABASE D IAGNOSTIC M ONITOR (ADDM) IN O RACLE D ATABASE 10 G ?


http://knol.google.com/k/mayur-v/what-is-automatic-database-diagnostic/232y3pcqwxodx/62#
ORACLE APPLICATIONS SCRIPTS - WITH EXAMPLE
http://knol.google.com/k/mayur-v/oracle-applications-scripts-with-example/232y3pcqwxodx/46#

ORACLE SQL REWRITING - F ASTER P ERFORMANCE


http://knol.google.com/k/mayur-v/oracle-sql-rewriting-faster-performance/232y3pcqwxodx/45#
------------------------------------------------------------------------------------------------------------------------------------------------------------
---
Oracle is an RDBMS (Relational Database Management System). The Oracle database architecture can be described
in terms of logical and physical structures. The advantage of separating the logical and physical structure is that the
physical storage structure can be changed without affecting the logical structure.

L OGICAL S TRUCTURE
The logical structure for Oracle RDBMS consists of the following elements:

• Tablespace
• Schema
T ABLESPACE
The Oracle database consists of one or more logical portions called as ‘Tablespaces’. A tablespace is a logical
grouping of related data.

A database administrator can use Tablespaces to do the following:

• Control disk space allocation for database data.


• Assign specific space quotas for database users.
• Perform partial database backup or recovery operations.
• Allocate data storage across devices to improve performance.
Each database has at least one Tablespace called SYSTEM Tablespace. As part of the process of creating the
database, Oracle automatically creates the SYSTEM tablespace. Although a small database can fit within the
SYSTEM tablespace, it's recommended that to create a separate tablespace for user data.

Oracle uses the SYSTEM tablespace to store information like the data dictionary. Data dictionary stores the metadata
(or the data about data). This includes information like table access permissions, information about keys etc.

Data is stored in the database in form of files called as datafiles. Each Tablespace is a collection of one or more
Datafiles. Each data file consists of ‘Data blocks’, ‘extents’ and ‘segments’.

D ATA B LOCKS
At the finest level of granularity, an ORACLE database's data is stored in data blocks (also called logical blocks,
ORACLE blocks, or pages). An ORACLE database uses and allocates free database space in ORACLE data blocks.

E XTENTS
The next level of logical database space is called an extent. An extent is a specific number of contiguous data blocks
that are allocated for storing a specific type of information.

S EGMENTS
The level of logical database storage above an extent is called a segment. A segment is a set of extents that have
been allocated for a specific type of data structure, and all are stored in the same tablespace. For example, each
table's data is stored in its own data segment, while each index's data is stored in its own index segment.ORACLE
allocates space for segments in extents. Therefore, when the existing extents of a segment are full, ORACLE
allocates another extent for that segment. Because extents are allocated as needed, the extents of a segment may or
may not be contiguous on disk, and may or may not span files.

An Oracle database can use four types of segments:

• Data segment--Stores user data within the database.


• Index segment--Stores indexes.
• Rollback segment--Stores rollback information. This information is used when data must be rolled back.
• Temporary segment--Created when a SQL statement needs a temporary work area; these segments are destroyed
when the SQL statement is finished. These segments are used during various database operations, such as sorts.
S CHEMA
The database schema is a collection of logical-structure objects, known as schema objects that define how you see
the database's data. A schema also defines a level of access for the users. All the logical objects inoracle are grouped
into a schema.

A scheme is a logical grouping of objects such as:


• Tables
• Clusters
• Indexes
• Views
• Stored procedures
• Triggers
• Sequences

P HYSICAL S TRUCTURE
The physical layer of the database consists of three types of files:

1. One or more Datafiles


2. Two or more redo log files
3. One or more control files

D ATAFILES (. DBF FILES ):


Datafiles store the information contained in the database. One can have as few as one data file or as many as
hundreds of datafiles. The information for a single table can span many datafiles or many tables can share a set of
datafiles. Spreading tablespaces over many datafiles can have a significant positive effect on performance. The
number of datafiles that can be configured is limited by theOracle parameter MAXDATAFILES.

R EDO L OG F ILES (. RDO & . ARC ):


Oracle maintains logs of all the transaction against the database. These transactions are recorded in files called
Online Redo Log Files (Redo Logs). The main purpose of the Redo log files is to hold information as recovery in the
event of a system failure. Redo log stores a log of all changes made to the database. The redo log files must perform
well and be protected against hardware failures (through software or hardware fault tolerance). If redo log information
is lost, one cannot recover the system.

When a transaction occurs in the database, it is entered in the redo log buffers, while the data blocks affected by the
transactions are not immediately written to disk. In anOracle database there are at least three or more Redo Log files.

Oracle writes to redo log file in a cyclical order i.e. after the first log file is filled, it writes to the second log file, until that
one is filled. When all the Redo Log files have been filled, it returns to the first log file and begin overwrite its content
with new transaction data. Note, if the database is running in the ARCHIVELOG Mode, the database will make a copy
of the online redo log files before overwriting them.

C ONTROL F ILES (. CTL ):


Control files record control information about all of the files within the database. These files maintain internal
consistency and guide recovery operation. Control files contain information used to start an instance, such as the
location of datafiles and redo log files;Oracle needs this information to start the database instance. Control files must
be protected. Oracle provides a mechanism for storing multiple copies of control files. These multiple copies are
stored on separate disks to minimize the potential damage due to disk failure. The names of the database’s control
files are specified via the CONTROL_FILES initialization parameter.
The Oracle Server architecture can be described in three categories:

1 User-related processes
2 Logical memory structures that are collectively called an Oracle instance
3 Physical file structures that are collectively called a database

User Processes:
At the user level, two processes allow a user to interact with the instance and, ultimately, with the database: the User
Process and the Server Process. Whenever a user runs an application, such as a human resources or order-taking
application, Oracle starts a User Process to support the user's connection to the instance. Depending on the technical
architecture of the application, the User Process exists either on the user's own PC or on the middle-tier application
server. The User Process then initiates a connection to the instance. Oracle calls the process of initiating and
maintaining communication between the User Process and the instance a connection. Once the connection is made,
the user establishes
a session in the instance.

After establishing a session, each user then starts a Server Process on the host server itself. It is this Server Process
that is responsible for performing the tasks that actually allow the user to interact with the database.

In addition to the User and Server processes that are associated with each user connection, an additional memory
structure called the Program Global Area (PGA) is also created for each user. The PGA stores user-specific session
information such as bind variables and session variables. Every Server Process on the server has a PGA memory
area.

The Oracle Instance:


An Oracle Server instance is made up of Oracle's main memory structure, called the System Global Area (SGA), and
several Oracle background processes. It is with the SGA that the Server Process communicates when the user
accesses the data in the database.

The System Global Area:


The SGA is made up of three required components and three optional components.

Required Components
Shared Pool (Required) :Caches the most recently used SQL statements that have been issued by database users
Database Buffer Cache (Required) : Caches the data that has been most recently accessed by database users
Redo Log Buffer (Requires) : Stores transaction information for recovery purposes
Java Pool (Optional): Caches the most recently used Java objects and application code when Oracle's JVM option is
used
Large Pool (Optional):: Caches data for large operations such as Recovery Manager
(RMAN) backup andrestore activities and Shared Server components
Streams Pool (Optional): Caches the data associated with queued message requests when Oracle's Advanced
Queuing option is used

With the advent of so many big enterprises, the need to create a more sophisticated DBMS has also increased. For
appointment as a DBA, a high level of skill and expertise is required. The major tasks that should be performed by a
DBA are as follows:
• Judging what server hardware will be required to run the Oracle 10g database software
• Installing and configuring the Oracle 10g database software on the server hardware
• Creating a database and managing tables and other database objects
• Creating and managing database users
• Configuring backup and recovery processes for the database
• Monitoring and tuning the database performance
Now, the point is how a DBA can perform the above-mentioned tasks. To perform all these tasks in an efficient
manner, a DBA must be very well versed with the underlying Oracle architecture.
The Oracle server architecture
The Oracle server architecture is basically categorized as follows:
• Logical layer
• Physical layer
The logical layer comprises one or more tablespaces and the database schema. The database schema consists of
tables, clusters, indexes, views, procedures, triggers, sequences, and so on. The database schema is a collection of
schema objects.
The relationship between segments, extents, and data blocks
The hierarchy of Oracle disk-space management is as follows:
• Tablespaces: These are at the highest level of Oracle disk-space management.
• Segments
• Extents
• Data blocks: These are at the lowest level of Oracle disk-space management.
The figure below depicts the relationship between segments, extents, and data blocks:

The physical layer comprises the following files:


• The control file: Though it is the smallest file (1MB-5MB) of the database, it is the most crucial and critical file. The
criticality of this file is ascribed to the fact that if it is damaged then the database recovery operation becomes tedious.
It contains the requisite information to start the database. The names and locations of all the control files of the
database can be obtained from the V$CONTROLFILE dynamic performance view.
• Data files: These hold data that is stored in tables of a database. They are usually the largest files in the database,
ranging in size from MB, GB, to TB.
• Redo Log files: These files contain information that helps in recovery in the event of system failure. It contains
information stored in the Redo Log Buffer. The information in the Redo Log Buffer is written into Redo Log files by the
LGWR background process. The Redo Log files are generally multiplexed and copied for recovery purposes. Sets of
redo Log files are known as Redo Log groups. Each database has minimum of two Redo Log groups. Redo Log
groups are used in a circular fashion.
The figure below depicts the use of Redo Log files in circular fashion:
The figure above shows three Redo Log groups. Each group consists of two members. The first member of each
Redo Log group is stored in directory D1 and the second member is stored in directory D2.
Note:
1. The V$LOGFILE dynamic performance view is used to obtain information about the names and locations of the Redo
Log groups and their members.
2. LGWR writes every three seconds to a Redo Log group in the case of the following events:
○ Whenever a user commits a transaction
○ Whenever the Redo Log Buffer is one-third (1/3) full
The Oracle memory structure
The most basic components of Oracle memory are:
• SGA- It stands for System Global Area. SGA is allocated whenever an Oracle instance starts and gets de-allocated
when the Oracle instance is shutdown.
Components of SGA:
1. The Database Buffer Cache
2. The Redo Log Buffer
3. The Shared Pool
• PGA- It stands for Program Global Area. It is a region in memory that contains data and control information for a
single process. This can be either a server or a background process. A PGA is allocated whenever an Oracle
database user connects to a database and a session is created for him/her.
Oracle processes
There are two categories of processes that run with an Oracle database. They are mentioned below:
• User processes
• System processes
The following figure illustrates the relationship between user processes, server processes, PGA, and session:
The first interaction with the Oracle-based application comes from the user computer that creates a user process. The
user process then communicates with the server process on the host computer. Here, PGA is used to store session
specific information.
Oracle background processes
Oracle has a large number of background processes. The background processes are categorized into:
• Required Oracle background processes
• Optional Oracle background processes
Some of the background processes are:
1. DBWR – It writes data blocks from SGA to data files.
2. LGWR – It writes data from the Log Buffer to the redo log.
3. CKPT – It timestamps all the data files and the control files whenever a checkpoint occurs.
4. PMON – It stands for process monitor. It keeps track of database processes. It also cleans up the process that has
died pre-maturely. The result is that all the cache and the resources are freed up. It also restarts those dispatcher
processes that might have failed.
Some of the main functions of background processes are:
○ Communication among Oracle instances
○ Performing computer maintenance
○ Writing the dirty blocks to disk
5. SMON – It stands for system monitor. It performs instance recovery at instance startup.
The following figure depicts the Oracle Architecture in detail:
The figure above shows various components of SGA, Oracle background processes, and their interactions with
control files, data files, Redo Log files, and archived redo logs.
The Oracle instance
The Oracle instance consists of SGA and all the Oracle background processes. To manage the size of SGA, two
initialization parameter files known as PFILE and SPFILE are used. There are a total of 250-initialization parameters.
PFILE holds 30 of those 250 initialization parameters. Oracle does not recommend modifying the rest of the 220
initialization parameters.
This article has described the various facts involved in order to understand the underlying Oracle architecture. After
reviewing this article, the database user is now well equipped to understand several components of Oracle
architecture.

COMMENTS
Sign in to write a comment
NarayanaRao K.V.S.S.

V ERY APPEALING
The knol looks good. Shall cover your profile in Knol Author News.

Covered
http://knol.google.com/k/narayana-rao-k-v-s-s/knol-author-news/2utb2lsm2k7a/2511#

Last edited May 24, 2010 6:59 AM

Report abusive comment

0 View/post replies (1) to this comment ▼

RE: I T IS THE PERFECT ARTICLE ON ORACLE ARCHITECTURE


Hello Lava,

I think your last question pointing to ODP.NET.


The Oracle Data Provider for .NET provides a notification framework that supports Database Change Notification in
the database server. Database Change Notification enables applications to receive notifications from a registered
callback routine when there is a change in a query result set, schema objects, or the state of the database that could
affect the results of a cached client result set.

Using this feature in ODP.NET, an application can maintain the validity of the client-side cache (for example,
the ADO.NET DataSet) easily. The client does not need to maintain a connection to the database. It will receive
notifications even when no longer connected to the database.

Hoping it helps....

Thnks,
sj

Last edited Feb 2, 2010 7:00 PM

Report abusive comment

0 Post reply to this comment ▼


.

RE: I T IS THE PERFECT ARTICLE ON ORACLE ARCHITECTURE -- S AMAY


Hello lava,

PMON is responsible for cleaning up the database buffer cache and freeing resources that the user process was
using. For example, it resets the status of the active transaction table, releases locks, and removes the process ID
from the list of active processes.

LGWR cannot write to the redo log file to commit these transactions until it has completed its previous write operation.
After the first transaction's entries are written to the redo log file, the entire list of redo entries of waiting transactions
(not yet committed) can be written to disk in one operation, requiring less I/O than do transaction entries handled
individually. Therefore, Oracle minimizes disk I/O and maximizes performance of LGWR.

And i need more clarification on your last question......

Thank you
SamayVaid

Last edited Feb 2, 2010 6:57 PM

Report abusive comment

0 View/post replies (1) to this comment ▼

Lava Kafle

IT IS THE PERFECT ARTICLE ON ORACLE ARCHITECTURE


Thanking you for this post. Who Clears the database buffer cache? SMON, PMON and any other? At what situation
the Redolog buffer cannot be written? At what situation the event for cleared cache does not reach client? Please
describe if possible.

Last edited Nov 5, 2010 3:59 AM

Report abusive comment

0 View/post replies (1) to this comment ▼

Edit this knol


Write a knol

Mayur V

Article rating:

Your rating:

Moderated collaboration

Creative Commons Attribution 3.0 License

Top Viewed Knol Award

Top Pick Knol Award

Version: 19

Versions

Last edited: Nov 2, 2010 8:32 AM.

REVIEWS
Be the first to review this knol

MAYUR V ALSO WROTE


• Windows 7 Serach Content inside Files
• Oracle Performance Tuning Interview Q & A

• What files should Backup in Windows PC


• Install Windows 7 on Mac OS X System or Macbooks - Step by Step Guide

• Temporarily Lock PC if someone try to guess the password


(76 knols and collections)
KNOL TRANSLATIONS
Help translate this knol into your language.

Search for uses of this page ▼

CATEGORIES
Sign in to add or vote for categories

Learn more about categories

ACTIVITY FOR THIS KNOL


T HIS WEEK :
372pageviews

T OTALS :
15252pageviews
13comments

Public activity feed

Flag inappropriate content

Home | Terms of Service | Privacy Policy | Content Policy | Help

©2009 Google