You are on page 1of 37

InHouse Training

Oracle9i
Server Architecture

By
Mr. Ambasa
Oracle Certified Professional
Redefining Software Services
Objectives

› Oracle Overview

› Oracle Architectural components

› Physical & Logical Structure

› Memory Structure

› Processes

InHouse Training Redefining Software Services


Redefining Software Services
Oracle 9i

ORACLE
ORDBMS
RDBMS
DBMS
DATABASE

InHouse Training Redefining Software Services


Redefining Software Services
Types of Oracle Users
› Database Administrators
› Data Administrators
› Security Officers
› Network Administrators
› Application Developers
› Application Administrators
› Database Users

InHouse Training Redefining Software Services


Redefining Software Services
Tasks of an Oracle DBA
› Evaluate the Database Server Hardware
› Install the Oracle Software
› Plan the Database
› Create and Open the Database
› Back Up the Database
› Enroll System Users
› Implement the Database Design
› Back Up the Fully Functional Database
› Tune Database Performance
InHouse Training Redefining Software Services
Redefining Software Services
Oracle Architecture

InHouse Training Redefining Software Services


Redefining Software Services
Oracle Server and Its Components

Oracle can reliably manage huge amount of data (512
petabytes) in multi user environment.

Accepts request from clients, process it and gives the output
to the client.

Consists of two parts:

Oracle Instance Oracle Server

Oracle Database
Oracle Instance

Oracle Database

InHouse Training Redefining Software Services


Redefining Software Services
Oracle Database Has

Physical Structure


Logical Structure

InHouse Training Redefining Software Services


Redefining Software Services
Physical Structure

The physical structure consists of :

Data Online
files Control
files Redo Log
(*.dbf) files
(*.ctl)
(*.log)

Archive Alert &


Log Parameter Trace
Files Files log files
(*.log) (initsid.ora) (*.trc)

InHouse Training Redefining Software Services


Redefining Software Services
Logical Structure
› Dictates how the physical space of a database is
used
› Hierarchy consisting of
Tablespace
› Tablespaces
› Segments
› Extents Segment
› Blocks 112K Extent
84K
Ext
28K

Database Blocks

File

Database

InHouse Training Redefining Software Services


Redefining Software Services
Logical & Physical Structure

InHouse Training Redefining Software Services


Redefining Software Services
Oracle Instance
An Oracle instance:
› Is a means to access an Oracle database
› Always opens one and only one database
› Consists of memory and background process
structures
Instance
SGA
Shared Pool Redo
Database
Buffer Cache Memory Log
Library Cache Buffer
structures
Standard Block Large Pool
Data Dictionary
Cache Non Standard Block Java Pool
Background
process structures
PM SM DB LG CK Oth
ON ON WR WR PT ers
InHouse Training Redefining Software Services
Redefining Software Services
Memory Structure

Oracle’s memory structure consists of two


memory areas known as:
› System Global Area (SGA): Allocated at
instance start up, and is a fundamental
component of an Oracle instance

› Program Global Area (PGA): Allocated when the


server process is started

› User Global Area (UGA)


InHouse Training Redefining Software Services
Redefining Software Services
System Global Area(SGA)
› The SGA consists of several memory structures:
› Shared Pool , Database Buffer Cache, Redo Log Buffer
› Other structures (for example, lock and latch management,
statistical data)
› There are two additional memory structures that can be
configured within the SGA:
› Large Pool
› Java Pool
SGA
Shared Pool
Database Redo
Buffer Cache Memory
Log Buffer
Library Cache structures
Standard Block Large Pool
Data Dictionary
Cache Non Standard Block Java Pool

InHouse Training Redefining Software Services


Redefining Software Services
PGA
•Program Global Area or Private Global Area or
›Process Global Area
› Memory reserved for each user process connecting to an
Oracle database
› Allocated when a process is created Private Global
Area (PGA)
› Deallocated when process terminates
› Used by only one process Session Information
Area
›Automatic Management (9i Feature) Cursor Information
› pga_aggregate_target=<size> Area
workarea_size_policy=auto
Sort Area

