Professional Documents
Culture Documents
Architecture – Part 1
SCSP 3713
DATABASE ADMINISTRATION
Semester 1 2021/2022
Objectives
After completing this lesson, you should be
able to:
• List the major architectural components of Oracle
Database
• Explain the memory structures
• Describe the background processes
• Correlate the logical and physical storage
structures
2
25-Nov-20
Introduction
3
25-Nov-20
Oracle Database
Architecture: Overview
Instance
SGA
Shared pool
Library
Database cache
Redo log
buffer
buffer
cache Data dictionary
cache
PGA
Server
DBWn CKPT LGWR ARCn
process
User Archived
process Control Online redo log files
Data files files log files
Database
4
25-Nov-20
Oracle Database Architecture:
Overview (cont.)
• An Oracle database server consists of an
Oracle database and one or more database
instances
• The instance consists of memory structures and
background processes.
• Every time an instance is started, a shared memory area
called the System Global Area (SGA) is allocated and the
background processes are started.
5
25-Nov-20
Oracle Database Architecture:
Overview (cont.)
• The database consists of both physical structures
and logical structures.
• Because the physical and logical structures are
separate, the physical storage of data can be
managed without affecting access to logical storage
structures.
6
25-Nov-20
Connecting to the Database:
Connection VS Session
• Connection: Communication pathway between a
user process and an instance
• A communication pathway is established using
available interprocess communication mechanisms (on
a computer that runs both the user process and Oracle
Database) or network software (when different
computers run the database application and Oracle
Database and communicate through a network).
7
25-Nov-20
Connecting to the Database:
Connection VS Session (cont.)
• Session: Specific connection of a user to an
instance through a user process
• represents the state of a current user login to the
database instance
• For example, when a user starts SQL*Plus, the user must
provide a valid username and password, and then a
session is established for that user
• A session lasts from the time a user connects until
the user disconnects or exits the database
application
8
25-Nov-20
Connecting to the Database:
Connection VS Session (cont.)
User Server
User SQL> Select … process process
Session
Connection
Session
9
25-Nov-20
Connecting to a Server: Methods
10
25-Nov-20
Connecting to a Server: Methods
(cont.)
2. Client-Server The user starts the application or tool on a
local computer and connects over a network to the computer
running the Oracle database
• In this configuration, network software is used to communicate
between the user and the back-end server.
11
25-Nov-20
Connecting to a Server: Methods
(cont.)
2. Client-Server (continue)
• The client is a database application that initiates a request for an
operation to be performed on the database server. It requests,
processes, and presents data managed by the server. The client
workstation can be optimized for its job. For example, the client
might not need large disk capacity, or it might benefit from
graphic capabilities. Often, the client runs on a different
computer than the database server. Many clients can
simultaneously run against one server.
12
25-Nov-20
Connecting to a Server: Methods
(cont.)
2. Client-Server (continue)
• The server runs Oracle Database software and handles the functions
required for concurrent, shared data access. The server receives and
processes requests that originate from client applications. The computer that
manages the server can be optimized for its duties. For example, the server
computer can have large disk capacity and fast processors.
CLIENT-SERVER
Client ARCHITECTURE Server
13
25-Nov-20
Connecting to a Server: Methods
(cont.)
3. N-tier System The user accesses an application server
through a tool (such as a Web browser) on the local
computer (client). The application server then interacts with
a back-end database server on behalf of the client.
• A traditional multitier architecture has the following
components client, application server, database
server
• A client or initiator process that starts an operation
14
25-Nov-20
Connecting to a Server : Methods (cont.)
3. N-tier System (continue)
• One or more application servers that perform parts of the operation. An
application server contains a large part of the application logic, provides access
to the data for the client, and performs some query processing, thus removing
some of the load from the database server. The application server can serve as
an interface between clients and multiple database servers and can provide an
additional level of security.
• An end server or database server that stores most of the data used in the
operation
Server
15
25-Nov-20
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
16
25-Nov-20
Interacting with an Oracle Database
17
25-Nov-20
Interacting with an Oracle Database
(cont.)
18
25-Nov-20
Interacting with an Oracle Database
(cont.)
4. The user runs a DML-type SQL statement and commits the
transaction. For example, the user changes the address of a
customer in a table and commits the change.
5. The server process receives the statement and checks the shared
pool (an SGA component) for any shared SQL area that contains
an identical SQL statement. If a shared SQL area is found, the
server process checks the user’s access privileges to the
requested data, and the existing shared SQL area is used to
process the statement. If a shared SQL area is not found, a new
shared SQL area is allocated for the statement so that it can be
parsed and processed.
19
25-Nov-20
Interacting with an Oracle Database(cont.)
20
25-Nov-20
Interacting with an Oracle Database
(cont.)
21
25-Nov-20
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
22
25-Nov-20
Oracle Database Server Structures
23
25-Nov-20
Oracle Database Server Structures
24
25-Nov-20
Oracle Database
Memory Structures
Server Server Background
process 1
PGA process 2
PGA
process
PGA
Library Other
cache
25
25-Nov-20
Oracle Database
Memory Structures
• Oracle database creates and uses memory
structures for various purposes.
• For example, memory stores program code being
run, data that is shared among users, and private
data areas for each connected user.
26
25-Nov-20
Oracle Database
Memory Structures: SGA
• Two basic memory structures are associated with an instance
SGA, PGA:
• When you start the instance by using Enterprise Manager or SQL*Plus, the
amount of memory allocated for the SGA is displayed.
27
25-Nov-20
Oracle Database
Memory Structures : SGA (cont)
– The SGA is the memory area that contains data and control
information for the instance. The SGA includes the following
data structures:
1. Database buffer cache
3. Shared pool
4. Large pool
5. Java pool
6. Streams pool
28
25-Nov-20
Oracle Database
Memory Structures: SGA (cont)
• DESCRIBE THE PURPOSE OF EACH SGA DATA
STRUCTURE
29
25-Nov-20
Oracle Database
Memory Structures : PGA
– Program Global Areas (PGA):
• Memory regions that contain data and control information
for a server process or a background process.
• A PGA is nonshared memory created by Oracle Database
when a server or background process is started.
• Access to the PGA is exclusive to the server process. Each
server process and background process has its own PGA.
30
25-Nov-20
Oracle Database
Memory Structures: PGA
(cont)
• User process
• This process is started when a user or job starts an application
• User process can run either on the client, middle tier or the
database server
• Database processes
• Server process: Connects to the Oracle instance and is started
when a user establishes a session
• Server process configuration can be dedicated or shared server
• Background processes: Are started when an Oracle instance is
started
31
25-Nov-20
PGA: DB 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
32
25-Nov-20
PGA: Background Processes
• The background processes include the following:
• Database writer process (DBWn)
• Log writer process (LGWR)
• Checkpoint process (CKPT)
• System Monitor process (SMON)
• Process monitor process (PMON)
• Recoverer process (RECO)
• Job queue processes
• Archiver processes (ARCn)
• Queue monitor processes (QMNn)
33
25-Nov-20
PGA: Background Processes
• DESCRIBE THE PURPOSE OF EACH PGA
BACKGROUND PROCESSES
34
25-Nov-20
Logical and Physical Database
Structures
Logical Physical
Database
Segment
Extent
Oracle data
OS block
block
35
25-Nov-20
Tablespaces and Data Files
• Tablespaces are logical structures which consist of one or
more data files.
• Data files are the physical structures which belong to only
one tablespace.
• Each tablespace must have minimum of one datafile
USERS tablespace
36
25-Nov-20
Tablespaces and Data Files
http://docs.oracle.com/cd/B19306_01/server.102/b14220/physical.htm
37
25-Nov-20
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 and available for read and
write operations.
• The SYSTEM tablespace is used for core functionality (for
example, store data dictionary tables).
• The auxiliary SYSAUX tablespace is used for additional
database components (such as the Enterprise Manager
Repository and Automatic Workload Repository (AWR)
snapshots).
38
25-Nov-20
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.
39
25-Nov-20
Summary
• In this lesson, you should have learned how to:
• List the major architectural components of Oracle
Database
• Explain the memory structures
• Describe the background processes
• Correlate the logical and physical storage structures
40
25-Nov-20