Exploring The Oracle Database Architecture

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 26

1

Exploring the Oracle Database Architecture

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Objectives

After completing this lesson, you should be able to:


• List the major architectural components of Oracle
Database server
• Explain memory structures
• Describe background processes
• Correlate logical and physical storage structures

1-2 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
Oracle Database Server Architecture: Overview

Instance

SGA

BGP1 BGP2 BGP3 BGPn

Database

1-3 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
Connecting to the Database Instance

User
• Connection: Bidirectional network process

pathway between a user process


on a client or middle tier and an User
process
oracle process on the server
Shared
• Session: Representation of Dispatcher Server

a specific login by a user Listener


process D000 S000

Connection

User Server SGA


SQL> Select … process process
Dedicated
Server Server host
User

Session (Specific connected database


user)

1-4 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
Oracle Database Memory Structures: Overview

SGA

Database buffer Redo log Shared pool Large pool


cache buffer

Java Streams
pool pool


Server Server Background
process process process

…Aggregate…
d
PGA

1-6 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
Database Buffer Cache

• Is a part of the SGA


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

Server
Database
process
buffer
cache

DBWn

Database writer
Data files process

1-7 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
Redo Log Buffer

• Is a circular buffer in the SGA (based on the number of


CPUs)
• Contains redo entries that have the information to redo
changes made by operations, such as DML and DDL
SGA

Server
process Redo log
buffer

LGWR

Log writer
Redo log process
files

1-8 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
Shared Pool

• Is part of the SGA


• Contains: Server
process
– Library cache

Shared parts of SQL and
PL/SQL statements
– Data dictionary cache SGA

– Result cache:

SQL queries Data
dictionary Result

PL/SQL functions Library cache cache
– Control structures cache (row cache)


Locks
Control
structures

Shared pool

1-9 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
Processing a DML Statement: Example

Database
DBWn SGA

Database
2 4
2 buffer cache
Data Server Redo log
files process 3 buffer

Shared pool
5
Control 1 Library cache

files User
process

Redo
log files

1 - 10 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


COMMIT Processing: Example

Database
DBWn SGA

Database
buffer cache
Data Server Redo log
files process 1 buffer
SGA

Shared pool
3
Control Library cache

files User
process

Redo
log files LGWR 2

1 - 12 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Large Pool

• Provides large memory allocations for:


– Session memory for the shared server and Oracle XA
interface
– Parallel execution buffers
– I/O server processes
Server
– Oracle Database backup process
and restore operations
• Optional pool better suited
when using the following: SGA

– Parallel execution Free


I/O buffer
memory
– Recovery Manager
Response Request
– Shared server queue queue
Large pool

1 - 13 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


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

Java pool Streams


pool

1 - 14 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Program Global Area (PGA)

• PGA is a memory area that contains:


– Session information Server
process
– Cursor information
– SQL execution work areas:

Sort area User Global Area (UGA)
Stack

Hash join area Space User Cursor SQL

Bitmap merge area Session Status Area
Data

Bitmap create area
• Work area size influences SQL performance.
• Work areas can be automatically or manually managed.

1 - 15 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Background Process

RCBG MMON CJQ0 QMNn MMAN

Database
SGA Redo log
buffer Shared pool
buffer
cache

CKPT PMON SMON DBWn LGWR ARCn

1 - 16 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Automatic Shared Memory Management

SGA_TARGET + STATISTICS_LEVEL
SGA

Shared pool Fixed SGA Large pool

Java Streams Database Redo log


pool pool buffer cache buffer

Which size to choose?

Automatically tuned SGA components

1 - 18 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Automated SQL Execution Memory Management

PGA_AGGREGATE_TARGET

Server
process
Server
process
… Background
process

…Aggregate
d …
PGA

Which size to choose?

1 - 19 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Automatic Memory Management

• Sizing of each memory component is vital for SQL


execution performance.
• It is difficult to manually size each component.
• Automatic memory management automates memory
allocation of each SGA component and aggregated PGA.

MMAN
SGA memory Aggregated PGA memory
Streams pool

Buffer cache
Shared pool

Large pool
Other SGA

Untunable
Java pool

SQL areas
Private

Free

PGA
MEMORY_TARGET + STATISTICS_LEVEL

1 - 20 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Database Storage Architecture

Control file Data files Online redo log files

Parameter file Backup files Archived redo log files

Password file Alert log and trace files

1 - 21 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Logical and Physical Database Structures

Logical Physical

Database
Only 1 with
bigfile
tablespaces
Schema Tablespace Data file
0, 1, or many

Undo tablespaces
never have 0 Segment

Extent

Oracle data
OS block
block

1 - 23 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


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

1 - 25 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


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).

1 - 26 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Quiz

The first time an Oracle Database server process requires a


particular piece of data, it searches for the data in the:
a. Database Buffer Cache
b. PGA
c. Redo Log Buffer
d. Shared Pool

1 - 27 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Quiz

Which of the following is not a database logical structure?


a. Tablespace
b. Data File
c. Schema
d. Segment

1 - 28 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Quiz

The SYSAUX tablespace is used for core functionality and the


SYSTEM tablespace is used for additional database
components such as the Enterprise Manager Repository.
a. True
b. False

1 - 29 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Summary

In this lesson, you should have learned how to:


• List the major architectural components of the Oracle
Database server
• Explain memory structures
• Describe background processes
• Correlate logical and physical storage structures

1 - 30 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.


Practice 1: Overview

This practice covers the following topics:


• Listing the different components of an Oracle Database
server
• Looking at some instance and database components
directly on your machine

1 - 31 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

You might also like