Stack Space

InHouse Training Redefining Software Services


Redefining Software Services
User Global Area(UGA)

› When shared servers are used:


› Cursor Information Area
› Session Information Area
› Sort Area
UGA
› Stored in Shared Pool or Large
Session Information
Pool Area
› If the server is dedicated, the Cursor Information
Area
UGA is a sub-heap of the PGA.
› If the server is shared, the UGA is Sort Area

a sub-heap of the SGA.

InHouse Training Redefining Software Services


Redefining Software Services
Oracle Architecture

Instance

}
User SGA
Process Shared Pool Redo
Database
Log
Sessio Buffer Cache Buffer
Server n Library Cache
Server
Server
proces
proces
proces
ss Standard Block Large Pool
sPGA Data
PGA
PGA Dictionary
Cache Non Standard Block Java Pool

PM SM DB LG CK Ot
ON ON WR WR PT her
s
Parameter file

Data File Control Redo File


Password file File redo01.log
control01.ctl

Archived System.dbf Temp.dbf Undo.dbf control02.ctl redo02.log


Log files control03.ctl Databas
e
InHouse Training Redefining Software Services
Redefining Software Services
System Global Area

› Is dynamic
› Sized by the SGA_MAX_SIZE parameter
› Allocated and tracked in granules by SGA
components
› Contiguous virtual memory allocation
› Granule size based on total estimated
SGA_MAX_SIZE

InHouse Training Redefining Software Services


Redefining Software Services
Shared Pool
› Used to store:
› Most recently executed SQL statements
› Most recently used data definitions

Parse (Hard Parse & Soft Parse)

Execute

Fetch Shared Pool
› Sized by the parameter
SHARED_POOL_SIZE
Library Cache
(SQL, PL/SQL)

Data Dictionary
Cache
ALTER SYSTEM SET (Dicitionary data)
SHARED_POOL_SIZE = 64M;

InHouse Training Redefining Software Services


Redefining Software Services
Library Cache

› Stores information about the most recently used


SQL and PL/SQL statements
› Enables the sharing of commonly used
statements
› Is managed by a least recently used (LRU)
algorithm
› Consists of two structures:
› Shared SQL area
› Shared PL/SQL area
› Size determined by the Shared Pool sizing

InHouse Training Redefining Software Services


Redefining Software Services
Data Dictionary Cache

› A collection of the most recently used 
most recently used definitions in 
definitions
the database
› Includes information about database files, tables, 
indexes, columns, users, privileges, and other 
indexes, columns, users, privileges,
database objects
› During the parse phase, the server process looks at 
parse phase,
the data dictionary for information to resolve object 
names and validate access
› Caching data dictionary information into memory 
Caching data dictionary information
improves response time on queries and DML
› Size determined by the Shared Pool sizing

InHouse Training Redefining Software Services


Redefining Software Services
Database Buffer Cache
› Stores copies of data blocks
that have been retrieved from
the data files
› Dirty List, Free List, Pinned Database Buffer
List Cache
› Enables great performance
gains when you obtain and Database Buffer Cache
update data
Standard Block
› Managed through an LRU
algorithm
› DB_BLOCK_SIZE determines Memory
structures
primary block size Non Standard Block

Background
process structures

InHouse Training Redefining Software Services


Redefining Software Services
Database Buffer Cache

› Consists of independent subcaches:


› DB_CACHE_SIZE
› DB_KEEP_CACHE_SIZE
› DB_RECYCLE_CACHE_SIZE
› Can be dynamically resized

ALTER SYSTEM SET DB_CACHE_SIZE = 96M;

› DB_CACHE_ADVICE set to gather statistics for


predicting different cache size behavior
› Statistics displayed by V$DB_CACHE_ADVICE

InHouse Training Redefining Software Services


Redefining Software Services
Redo Log Buffer
› Records all changes made to the database data
blocks
› Records Change Vectors and later
flushes out the group of change vectors to
Redolog files
› Works in circular fashion
› Redo entries contain information to reconstruct
or redo changes
› Size defined by LOG_BUFFER
Redo
› Statically sized memory Log
Buffer

