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

ORACLE

DATABASE
AN INTRODUCTION
ARCHITECTURAL OVERVIEW
1 Before starting

INSTANCE MANAGEMENT
2 What we did, what we do

Contents 3
ORACLE NETWORKING
Our amazing products

ORACLE STORAGE
4 Our awesome ideas

ORACLE SECURITY
5 Marketing data and our estimation

2
Oracle Database
vs
Oracle Instance
A database is collection of physical operating
system files on disk.
Ex: data files, temporary files, redo log files, and
control files.

An instance is a set of background processes and


shared memory structures.
Ex: PMON, DBWn, LGWR, Buffer Cache, Log
Buffer.

3
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Oracle Database
vs
Oracle Instance
A database is collection of physical operating
system files on disk.
Ex: data files, temporary files, redo log files, and
control files.
An instance can mount and open only a single database, ever.
A database may be mounted and opened by one or more instances
An instance is a set of background processes and
(using RAC).
shared memory structures.
Ex: PMON, DBWn, LGWR, Buffer Cache, Log
Buffer.

4
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Client-Server Processing (two-tier)
Id vis regione gubergren complectitur, vel legere integre corpora ea. Eu error expetenda gubergren eos, eu discere
mentitum vel, ei rebum molestie scaevola pri. Nec id agam iisque commune. Duo at facilisi maluisset, aeque
iuvaret nam at. Sed an vide populo, an nostro accusam fastidii cum, tale purto duo in. Nam ad case assum
dissentiet, ullum labitur ius ea.

5
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
ORACLE
ARCHITECTURE

Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Ex labitur deserunt recusabo has,
sensibus erroribus vim eu, cum errem
phaedrum prodesset at. Alii petentium no

INSTANCE MEMORY mea, sale senserit constituto pro at. Ius DATABASE STORAGE
STRUCTURES etiam numquam ad, sed id odio fabulas STRUCTURES
eleifend.

Reque partiendo ad mea. Cu verear


System Global Area (SGA)
INSTANCE PROCESS epicurei constituto vel, iusto volutpat id
Private Global Area (PGA) STRUCTURES
has, no ius errem bonorum conceptam.
Cetero aliquando similique ei mel, eius
primis phaedrum nam ea.

7
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
SGA (Shared Global Area)
Key mandatory memory structures:
 The database buffer cache
 The log buffer
 The shared pool
It may optionally contain:
 A large pool
 A Java Pool
 A Streams Pool

Related parameters:
MEMORY_TARGET
MEMORY_MAX_TARGET
SGA_TARGET

8
SGA_MAX_SIZE

Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Database Buffer Cache

Optimize physical I/O

Because accessing data from disk is slower than from memory,


the database buffer cache’s sole purpose is to cache the data in
memory for quicker access.

9
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Database Buffer Cache

Types of Buffers

 Dirty Buffers contain data that has been modified but has
not yet been written to disk;
 Pinned Buffers are currently being accessed;
 Free Buffers do not contain any useful data and are
available for use.
10
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Redo Log Buffer
Key mandatory memory structures:
 The database buffer cache
 The log buffer
 The shared pool
It may optionally contain:
 A large pool
 A Java Pool
 A Streams Pool

Related parameters:
MEMORY_TARGET
MEMORY_MAX_TARGET
SGA_TARGET

11
SGA_MAX_SIZE

Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
What is a
Chenge Vector like?

A change vector consists of a single change to a single


data block. A change vector is the smallest unit of change
recorded in a redo log.

12
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Redo Log Buffer

Optimize physical I/O

Sessions write change vectors to the log buffer in memory. This is


much faster than writing to the online redo log files on disk.

13
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Redo Log Buffer

Flushing Log Buffer

 A session issues a commit or a rollback command.


 The log buffer becomes 1/3 full.
 A timeout (every 3 seconds) occurs.
 A checkpoint occurs.

14
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Redo Log Buffer

Ultimate Bottleneck

Flushing the redo log buffer to disk is an ultimate bottleneck in the


Oracle architecture. You cannot do DML faster than the LGWR
process can flush the change vectors to the online redo log files!

15
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Shared Pool
Used for caching many different types of frequently
used data.

Main shared pool components are:


 Library Cache
 Data Dictionary Cache
 Server Result Cache
 Reserved Pool

16
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Library Cache

17
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Library Cache

Ready to Execute

Library cache stores recently executed SQL statements, PL/SQL


programs, and Java classes in parsed form.

18
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Stages of SQL Processing

https://docs.oracle.com/database/121/TGSQL/tgsql_sqlpro
c.htm#TGSQL176

19
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Library Cache Check

