Professional Documents
Culture Documents
1-1
Copyright
Oracle Documentation
http://tahiti.oracle.com/
1-2
Copyright
1-3
Objectives of Lecture 1
Overview of Oracle server architecture,
identifying main components.
Presentation of English and Polish Oracle
server terminology.
1-4
Copyright
Application/
network
server
Server
1-5
Copyright
Users
Oracle Corporation, 1998, 2001. All rights reserved.
Oracle server
The Oracle server consists of:
1-6
Copyright
Oracle Database
An Oracle database consists of operating system
files, known as database files, that provide
the actual physical storage for database
information. The database files are used to
ensure that the data is kept consistent and can
be recovered in the event of a failure of the
instance.
Usually there is only
accessing a database.
Cluster configuration
a single database.
1-7
Copyright
Oracle Database
Physical Storage Structures
Control and
redo log files
are
multiplexed
Control
files
Parameter
file
Password
file
Data files
Redo log
files
Database
1-8
Copyright
Archived
log files
+ Backup files,
trace and alert
files, audit files,
Parameter
file
Password
file
1-9
Copyright
Database
Archived
log files
Connecting to a Database
Client
Connection
established
User
process
Server
process
Server
Session created
Oracle server
User
1-10
Copyright
User Process
Runs on the client machine
Is spawned when a tool or an application
is invoked
Runs the tool or application (SQL*Plus,
Oracle Enterprise Manager, OracleForms)
Generates calls to the Oracle server
1-11
Copyright
Connection
Connection is a communication pathway
between a user process and an Oracle
Database instance. A communication pathway
is established using:
1. available interprocess communication
mechanisms (on a computer that runs both
the user process and Oracle Database) or
2. network software (when different computers
run the database application and Oracle
Database, and communicate through a
network).
1-12
Copyright
Session
Session is a specific connection of a user to an Oracle
Database instance through a user process. For example,
when a user starts SQL*Plus, the user must provide a
valid user name and password, and then a session is
established for that user. A session lasts from the time
the user connects until the time the user disconnects or
exits the database application.
Multiple sessions can be created and exist concurrently
for a single Oracle Database user using the same user
name.
For example, a user with the user name/password of
SCOTT/TIGER can connect to the same Oracle Database instance
several times.
1-13
Copyright
Server Process
Runs on the server machine (host)
Services a single user process in the
dedicated server configuration
Uses an exclusive Program Global Area
(PGA)
Processes calls generated by the client
Returns results to the client
1-14
Copyright
Oracle Instance
Instance
SGA
An Oracle instance:
Is a means to access an Oracle
database
Always opens one and only one
database
1-15
Copyright
1-16
Copyright
Copyright
Dynamic SGA
Dynamic SGA implements an infrastructure that
allows the SGA configuration to change without
shutting down the instance. This then allows
the sizes of the database buffer cache, shared
pool, and large pool to be changed without
shutting down the instance. Conceivably, they
could be initially under configured and would
grow and shrink depending upon their
respective work loads, up to a maximum of
SGA_MAX_SIZE.
1-18
Copyright
Copyright
Copyright
Copyright
Resizing
The size of Shared Pool can be
dynamically resized using ALTER SYSTEM
SET. After performance analysis can be
adjusted (but the total SGA size cannot
exceed SGA_MAX_SIZE):
ALTER SYSTEM SET
SHARED_POOL_SIZE = 64M;
1-22
Copyright
Library Cache
1. Stores information about the most recently
used SQL and PL/SQL statements:
Copyright
Copyright
1-26
Copyright
Copyright
1-28
Copyright
1-29
Copyright
1-30
Copyright
Types of buffers
Dirty - changed and has not yet been written to the
disk.
Cold - that has not been recently used according to
the least recently used (LRU) algorithm.
Free - contain no data or are free to be overwritten.
Pinned - currently being accessed or explicitely
retained for future use (e.g. the KEEP buffer pool).
1-31
Copyright
1-32
Copyright
LRU list
The least-used blocks are thrown out of the list
when new blocks are accessed and added to the
MRU end of the list. With one exception when a
full table is scanned the blocks are written to the
LRU end of the list.
When an Oracle process accesses a buffer, it
moves the buffer to the MRU end of the list so that
the most frequently accessed data is available in
the buffers.
1-33
Copyright
LRU list
When an Oracle process requests data, it searches
the data in the buffer cache if it finds, we get
cache hit. If not cache miss data needs to be
copied from disk to the buffer.
The server process searches (from the LRU end)
until it finds a free buffer or until it has searched a
threshold limit of buffers. It moves encountered
dirty buffers to the write list. If it does not find a
free buffer DBWn writes some buffers from write
list to disk making available free buffers for the
server process.
1-34
Copyright
Copyright
1-36
Copyright
Copyright
Copyright
Copyright
Large Pool
The large pool is an optional area of memory
in the SGA configured only in a shared server
environment.
It relieves the burden placed on the shared
pool.
This configured memory area is used for
session memory (UGA), I/O slaves, and backup
and restore operations.
Unlike the shared pool, the large pool does
not use an LRU list.
Sized by LARGE_POOL_SIZE
ALTER SYSTEM SET LARGE_POOL_SIZE = 64M;
1-40
Copyright
Java Pool
The Java pool services the parsing
requirements for Java commands.
Required if installing and using Java.
It is sized by the JAVA_POOL_SIZE parameter.
In Oracle9i, the default size of the Java Pool
is 24M.
1-41
Copyright
Copyright
Contains:
Sort area
Server
process
PGA
1-43
Copyright
PGA
The total memory used by all individual PGAs
is known as the total instance PGA memory,
and the collection of individual PGAs is
referred to as the total instance PGA, or just
instance PGA. With Oracle Enterprise Manager
Database Control, you set the size of the
instance PGA, not individual PGAs.
1-44
Copyright
Summary
1-45
Copyright
Oracle Processes
+ Management
Monitor
MMON in 11g
1-46
Copyright
Server process
Oracle Database creates server processes to handle the
requests of user processes connected to the instance. In
some situations when the application and Oracle
Database operate on the same computer, it is possible to
combine the user process and corresponding server
process into a single process to reduce system
overhead.
However, when the application and Oracle Database
operate on different computers, a user process always
communicates with Oracle Database through a separate
server process.
1-47
Copyright
Server process
Server processes (or the server portion of combined
user/server processes) created on behalf of each user's
application can perform one or more of the following:
Parse and run SQL statements issued through the
application
Read necessary data blocks from datafiles on disk into
the shared database buffers of the SGA, if the blocks are
not already present in the SGA
Return results in such a way that the application can
process the information
1-48
Copyright
Shared pool
Database
buffer
cache
DBWR
Data files
1-49
Copyright
Control
files
Redo log
files
Copyright
Shared pool
Redo log
buffer
LGWR
Data files
1-52
Copyright
Control
files
Redo log
files
Copyright
COMMIT Processing
1
Instance
SGA
Server
process
Database
buffer
cache
Shared pool
Redo log
buffer
LGWR
3
User
process
2
Data files
Control
files
Redo log
files
System Monitor
(SMON)
Copyright
Copyright
Process Monitor
(PMON)
Copyright
Checkpoint
Event
Copyright
Copyright
Archiver (ARCn)
1-60
Copyright
Copyright
NOARCHIVELOG mode
The online redo log files are
overwritten each time a log switch
occurs. LGWR does not overwrite a redo
log group until the checkpoint for that
group is complete. This ensures that
committed data can be recovered if
there is an instance crash. During the
instance crash, only the SGA is lost.
There is no loss of disks, only memory.
For example, an operating system crash
causes an instance crash.
1-62
Copyright
Dispatcher (Dnnn)
Part of the shared server architecture. They
minimize the resource needs by handling
multiple connections to the database using a
limited number of server processes.
When a user makes a request, the dispatcher
places the request on the request queue.
1-63
Copyright
Copyright
1-65
Copyright
Logical storage
structures
An Oracle database is a
group of tablespaces.
A tablespace may consist of
one or more segments. At
least: SYSTEM (in 10g also
SYSAUX).
A segment is made up of extents.
An extent is made up of logical contiguous
blocks allocated in one chunk.
A block is the smallest unit for read and write
operations - a multiple of the SO block size.
1-66
Copyright
Logical/physical/recovery-related
structures of the database
1-67
Copyright
Types of segments
Data segments - store the table (or cluster) data.
Index segments - store the index data.
Temporary segments - temporary work area e.g.
for sorting, executing SQL statements.
Undo (rollback) segments - store undo
information. When you roll back changes made
to the database, undo records in the undo
tablespace are used to undo the changes.
1-68
Copyright
New
image
Table
Undo
segment
1-69
Copyright
DML
statement
Copyright
Summary
Instance
SGA
Shared pool
Server
process
PGA
User
process
DBWR
Control
files
Parameter
file
Password
file
LGWR
Redo log
files
Data files
Database
1-71
Copyright
Archived
log files