You are on page 1of 23

E

Oracle Architectural
Components

Copyright © Oracle Corporation, 2001. All rights


Objectives

After completing this appendix, you should be able


to do the following:
• Describe the Oracle Server architecture and its
main components
• List the structures involved in connecting a user to
an Oracle instance
• List the stages in processing:
– Queries
– DML statements
– Commits

E-2 Copyright © Oracle Corporation, 2001. All rights


Overview
Overview
Instance
User
process SGA Shared pool
Library
Data buffer Redo log cache
Server cache buffer Data dict.
process cache
PGA
SMON DBW0 PMON CKPT LGWR Others

Data Control Redo


Parameter files files log files
file
Archived
log files
Password
file Database

E-3 Copyright © Oracle Corporation, 2001. All rights


Oracle
Oracle Database
Database Files
Files

Data Control Redo


files files log files
Parameter
file
Archived
log files
Password
file Database

E-5 Copyright © Oracle Corporation, 2001. All rights


Other
Other Key
Key Physical
Physical Structures
Structures

Parameter
file
Archived
log files
Password
file Database Archived
log files

E-6 Copyright © Oracle Corporation, 2001. All rights


Oracle
Oracle Instance
Instance

An
An Oracle
Oracle instance:
instance:
•• Is
Is aa means
means to
to access
access an
an Oracle
Oracle database
database
•• Always
Always opens
opens one
one and
and only
only one
one database
database
Instance
SGA Shared pool
Memory
structures
Data buffer Redo log
cache buffer

SMON DBW0 PMON CKPT LGWR Others Background


processes

E-7 Copyright © Oracle Corporation, 2001. All rights


Processing
Processing aa SQL
SQL Statement
Statement

•• Connect
Connect to
to an
an instance
instance using:
using:
–– The
The user
user process
process
–– The
The server
server process
process
•• The
The Oracle
Oracle Server
Server components
components that
that are
are used
used
depend
depend on
on the
the type
type of
of SQL
SQL statement:
statement:
–– Queries
Queries return
return rows
rows
–– DML
DML statements
statements log
log changes
changes
–– Commit
Commit ensures
ensures transaction
transaction recovery
recovery
•• Some
Some Oracle
Oracle Server
Server components
components do
do not
not
participate
participate in
in SQL
SQL statement
statement processing.
processing.

E-9 Copyright © Oracle Corporation, 2001. All rights


Connecting
Connecting to
to an
an Instance
Instance
User Server

Oracle Server

User Server

Client

Application server Server

User Server
Browser

E-10 Copyright © Oracle Corporation, 2001. All rights


Processing
Processing aa Query
Query

•• Parse:
Parse:
–– Search
Search for
for identical
identical statement
statement
–– Check
Check syntax,
syntax, object
object names,
names, and
and privileges
privileges
–– Lock
Lock objects
objects used
used during
during parse
parse
–– Create
Create and
and store
store execution
execution plan
plan
•• Execute:
Execute: Identify
Identify rows
rows selected
selected
•• Fetch:
Fetch: Return
Return rows
rows to
to user
user process
process

E-12 Copyright © Oracle Corporation, 2001. All rights


The
The Shared
Shared Pool
Pool
Shared pool

Library
cache

Data dictionary
cache

•• The
The library
library cache
cache contains
contains the
the SQL
SQL statement
statement text,
text,
parsed
parsed code,
code, and
and execution
execution plan.
plan.
•• The
The data
data dictionary
dictionary cache
cache contains
contains table,
table, column,
column,
and
and other
other object
object definitions
definitions and
and privileges.
privileges.
•• The
The shared
shared pool
pool is
is sized
sized by
by SHARED_POOL_SIZE.
SHARED_POOL_SIZE.

E-13 Copyright © Oracle Corporation, 2001. All rights


Database
Database Buffer
Buffer Cache
Cache

Data buffer
cache

•• Stores
Stores the
the most
most recently
recently used
used blocks
blocks
•• Size
Size of
of aa buffer
buffer based
based on
on DB_BLOCK_SIZE
DB_BLOCK_SIZE
•• Number
Number of
of buffers
buffers defined
defined by
by DB_BLOCK_BUFFERS
DB_BLOCK_BUFFERS