Id vis regione gubergren complectitur, vel legere integre corpora ea. Eu error expetenda gubergren eos, eu discere
mentitum vel, ei rebum molestie scaevola pri. Nec id agam iisque commune. Duo at facilisi maluisset, aeque
iuvaret nam at. Sed an vide populo, an nostro accusam fastidii cum, tale purto duo in. Nam ad case assum
dissentiet, ullum labitur ius ea.

20
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Data Dictionary Cache

The data dictionary cache stores descriptive information, or metadata, about schema objects. Oracle Database uses
this metadata when parsing SQL statements or during the compilation of PL/SQL programs.

21
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Server Result Cache

The server result cache is a memory pool consists of the SQL query result cache, which stores results of SQL queries,
and the PL/SQL function result cache, which stores values returned by PL/SQL functions.

22
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Server Result Cache

The server result cache is a memory pool consists of the SQL query result cache, which stores results of SQL queries,
and the PL/SQL function result cache, which stores values returned by PL/SQL functions.

23
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
How Results are
Retrieved in a Query

A query of hr.employees that uses the RESULT_CACHE hint to


retrieve rows from the server result cache.

24
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
A portion of the
execution plan

The results are retrieved directly from the result cache, as indicated in
step 1 of the execution plan. The value in the Name column is the
cache ID of the result.

25
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
A query for result
cache statistics

A query of the V$RESULT_CACHE_OBJECTS view to retrieve


detailed statistics about the cached result.

26
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
The output of a
result cache
statistics

The descriptive information of data kept in server result cache.

27
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Reserved Pool

The reserved pool is a memory area in the shared pool that Oracle Database can use to allocate large contiguous
chunks of memory (usually over 5 KB).

28
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
What is a latch?

When changing a memory structure only one process can make a


change at a time. Latches are locks designed to be held for
extremely short periods of time to protect certain memory
structures.

29
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Reserved Pool

Large allocations

For large allocations, Oracle Database attempts to allocate space


in the shared pool in the following order:
1. From the unreserved part of the shared pool.
2. From the reserved pool.
3. From memory.
30
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Large Pool
The large pool is an optional memory area intended for
memory allocations that are larger than is appropriate
for the shared pool.

Used for large allocations of:


• UGA for the shared server
• Buffers for Recovery Manager (RMAN) I/O

Pieces of memory are allocated and cannot be freed


until they are done being used.

31
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Shared Server
vs
Dedicated Server Processes

When changing a memory structure only one process can make a


change at a time. Latches are locks designed to be held for
extremely short periods of time to protect certain memory
structures.

32
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
ECM Overview

Workflow Solutions

Integration with ERP

ECM Market

Patent Explanation
Types of Processes
1. Client Process:
A client program acting on behalf of the user, such as
Oracle Enterprise Manager, SQL*Plus, or an application
2. Oracle Processes:
Server Process: Performs much of the work
based on a client request. Such as parsing and running
SQL statements, and retrieving and returning results
to the client program.
:Background Processes: Starts with the
database instance and perform maintenance tasks

34
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
SMON (System Monitor)
Initially has the task of mounting and opening database

OPEN

All database files are opened.


3 Ready for end user.
MOUNT

2 Contol file located and read


NOMOUNT

Read parameter file


1 SGA created
SHUTDOWN Background processes started

35
The Power of PowerPoint - thepopp.com
SMON (System Monitor)

Housekeeping tasks

1. Each time oracle is re-started, SMON performs a warm start and


makes sure that the transactions that were left incomplete at the
last shut down are recovered.
2. Performs instance recovery, if necessary, at instance startup.
3. Performs periodic cleanup of temporary segments that are no
longer needed.
36
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
SMON’s instance recovery
with example

http://www.dbacentre.com/smons-instance-recovery-with-
example/

37
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
PMON (Process Monitor)

PMON monitors the other background processes and performs process recovery when a server or dispatcher process
terminates abnormally.

When a session terminates abnormally, PMON:


 Destroys related server process.
 Returns PGA memory to the operating system’s free memory pool
 Roll backs any incomplete transaction
 Releases locks that are no longer required etc.

38
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
DBWn (Database Writer)

Lazy Writer

• DBWn writes dirty buffers from the databaase buffer cache to the
datafiles on disk.
• Although one database writer process (DBW0) is adequate for
most systems, you can configure additional processes (DBW1,
DBW2,...,DBW19)

39
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
DBWn (Database Writer)

Write Conditions

• No free buffers
• Too many dirty buffers
• 3 seconds timeout
• A checkpoint requested
Note: DBWn does absolutely nothing when a transaction is
committed!
40
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
What is a checkpoint?

A checkpoint performs the following three operations:


