Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

Course Introduction

Oracle Database Fundamentals


for Apps DBA

1
Agenda

 Workshop
▪ Objectives
▪ Approach
 Training Workshop House Rules

2
Working Together Will Leverage
Expertise and Build Support

After completing this workshop, you should be able to


do the following:
• Understand Oracle Database Concepts and
Architecture
• Use Oracle Database Monitoring Tools
• Manage Database Performance

3
Workshop House Rules

Participation Encouraged
Promptness Appreciated
Multiple Answers may Exist – be flexible and supportive of
decisions made

4
Schedule

Day 1 Day 2 Day 3


LECTURE LAB LECTURE/LAB

• 1 - DB Concepts • LAB 1 - Installing • 5 –DB Auditing


and Architecture Oracle Database • 6 - OS Monitoring
• 2 - Managing the • LAB 2 – Managing • 7 – DB
DB Instance Oracle Database U Maintenance
• 3- Managing DB • LAB 3 – Managing • 8 – Performance
Storage Structure Database Storage Management
• 4 – Managing DB • LAB 4 – • LAB 5 -
Security Administering Configuring
Users Database Auditing
• LAB 8 – Managing
Performance

5
Using Accounting Setup Manager

Chapter 1
Oracle Database Concepts and Architecture

6
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

7
Oracle Database

The Oracle relational database management system


(RDBMS) provides an open, comprehensive, integrated
approach to information management

Use to store and


Collection of Data
retrieve related
Treated as a unit
information

Database

Provides multi-
Handles large
level security
amount of data
access

8
Oracle Database Server Architecture: Overview

Instance
I
PGA
N
Server
process Memory Structures S
T
(System Global Area) A
N
Server C
Process Structures E

User
process

Database (Storage Structures)


Client DATABASE

9
Oracle Database Memory Structures

Program Global Area (PGA)

Stack User
Space Global
Area

KEEP
Database buffer pool
Redo log
Shared pool buffer
buffer
cache RECYCLE
buffer pool

Java pool Streams nK buffer


Large pool pool cache

System Global Area (SGA)

10
Shared Pool

• Is a portion of the SGA


• Contains:
▪ Library cache Shared Data dictionary
SQL area cache
▪ Shared SQL area
▪ Data dictionary cache Fixed Area

▪ Control structures
Library Other
cache KEEP
Database buffer pool
Redo log
Shared pool buffer
buffer
cache RECYCLE
buffer pool

Java pool Streams nK buffer


Large pool pool cache

System Global Area (SGA)

12
Database Buffer Cache

• Is part of the SGA


• Holds copies of data blocks that are read from data files
• Is shared by all concurrent users

KEEP
Database buffer pool
Redo log
Shared pool buffer
buffer
cache RECYCLE
buffer pool

Java pool Streams nK buffer


Large pool pool cache

System Global Area (SGA)

14
Redo Log Buffer

• Is a circular buffer in the SGA


• Holds information about changes made to the database
• Contains redo entries that have the information to redo changes
made by operations such as DML and DDL

KEEP
Database buffer pool
Redo log
Shared pool buffer
buffer
cache RECYCLE
buffer pool

Java pool Streams nK buffer


Large pool pool cache

System Global Area (SGA)

15
Large Pool

Provides large memory allocations for:


• Session memory for the shared server and the Oracle XA interface
• I/O server processes
• Oracle Database backup and restore operations

KEEP
Database buffer pool
Redo log
Shared pool buffer
buffer Free Parallel
cache I/O buffer
RECYCLEmemory
Query
buffer pool
Response Request Advanced
Java pool Streams queue
nK buffer queue Queuing
Large pool pool cache
Large pool
System Global Area (SGA)

16
Program Global Area (PGA)

PGA Cursor Sort Hash


Area Area
State
Stack User
Create Bitmap Area
Space Global User Session
Area Data Bitmap Merge Area
Server
process 1
SQL
Working Areas

KEEP
Database buffer pool
Redo log
Shared pool buffer
buffer
cache RECYCLE
buffer pool

Java pool Streams nK buffer