E-15 Copyright © Oracle Corporation, 2001. All rights


Program
Program Global
Global Area
Area (PGA)
(PGA)

•• Not
Not shared
shared
•• Writable
Writable only
only by
by the
the server
server process
process
•• Contains:
Contains:
–– Sort
Sort area
area
–– Session
Session information
information
–– Cursor
Cursor state
state Server
–– Stack process
Stack space
space
PGA

E-16 Copyright © Oracle Corporation, 2001. All rights


Processing
Processing aa DML
DML Statement
Statement
SGA Shared pool
User
process
Data buffer Redo log
cache buffer

UPDATE
employees ...
4 1 2
3
Server
process
Data Control Redo
files files log files

Database

E-17 Copyright © Oracle Corporation, 2001. All rights


Redo
Redo Log
Log Buffer
Buffer

Redo log
buffer

•• Has
Has its
its size
size defined
defined by
by LOG_BUFFER
LOG_BUFFER
•• Records
Records changes
changes made
made through
through the
the instance
instance
•• Is
Is used
used sequentially
sequentially
•• Is
Is aa circular
circular buffer
buffer

E-19 Copyright © Oracle Corporation, 2001. All rights


Rollback
Rollback Segment
Segment
Old image

New
image
Table

Rollback segment

DML statement

E-20 Copyright © Oracle Corporation, 2001. All rights


COMMIT Processing
COMMIT Processing
Instance
1 SGA Shared pool

Data buffer Redo log


Server cache buffer
process
4
LGWR
3
2
Data Control Redo
files files log files
User
process

Database

E-21 Copyright © Oracle Corporation, 2001. All rights


Log
Log Writer
Writer (LGWR)
(LGWR)

SGA Shared pool


LGWR writes
LGWR writes when:
when:
Data buffer Redo log •• There
There is
is aa COMMIT
COMMIT
cache buffer
•• The
The redo
redo buffer
buffer log
log
is
is one-third
one-third full
full
LGWR
•• There
There is
is more
more than
than
11 MB
MB of
of redo
redo
Data Control Redo •• Before
Before DBW0
DBW0 writes
writes
files files log files

Database

E-23 Copyright © Oracle Corporation, 2001. All rights


Other Instance Processes

• Other required processes:


– Database Writer (DBW0)
– Process Monitor (PMON)
– System Monitor (SMON)
– Checkpoint (CKPT)
• The archive process (ARC0) is usually created
in a production database

E-24 Copyright © Oracle Corporation, 2001. All rights


Database
Database Writer
Writer (DBW0)
(DBW0)

SGA Shared pool


DBW0 writes
DBW0 writes when:
when:
Data buffer Redo log •• There
There are
are many
many dirty
dirty
cache buffer buffers
buffers
•• There
There are
are few
few free
free
DBW0 buffers
buffers
•• Timeout
Timeout occurs
occurs
Data Control Redo •• Checkpoint
Checkpoint occurs
occurs
files files log files

Database

E-25 Copyright © Oracle Corporation, 2001. All rights


SMON: System Monitor

• Automatically recovers the instance:


– Rolls forward changes in the redo logs
– Opens the database for user access
– Rolls back uncommitted transactions
• Coalesces free space
• Deallocates temporary segments

E-26 Copyright © Oracle Corporation, 2001. All rights


PMON: Process Monitor

Cleans up after failed processes by:


• Rolling back the transaction
• Releasing locks
• Releasing other resources

E-27 Copyright © Oracle Corporation, 2001. All rights


Summary

In this appendix, you should have learned how to:


• Identify database files: data files, control files,
online redo logs
• Describe SGA memory structures: DB buffer
cache, shared SQL pool, and redo log buffer
• Explain primary background processes:
DBW0, LGWR, CKPT, PMON, SMON, and ARC0
• List SQL processing steps: parse, execute, fetch

E-28 Copyright © Oracle Corporation, 2001. All rights


Hidden Slide

E-30 Copyright © Oracle Corporation, 2001. All rights

You might also like