InHouse Training Redefining Software Services


Redefining Software Services
Large Pool
› An optional area of memory in the SGA
› Relieves the burden placed on the Shared Pool
› Used for:
› Session memory (UGA) for the Shared Server
› I/O server processes
› Backup and restore operations or RMAN
› Parallel execution message buffers
› Can be dynamically resized by LARGE_POOL_SIZE
› Default sizing is zero
Large Pool

InHouse Training Redefining Software Services


Redefining Software Services
Java Pool

› Optional Component
› Oracle uses in-built Java components
› Oracle 9i Supports Java Stored Procedures
› Default size 24M
› Reduce load on Shared Pool
› Sized by: Java_pool_size
› Statically Sized memory

Java Pool

InHouse Training Redefining Software Services


Redefining Software Services
Process Structure

InHouse Training Redefining Software Services


Redefining Software Services
Process Structure

Oracle takes advantage of various types of


processes:
› User process: Started at the time a database
user requests connection to the Oracle server
› Server process: Connects to the Oracle instance
and is started when a user establishes a session
› Background processes: Started when an Oracle
instance is started

InHouse Training Redefining Software Services


Redefining Software Services
Background Processes

InHouse Training Redefining Software Services


Redefining Software Services
Database Writer (DBWn)
Instance DBWn writes when:
SGA › Checkpoint occurs
Database › Dirty buffers reach
Buffer threshold
cache › There are no free buffers
› Timeout occurs
DB › RAC ping request is
Wn made
› Tablespace OFFLINE
› Tablespace READ ONLY
Redo › Table DROP or
Data Control Log
files files files TRUNCATE
› Tablespace BEGIN
BACKUP
Database

InHouse Training Redefining Software Services


Redefining Software Services
Log Writer (LGWR)

Instance LGWR writes:


SGA
Redo › At commit
Log
buffer › When one-third full
› When there is 1 MB of
DB LG redo
Wn WR
› Every three seconds

Redo › Before DBWn writes


Data Control Log
files files files

Database

InHouse Training Redefining Software Services


Redefining Software Services
Checkpoint (CKPT)
Instance › Checkpoint is an event of
SGA database at which all the files
are synchronized
› Checkpoint also affects the
Instance Recovery time

DB LG CK Responsible for:
Wn WR PT
› Signaling DBWn at

Redo checkpoints
Data Control Log
files files files › Updating datafile headers
with checkpoint information
Database › Updating control files with
checkpoint information
InHouse Training Redefining Software Services
Redefining Software Services
System Monitor (SMON)
Instance Responsibilities:
› Instance recovery
SGA
› Rolls forward
changes in online
redo log files
› Opens database for
user access
SM
ON › Rolls back
uncommitted
transactions
Redo › Coalesces free space
Data Control Log
files files files › Deallocates temporary
segments

Database

InHouse Training Redefining Software Services


Redefining Software Services
Process Monitor (PMON)
Cleans up after failed
Instance
processes by:
SGA
› Rolling back the
transaction
› Releasing locks
› Releasing other
PM
resources
ON › Restarting dead
dispatchers

PGA area

InHouse Training Redefining Software Services


Redefining Software Services
Archiver (ARCn)

› Optional background process


› Automatically archives online redo log files when
ARCHIVELOG mode is set
› Preserves the record of all changes made to the
database

Control ARCn Archived


Data Redo log redo log
files files files files

InHouse Training Redefining Software Services


Redefining Software Services
Recoverer(Reco)
› Resolve distributed transactions that are pending
due to a network or system failure in a distributed
database.
› At timed intervals, the local RECO attempts to
connect to remote databases and automatically
complete the commit or rollback of the local
portion of any pending distributed transactions.

InHouse Training Redefining Software Services


Redefining Software Services
Thank You
Any Question ?
InHouse Training Redefining Software Services
Redefining Software Services

You might also like