1. Every dirty block in the buffer cache is written to the data
files. That is, it synchronizes the datablocks in the buffer cache
with the datafiles on disk.
2. The latest SCN is written (updated) into the datafile header.
3. The latest SCN is also written to the controlfiles.

41
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
LGWR (Log Writer)

Fast Sequential Writer

LGWR writes the contents of the redo log buffer to the online log files
on disk. In the following circumstances, LGWR writes all redo
entries:
• A user commits a transaction.
• Three seconds have passed since LGWR last wrote.

42
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
LGWR (Log Writer)

Fast Sequential Writer

• An online redo log switch occurs.


• The redo log buffer is one-third full or contains 1 MB of buffered
data.
• Before DBW writes dirty buffers to disk.

43
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
ARCn (Archiver)

Fast Sequential Writer

• ARC process copies change vectors from inactive online redo log
files to an offline storage.

44
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
CKPT (Checkpoint)

Consistent Database

CKPT updates the control file and data file headers with checkpoint
information and signals DBW to write blocks to disk. Checkpoint
information includes the checkpoint position, SCN, and location in
online redo log to begin recovery.

45
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
MMON and MMNL
(Manageability Monitors)
Automatic Management

MMON performs many tasks related to the Automatic Workload


Repository (AWR). For example, MMON writes when a metric
violates its threshold value, taking snapshots, and capturing statistics
value for recently modified SQL objects.

46
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
ECM Overview

Workflow Solutions

Integration with ERP

ECM Market

Patent Explanation
Physical Database Logical Database
Structures Structures

The physical database structures of an Oracle The physical database structures of an Oracle
database are viewable at the operating system database are viewable at the operating system
level. level.

48
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Physical Database Structures

Operating System Files

• Data Files
• Control Files
• Online Redo Log Files
• Archieved Redo Log Files
• Instance parameter file
• Password File
• Alert Log and Trace Files 49
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Data Files Structure

Data Repos

• The header contains metadata about the data file.


• When a data file is first created the allocated disk space
is formatted but contains no user data.
• As the data grows in a tablespace, the free space in the
data files are used to allocate extents for the segment.

50
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Control Files

A small binary file

Oracle Database reads and writes to the control file


continuously during database use and must be
available for writing whenever the database is open.

51
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Control Files

Used everywhere

• It contains information about data files, online redo log


files, and so on that are required to open the database.
• It tracks structural changes to the database. 

52
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Control Files

A small binary file

• It contains metadata, information required to recover


the database etc.
• The dynamic performance views, also known as V$
views, can be used to view the information stored in
the control file.

53
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Online Redo Log Files

Crucial for Recovery

• Records changes to the data files.


• Protects against data loss.
• Useful source of historical information about
database activity.
• Contents may include uncommitted transaction
also undo data.
54
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Online Redo Log Files

Log Switches

• An online redo log consists of two or more online


redo log files.
• A log switch occurs when the database stops
writing to one online redo log file and begins
writing to another.

55
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Logical Database Structures

Not OS Files

• Datablock
• Extent
• Segment
• Tablespaces

56
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Data Blocks

Minimum Logical Unit

• An operating system block is the minimum unit of data


that the OS can read or write.
• An Oracle block is a logical storage structure whose size
and structure are not known to the OS.
• The database requests data in multiples of data blocks, not
operating system blocks.
57
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Data Block Format

Block Overhead

• Block Header: Contains general information about the


block.
• Table Directory: Metadata about tables whose rows are
stored in this block.
• Row Directory: Describes the location of rows in the data
portion of the block.
58
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Data Block Format

Actual Data

• Row Data: Contains the actual data, such as table rows


or index key entries.

59
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Data Block Format

Free Space

• Free Space: As the database fills a data block from the


bottom up, the amount of free space between the row data
and the block header decreases.

60
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Extents

Contiguous data blocks

• An extent is a logical unit of database storage space


allocation made up of contiguous data blocks.
• An extent is always contained in one data file.

61
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Segments

Types

• User segments
• Temporary segments
• Undo segments

62
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Tablespaces

Storage Containers

• A tablespace is a logical storage container for


segments.
• Each database user is assigned a default
permanent tablespace.
• There are many types as well as segments.

63
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Tablespaces

Usage Areas

• Control disk space allocation for database data


• Assign a quota (space allowance or limit) to a
database user
• Take individual tablespaces online or offline
without affecting the availability of the whole
database
64
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security
Tablespaces

Usage Areas

• Perform backup and recovery of individual


tablespaces
• Import or export application data by using the
Oracle Data Pump utility

65
The Power of PowerPoint - thepopp.com
Architectural Overvıew Instance Management Oracle Networking Oracle Storage Oracle Security

You might also like