You are on page 1of 34

Introduction

Copyright © 2005, Oracle. All rights reserved.


Objectives

• After completing this course, you should be able


to do the following:
– Install, create, and administer Oracle Database 10g
Enterprise Edition
– Configure the database for an application
– Implement a backup and recovery strategy
– Employ basic monitoring procedures
• After completing this lesson, you should be able
to do the following:
– Describe course objectives
– Explain the Oracle Database 10g
architecture

1-2 Copyright © 2005, Oracle. All rights reserved.


Oracle Products

• Oracle databases
• Oracle Application Server
• Oracle Applications
• Oracle Collaboration Suite
• Oracle Developer Suite
• Oracle services

1-3 Copyright © 2005, Oracle. All rights reserved.


Oracle Database 10g:
“g” Stands for Grid

• Low cost
• High quality of service
• Easy to manage
Storage Database Application Grid
grid grid grid control

Automatic Real Oracle Enterprise


Storage Application Streams Manager
Management Clusters Grid Control

1-4 Copyright © 2005, Oracle. All rights reserved.


Oracle Database Architecture

An Oracle server:
• Is a database management system that provides
an open, comprehensive, integrated approach to
information management
• Consists of an Oracle instance and an Oracle
database

1-6 Copyright © 2005, Oracle. All rights reserved.


DB structures
- Memory
Database Structures
- Process
- Storage

Memory structures Instance


System Global Area (SGA)

Process structures
Background processes

Storage structures Database files

1-7 Copyright © 2005, Oracle. All rights reserved.


Oracle Memory Structures
DB structures
- Memory <<
- Process
- Storage

Server Server
Background
process PGA process PGA PGA
process
1 2

SGA

Shared pool Streams pool Large pool

Database Redo log


Java pool
buffer cache buffer

1-8 Copyright © 2005, Oracle. All rights reserved.


DB structures Process Structures
- Memory
- Process <<
- Storage

Instance
PGA
SGA
User process Server
process
Background
processes

• User process: Started at the time a database user


requests a 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
1-10 Copyright © 2005, Oracle. All rights reserved.
Oracle Processes

Server Server Server Server


process process process process

System Global Area


(SGA)

System Process Database Check-


LogWriter Archiver
Monitor Monitor Writer point
(LGWR) (ARCn)
(SMON) (PMON) (DBWn) (CKPT)
Background processes

1-11 Copyright © 2005, Oracle. All rights reserved.


Server Process and Database
Buffer Cache

SGA Buffers:
Server
process • Pinned
Database
buffer cache • Clean
• Free or
unused
• Dirty

DBWn

Data files

1-12 Copyright © 2005, Oracle. All rights reserved.


Physical Database Structure
DB structures
- Memory
- Process
- Storage <<

Control files Data files Online redo log files

Parameter file Backup files Archive log files

Password file Alert and trace log files

1-13 Copyright © 2005, Oracle. All rights reserved.


Tablespaces and Data Files

• Tablespaces consist of one or more data files.


• Data files belong to only one tablespace.

Data file 1 Data file 2

USERS tablespace

1-15 Copyright © 2005, Oracle. All rights reserved.


SYSTEM and SYSAUX Tablespaces

• The SYSTEM and SYSAUX tablespaces are


mandatory tablespaces.
• They are created at the time of database creation.
• They must be online.
• SYSTEM: For core functionality (for example, data
dictionary tables)
• SYSAUX: Is auxiliary, for additional database
components (such as the Enterprise Manager
Repository)

1-16 Copyright © 2005, Oracle. All rights reserved.


Segments, Extents, and Blocks

• Segments exist within a tablespace.


• Segments are made up of a collection of extents.
• Extents are a collection of data blocks.
• Data blocks are mapped to disk blocks.

Segment Extents Data Disk


blocks blocks

1-17 Copyright © 2005, Oracle. All rights reserved.


Logical and Physical Database Structures

Logical Physical

Database

Schema Tablespace Data file

Segment

Extent

Oracle data
OS block
block

1-18 Copyright © 2005, Oracle. All rights reserved.


Enlarging the Database

You can enlarge the database in the following ways:


• Creating a new tablespace
• Adding a data file to an existing tablespace
• Increasing the size of a data file
• Providing for the dynamic growth of a data file
Database

SYSTEM INVENTORY
tablespace tablespace

1-20 Copyright © 2005, Oracle. All rights reserved.


Exploring the Storage Structure

Click the links to view


detailed information.

1-21 Copyright © 2005, Oracle. All rights reserved.


The HR Sample Schema

LOCATIONS
LOCATION_ID (PK)
STREET_ADDRESS
JOB_HISTORY DEPARTMENTS POSTAL_CODE
EMPLOYEE_ID DEPARTMENT_ID (PK) CITY
(PK,FK)
DEPARTMENT_NAME STATE_PROVINCE
START_DATE (PK)
EMPLOYEES MANAGER_ID COUNTRY_ID (FK)
END_DATE
EMPLOYEE_ID (PK) LOCATION_ID (FK)
JOB_ID (FK)
FIRST_NAME
DEPARTMENT_ID (FK)
LAST_NAME
EMAIL
COUNTRIES
COUNTRY_ID (PK)
PHONE_NUMBER
COUNTRY_NAME
HIRE_DATE
REGION_ID (FK)
JOB_ID (FK)
SALARY
COMMISION_PCT JOBS
MANAGER_ID (FK) JOB_ID (PK)
JOB_TITLE
REGIONS
DEPARTMENT_ID (FK)
REGION_ID (PK)
MIN_SALARY
REGION_NAME
MAX_SALARY

1-22 Copyright © 2005, Oracle. All rights reserved.


Database Architecture:
Summary of Structural Components