Large pool pool cache

System Global Area (SGA)

17
Quiz

Memory region that contains data and control


information for a server or background process is
called:
1. Shared Pool
2. PGA
3. Buffer Cache
4. User session data

18
Quiz

What is read into the Database Buffer Cache from the


data files?
1. Rows
2. Changes
3. Blocks
4. SQL

19
Process Architecture

• User process
▪ Is the application or tool that connects to the Oracle database

• Database processes
▪ Server process: Connects to the Oracle instance and is started when a user
establishes a session
▪ Background processes: Are started when an Oracle instance is started

• Daemon / Application processes


▪ Networking listeners
▪ Grid infrastructure daemons

20
Multi-Tier Architecture

Client Middle tier Server

Initiator Process
Application Servers (Application Servers, Web Database
Server, Forms and Reports Servers) Server

21
Connecting to the Database Instance

• 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

22
Process Structures

Instances

System Global Area (SGA)


PGA
Server Background processes
process
Required: DBWn CKPT LGWR SMON PMON RECO

Optional: ARCn ASMB RBAL Others


Listener

User
process

23
Database Writer Process (DBWn)

Writes modified (dirty) buffers in the database buffer


cache to disk:
• Asynchronously while performing other processing
• To advance the checkpoint

DBWn

Database buffer Database writer Data files


cache process

24
Log Writer Process (LGWR)

• Writes the redo log buffer to a redo log file on disk


• Writes:
▪ When a user process commits a transaction
▪ When the redo log buffer is one-third full
▪ Before a DBWn process writes modified buffers to disk
▪ Every 3 seconds

LGWR

Redo log buffer Log Writer process Redo log files

25
Checkpoint Process (CKPT)

• Records checkpoint information in


▪ Control file
▪ Each data file header

CKPT Control file

Checkpoint
process

Data files

26
System Monitor Process (SMON)

• Performs recovery at instance startup


• Cleans up unused temporary segments

Instance
SMON

System Monitor
process

Temporary
segment

27
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

Server
process

PMON
User
tnslsnr Database buffer
Failed user Process Monitor
cache
process process

28
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

Recoverer process In-doubt transaction


in database A in database B

29
Archiver Processes (ARCn)

• Copy redo log files to a designated storage device after a log switch
has occurred
• Can collect transaction redo data and transmit that data to standby
destinations

ARCn

Archiver process Copies of redo log Archive destination


files

30
Database Storage Architecture

Control files Data files Online redo log files

Parameter file Backup files Archived redo log


files

Password file Alert log and trace files


31
Logical and Physical Database Structures

Logical Physical

Database

Tablespace Data file

Segment
Storage System
• SAN • NFS
Extent
• NAS • ASM
• Exadata • RAW
Oracle data
block • File System

32
33
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.

Segment Extents Data Disk blocks


blocks (File System
Storage)

34
Tablespaces and Data Files

Tablespace 1 Tablespace 2 (Bigfile)

Datafile 1 Datafile 2 Datafile 3

8Kb 8Kb 8Kb 8Kb 8Kb

8Kb 8Kb 8Kb 8Kb 8Kb


Only 1 datafile
8Kb 8Kb 8Kb 8Kb 8Kb allowed
8Kb 8Kb 8Kb 8Kb 8Kb <= 128 TB

Extent Extent
64KB 96KB

Segment
160KB

35
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).
• The SYSTEM and SYSAUX tablespaces are not recommended to
be used to store application's data.

36
Interacting with an Oracle Database:
Memory, Processes and Storage

Instance

Database KEEP
Redo log buffer
Shared buffer
PGA buffer
pool cache RECYCLE
Server buffer
process
Java Streams nK buffer
Large pool pool
pool cache
Listener
DBWn CKPT LGWR SMON PMON RECO ARCn Others

User
process

User

37
38
Quiz

The Process Monitor process (PMON):


1. Performs recovery at instance startup
2. Performs process recovery when a user process fails
3. Automatically resolves all in-doubt transactions
4. Writes the redo log buffer to a redo log file

39
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

You might also like