You are on page 1of 36

Oracle

Architecture
Overview

Oracle Architecture
The Oracle Server
Oracle ser ver Oracle ser ver

Oracle Architecture
Instance Architecture
Shared pool
Library
Cache
Data
Dictionary
Cache
Redo
Log
Buffer
Database
Buffer
Cache
SGA
Instance
DBWR LGWR SO! "O! ARCn
R#CO C$"% LC$n S!"n Dnnn
Snnn

Oracle Architecture
Instance

An Oracle instance:

Is a means to access an Oracle data!ase

Always o"ens one and only one data!ase

#onsists o$:

Internal memory structures

%rocesses

Oracle Architecture
Interaction with the &ata!ase ' &edicated Server (
SGA
Re&uest Response
Shared S'L
"ool Database Buffer Cache
Redo log Buffer
Database (iles Redo Log (iles
Dedicated
Server
)ser
"rocess
DBWR LGWR ARCn
"O! SO! C$"%

SGA
Re&uest Response
Shared S'L
"ool Database Buffer Cache
Redo log Buffer
Database (iles Redo Log (iles
)ser
"rocess
DBWR LGWR ARCn
"O! SO!
Dedicated
Server
Dedicated
Server
Shared
Servers
)ser
"rocess
)ser
"rocess
)ser
"rocess
)ser
"rocess
Dispatcher
C$"%
Oracle Architecture
Interaction with the &ata!ase ' Shared Server (

Oracle Architecture
Internal Memory Structures S)A
System or *shared+ )lo!al Area 'S)A(

&ata!ase !u$$er cache

,edo log !u$$er

Shared "ool

,e-uest . res"onse -ueues 'shared server(



Oracle Architecture
&ata!ase !u$$er cache

/sed to hold data !locks read $rom data$iles !y server


"rocesses

#ontains *dirty+ or modi$ied !locks and *clean+ or


unused or unchanged !ocks

*&irty+ and *clean+ !locks are managed in lists called the


dirty list and the 0,/

1ree s"ace is created !y &B2, writing out *dirty+


!locks or aging out !locks $rom the 0,/

Si3e is managed !y the "arameter


&B4B0O#54B/116,S

Oracle Architecture
0east ,ecently /sed '0,/(

0,/ and the data!ase !u$$er cache

6very time a data !lock is read $rom disk it is "laced


in the data!ase !u$$er cache at the head o$ the 0,/
list

I$ a !lock is already in the cache and it is read again


it is moved to the head o$ the list

&ata not used $re-uently is *aged+ out o$ the cache


while $re-uently used data remains

Oracle Architecture
,edo 0og Bu$$er

A circular !u$$er that contains redo entries

,edo entries re$lect changes made to the data!ase

,edo entries take u" contiguous7 se-uential


s"ace in the !u$$er

&ata stored in the redo log !u$$er is "eriodically


written to the online redo log $iles

Si3e is managed !y the "arameter


0O)4B/116,

&e$ault is 8 times the ma9imum data !lock si3e $or


the o"erating system

Oracle Architecture
Shared %ool

#onsists o$ multi"le smaller memory areas

0i!rary cache

Shared S:0 area

#ontains "arsed S:0 and e9ecution "lans $or statements already run
against the data!ase

%rocedure and "ackage storage

&ictionary cache

;ames o$ all ta!les and views in the data!ase

;ames and dataty"es o$ columns in the data!ase ta!les

%rivileges o$ all users

Managed via an 0,/ algorithm

Si3e determined !y the "arameter


S<A,6&4%OO04SI=6

Oracle Architecture
0east ,ecently /sed '0,/(

0,/ and the shared "ool

6very time a S:0 statement is "arsed it is "laced in


the shared "ool $or reuse

I$ a S:0 statement is already in the shared "ool it


will not re-"arse !ut it is "laced at the head o$ the
0,/

S:0 statements not used $re-uently are *aged+ out


o$ the shared "ool while $re-uently used statements
remain

A S:0 statement may !e arti$icially retained at the


head o$ the 0,/ !y *"inning+ the statement

Oracle Architecture
Internal Memory Structures %)A
%rogram or *"rocess+ )lo!al Area '%)A(