• Memory structures:
– System Global Area (SGA): Database buffer cache,
redo buffer, and various pools
– Program Global Area (PGA)
• Process structures:
– User process and Server process
– Background processes: SMON, PMON, DBWn,
CKPT, LGWR, ARCn, and others
• Storage structures:
– Logical: Database, schema, tablespace, segment,
extent, and Oracle block
– Physical: Files for data, parameters, redo, and OS
block
1-23 Copyright © 2005, Oracle. All rights reserved.
Database Architecture and Activities

The following topics are covered in the remaining part


of this lesson:
• Control files
• Oracle instance management
• Data files and Database Writer (DBWn)
• Checkpoints (CKPT)
• Redo log files and LogWriter (LGWR)
• Archiver (ARCn)
• System Monitor (SMON)
• Process Monitor (PMON)
• Example: How the Oracle database works

1-24 Copyright © 2005, Oracle. All rights reserved.


Control Files

• Contain physical database structure information


• Are read at mount stage
• Should be multiplexed to protect against loss
• Are required to access the database

Example Instance
SGA
Database files

spfileorcl.ora
CONNECT / AS SYSDBA
STARTUP

1-25 Copyright © 2005, Oracle. All rights reserved.


Oracle Instance Management
SGA

Shared pool Streams pool Large pool

Database Redo log


Java pool
buffer cache buffer

System Process Database


LogWriter
Monitor Monitor Writer
(LGWR)
(SMON) (PMON) (DBWn)

Checkpoint Archiver
(CKPT) (ARCn)

1-26 Copyright © 2005, Oracle. All rights reserved.


Data Files

SGA • Contain all database data


• Can be associated with only
Database one database
buffer cache
• Form the logical unit of
database storage called
“tablespace”
Database
Writer • Are read into memory (in
(DBWn) blocks) on request
• Should be secured by
following a backup strategy

Data files

1-27 Copyright © 2005, Oracle. All rights reserved.


Database Writer (DBWn)
Background Information
SGA
DBWn writes when one of the
Database following events occurs:
buffer cache • Checkpoint
• Dirty buffers’ threshold
• No free buffers
Database
Writer • Timeout
(DBWn)
• RAC ping request
• Tablespace OFFLINE
• Tablespace READ ONLY
• Table DROP or TRUNCATE
Data files • Tablespace BEGIN BACKUP

1-28 Copyright © 2005, Oracle. All rights reserved.


Checkpoint (CKPT)

Responsible for: SGA


• Signaling DBWn at checkpoints
Database
• Updating data file headers with buffer cache
checkpoint information
• Updating control files with
checkpoint information Database
Writer
(DBWn)

Checkpoint
(CKPT)

1-29 Copyright © 2005, Oracle. All rights reserved.


Redo Log Files and LogWriter

SGA Redo log files:


Redo log • Record changes to the
buffer database
• Should be multiplexed to
Log protect against loss
Writer
(LGWR) LogWriter writes:
• At commit
• When one-third full
Group 1 Group 2 Group 3 • Every three seconds
• Before DBWn writes

1-30 Copyright © 2005, Oracle. All rights reserved.


Archiver (ARCn)

• Is an optional SGA
background process Redo log
• Automatically archives buffer
online redo log files
when ARCHIVELOG mode
is set for the database
LogWriter
• Preserves the record of (LGWR)
all changes made to the
database

Archiver
(ARCn)

1-31 Copyright © 2005, Oracle. All rights reserved.


System Monitor (SMON)

• Performs instance recovery at startup


• Coalesces free space
• Deallocates temporary segments
Instance
SGA

Other
processes

System
Monitor
(SMON)

1-32 Copyright © 2005, Oracle. All rights reserved.


Process Monitor (PMON)

PMON cleans up the database buffer cache and frees


resources after failed processes by:
• Rolling back the transaction
• Releasing locks
• Releasing other resources

Instance
PGA Process SGA
Monitor
User process Server (PMON)
process Other
processes

1-33 Copyright © 2005, Oracle. All rights reserved.


Oracle Instance Management: Summary
SGA

Shared pool Streams pool Large pool

Database Redo log


Java pool
buffer cache buffer

System Process Database


LogWriter
Monitor Monitor Writer
(LGWR)
(SMON) (PMON) (DBWn)

Checkpoint Archiver
(CKPT) (ARCn)

1-34 Copyright © 2005, Oracle. All rights reserved.


How the Oracle Database Works

1 Instance
Starting a database instance
Establishing a connection SGA

Database Redo log


buffer cache buffer

Database
3 Server LogWriter
Writer
process (LGWR)
2 (DBWn)

User process

1-35 Copyright © 2005, Oracle. All rights reserved.


How the Oracle Database Works
Instance

SGA
Processing a SQL statement
5 7 Database Redo log
buffer cache buffer

Database
Server LogWriter
Writer
10 process (LGWR)
(DBWn)

User process 9
8
6

4 The user updates a row.

1-36 Copyright © 2005, Oracle. All rights reserved.


Summary

In this lesson, you should have learned how to:


• Describe the course objectives
• Explain the Oracle Database 10g architecture

1-37 Copyright © 2005, Oracle. All rights reserved.


Database Architecture: Quiz

Mark each of the following statements about an Oracle


database as True or False:
1. Control files store information about the physical
database structure.
2. Transaction changes are stored in redo log files.
3. Tablespaces consist of one or more data files.
4. A data file can be used for more than one
tablespace.
5. LogWriter (LGWR) writes redo log entries to the
disk.
6. Database Writer (DBWn) writes modified blocks
from the buffer cache to the disk.
7. All Oracle background processes are optional.

1-38 Copyright © 2005, Oracle. All rights reserved.

You might also like