DBA - Lesson 1-1
DBA - Lesson 1-1
DATA
ADMINISTRATION
(Lecture 2)
by
Dr. Mohammed Abdualgader al-Aidroos
Oracle Database Architecture: Overview
Instance
Library
Database cache
Redo log
buffer
buffer
cache Data dictionary
cache
Server
DBW n CKPT LGWR ARCn
process
User Archived
process Control Online redo log files
Data files files log files
Database
Oracle Database Architecture:
Overview
• SMON (System Monitor): It is an important process responsible for recovering
Oracle Instance. If this process does not work, the database is down.
• PMON (Process Monitor): This process frees up system resources that are used by
processes that have failed or are suddenly terminated, and will give back this
resources to the server.
• RECO (Recoverer Process): This process enables the completion of unfinished
operations.
• DBWn (Database Writer): The DBW process is a process that shuttles between
Datafiles and Database Buffer Cache.
• LGWR (Log Writer Process): This process is a process that writes the data in the
buffer memory to physical files like DBW process.
• CKPT (Checkpoint Process): When this process is triggered, the Database Writer
(DBW) process writes dirty blocks in the database buffer cache to datafiles. It also
updates the header information of Datafiles.
• ARCn ( archiver process ): This is a process that is activated when the database is
in archive mode.
• System Global Area(SGA).
• program global area (PGA).
Connecting to the Database
– Connection: Communication between a user process
and an instance
– Session: Specific connection of a user to an instance
through a user process
User Server
SQL> Select … process process
User
Session
Connection
Session
Interacting with an Oracle Database
Instance
User Server
process process SGA
Shared pool
Library
Database cache
Redo log
buffer
buffer
cache Data dictionary
cache
User
Oracle Database Server Structures
Instance
Memory structures SGA Shared pool
Library
Database cache
User Server Redo log
buffer
process process buffer
cache Data dictionary
cache
Database
Storage structures
Library Other
cache
Instance
Library
Database cache
Redo log
buffer
buffer
cache Data dictionary
cache
Instance
Library
Database cache
Redo log
buffer
buffer
cache Data dictionary
cache
SGA Shared
Shared pool
SQL area Data dictionary
Library cache
Database cache
Redo log
buffer
buffer
cache Data dictionary
cache Library Other
cache
DBW n CKPT LGWR SMON PMON ARCn RECO Others
Allocation and Reuse of Memory
in the Shared Pool
– Server process checks the shared pool to see if a
shared SQL area already exists for an identical
statement.
– Server process allocates a private SQL area on
behalf of the session.
Data dictionary
Shared
cache
Server SQL area
process
Library Other
cache
Shared
pool
Large Pool
Database
Redo log
buffer Shared pool
buffer
cache
Free
I/O buffer
memory
Response Request
queue queue
Java pool Streams Large pool
pool Large pool
Java Pool
and Streams Pool
– Java pool memory is used in server memory for all
session-specific Java code and data in the JVM.
– Streams pool memory is used exclusively by Oracle
Streams to:
• Store buffered queue messages
• Provide memory for Oracle Streams processes
Library
Database cache
Redo log
buffer
buffer
PGA cache Data dictionary
cache
User Server
process process Background processes
DBW n CKPT LGWR SMON PMON ARCn RECO Others
Process Structures
Server Server Server Server Server
Server n
processes
SGA
Shared pool
Library
Database
Redo log cache
buffer
buffer SGA
cache Data dictionary
cache
DBW n
LGWR
DBW n
LGWR
Checkpoint
process
Data files
System Monitor Process (SMON)
– Performs recovery at instance startup
– Cleans up unused temporary segments
Instance
SMON
System Monitor
process
Temporary
segment
Process Monitor Process (PMON)
– Performs process recovery when a user process fails
• Cleans up the database buffer cache
• Frees resources that are used by the user process
– Monitors sessions for idle session timeout
– Dynamically registers database services with listeners
PMON User
Failed user process
Process Monitor
process
Database buffer
cache
Recoverer Process
– Used with the distributed database configuration
– Automatically connects to other databases
involved in in-doubt distributed transactions
– Automatically resolves all in-doubt transactions
– Removes any rows that correspond to in-doubt
transactions
RECO
ARCn
DBW n
Database
Data files writer process
DB structures
Database
Segment
Extent
Oracle data
OS block
block
Tablespaces and Data Files
– Tablespaces consist of one or more data files.
– Data files belong to only one tablespace.
USERS tablespace
SYSTEM and SYSAUX Tablespaces
– The SYSTEM and SYSAUX tablespaces are
mandatory tablespaces that are created at the
time of database creation. They must be online.
– The SYSTEM tablespace is used for core
functionality (for example, data dictionary tables).
– The auxiliary SYSAUX tablespace is used for
additional database components (such as the
Enterprise Manager Repository).
Segments, Extents, and Blocks
– Segments exist in a tablespace.
– Segments are collections of extents.
– Extents are collections of data blocks.
– Data blocks are mapped to disk blocks.