/sed $or a single "rocess

;ot sharea!le with other "rocesses

2rita!le only !y the server "rocess

Allocated when a "rocess is created and


deallocated when a "rocess is terminated

#ontains:

Sort area /sed $or any sorts re-uired !y S:0 "rocessing

Session in$ormation Includes user "rivileges

#ursor state Indicates stage o$ S:0 "rocessing

Stack s"ace #ontains session varia!les



Oracle Architecture
Background %rocesses - &B2,

2rites contents o$ data!ase !u$$ers to data$iles

%rimary >o! is to kee" the data!ase !u$$er


*clean+

2rites least recently used '0,/( *dirty+ !u$$ers


to disk $irst

2rites to data$iles in o"timal !atch writes

Only "rocess that writes directly to data$iles

Mandatory "rocess

Oracle Architecture
Background %rocesses - &B2,

&B2, writes to disk when:

A server "rocess cannot $ind a clean reusa!le !u$$er

A timeout occurs '? sec(

A check"oint occurs

&B2, cannot write out *dirty+ !u$$ers !e$ore they


have !een written to the online redo log $iles

Oracle Architecture
#ommit #ommand
The S:0 command COI% allows users to
save transactions that have !een made against
a data!ase. This $unctionality is availa!le $or
any )"DA%#* I!S#R%* or D#L#%#
transaction@ it is not availa!le $or changes to
data!ase o!>ects 'such as AL%#R %ABL#
commands(

Oracle Architecture
Background %rocesses - 0)2,

2rites contents o$ redo log !u$$ers to online


redo log $iles

%rimary >o! is to kee" the redo log !u$$er


*clean+

2rites out redo log !u$$er !locks se-uentially


to the redo log $iles

May write multi"le redo entries "er write during


high utili3ation "eriods

Mandatory "rocess

Oracle Architecture
Background %rocesses - 0)2,

0)2, writes to disk when:

A transaction is #OMMIT6&

A timeout occurs '? sec(

The redo log !u$$er is AB? $ull

There is more than A mega!yte o$ redo entries

Be$ore &B2, writes out *dirty+ !locks to data$iles



Oracle Architecture
Background %rocesses - SMO;

%er$orms automatic instance recovery

,eclaims s"ace used !y tem"orary segments


no longer in use

Merges contiguous areas o$ $ree s"ace in the


data$iles 'i$ %#TI;#,6AS6 C D(

SMO; *wakes u"+ regularly to check whether it


is needed or it may !e called directly

Mandatory "rocess

Oracle Architecture
Background %rocesses - SMO;

SMO; recovers transactions marked as &6A&


within the instance during instance recovery

All non committed work will !e rolled !ack !y SMO;


in the event o$ server $ailure

SMO; makes multi"le "asses through &6A&


transactions and only a""lies a s"eci$ied num!er o$
undo records "er "ass7 this "revents short
transactions having to wait $or long transactions to
recover

SMO; "rimarily cleans u" server-side $ailures



Oracle Architecture
Background %rocesses - %MO;

%er$orms automatic "rocess recovery

#leans u" a!normally terminated connections

,olls !ack non committed transactions

,eleases resources held !y a!normally terminated


transactions

,estarts $ailed shared server and dis"atcher


"rocesses

%MO; *wakes u"+ regularly to check whether it


is needed or it may !e called directly

Mandatory "rocess

Oracle Architecture
Background %rocesses - %MO;

&etects !oth user and server a!orted data!ase


"rocesses

Automatically resolves a!orted "rocesses

%MO; rolls !ack the current transaction o$ the


a!orted "rocess

,eleases resources used !y the "rocess

I$ the "rocess is a !ackground "rocess the instance


most likely cannot continue and will !e shut down

%MO; "rimarily cleans u" client-side $ailures



Oracle Architecture
Background %rocesses - #5%T

1orces all modi$ied data in the S)A to !e written to


data$ile

Occurs whether or not the data has !een committed

#5%T does not actually write out !u$$er data only &B2, can
write to the data$iles

/"dates the data$ile headers

This ensures all data$iles are synchroni3ed

<el"s reduce the amount o$ time needed to "er$orm


instance recovery

1re-uency can !e ad>usted with "arameters



Oracle Architecture
Background %rocesses - A,#<

Automatically co"ies online redo log $iles to


designated storage once they have !ecome $ull

Oracle Architecture
Server %rocesses

Services a single user "rocess in the dedicated


server con$iguration or many user "rocesses in
the shared server con$iguration

/se an e9clusive %)A

Include the Oracle %rogram Inter$ace 'O%I(

%rocess calls generated !y the client

,eturn results to the client in the dedicated


server con$iguration or to the dis"atcher in the
shared server con$iguration

Oracle Architecture
/ser %rocesses

,un on the client machine

Are s"awned when a tool or an a""lication is


invoked

S:0E%lus7 Server Manager7 Oracle 6nter"rise


Manager7 &evelo"erBFDDD

#ustom a""lications

Include the /ser %rogram Inter$ace '/%I(

)enerate calls to the Oracle server



Oracle Architecture
Transaction 69am"le - /"date
SGA
Database
Buffer
Cache
Shared "ool
Redo
Log
Buffer
Database (iles Redo Log (iles
Dedicated
Server
)ser
"rocess
DBWR LGWR
"O! SO! C$"%
Rollbac+
Seg,ent
-
.
)"DA%# table
S#% user / 0S1I"#R%2
W1#R# id / -.345

Oracle Architecture
Transaction 69am"le - /"date
SGA
Database
Buffer
Cache
Shared "ool
Redo
Log
Buffer
Database (iles Redo Log (iles
Dedicated
Server
)ser
"rocess
DBWR LGWR
"O! SO! C$"%
Rollbac+
Seg,ent
3

Oracle Architecture
Transaction 69am"le - /"date
SGA
Database
Buffer
Cache
Shared "ool
Redo
Log
Buffer
Database (iles Redo Log (iles
Dedicated
Server
)ser
"rocess
DBWR LGWR
"O! SO! C$"%
Rollbac+
Seg,ent
4

Oracle Architecture
Transaction 69am"le - /"date
SGA
Database
Buffer
Cache
Shared "ool
Redo
Log
Buffer
Database (iles Redo Log (iles
Dedicated
Server
)ser
"rocess
DBWR LGWR
"O! SO! C$"%
Rollbac+
Seg,ent
5

Oracle Architecture
Transaction 69am"le - /"date
SGA
Database
Buffer
Cache
Shared "ool
Redo
Log
Buffer
Database (iles Redo Log (iles
Dedicated
Server
)ser
"rocess
DBWR LGWR
"O! SO! C$"%
Rollbac+
Seg,ent
6

Oracle Architecture
Transaction 69am"le - /"date
SGA
Database
Buffer
Cache
Shared "ool
Redo
Log
Buffer
Database (iles Redo Log (iles
Dedicated
Server
)ser
"rocess
DBWR LGWR
"O! SO! C$"%
Rollbac+
Seg,ent
7

Oracle Architecture
Transaction 69am"le - /"date
SGA
Database
Buffer
Cache
Shared "ool
Redo
Log
Buffer
Database (iles Redo Log (iles
Dedicated
Server
)ser
"rocess
DBWR LGWR
"O! SO! C$"%
Rollbac+
Seg,ent
8
- ROW )"DA%#D

Oracle Architecture
Transaction 69am"le - /"date
SGA
Database
Buffer
Cache
Shared "ool
Redo
Log
Buffer
Database (iles Redo Log (iles
Dedicated
Server
)ser
"rocess
DBWR LGWR
"O! SO! C$"%
Rollbac+
Seg,ent
-9 :
COI%

Oracle Architecture
Transaction 69am"le - /"date
SGA
Database
Buffer
Cache
Shared "ool
Redo
Log
Buffer
Database (iles Redo Log (iles
Dedicated
Server
)ser
"rocess
DBWR LGWR
"O! SO! C$"%
Rollbac+
Seg,ent
--
COI%
S)CC#SS()L

Oracle Architecture
Transaction 69am"le - /"date
SGA
Database
Buffer
Cache
Shared "ool
Redo
Log
Buffer
Database (iles Redo Log (iles
DBWR LGWR
"O! SO! C$"%
Rollbac+
Seg,ent
-.

You might also like