Introduction of Oracle Database
Introduction of Oracle Database
Introduction of Oracle
Database
Objective
What is Oracle DB?
Why a Company needs a DBA?
Roles & Responsibilities of DBA
Identify the oracle product
Physical and Logical Phase of Database
Oracle Database Architecture
What is Oracle DB?
System Intended to Organize, Store and Retrieve data.
Most widely used RDBMS and one of the best
There is no database size restriction –Exabytes (Exa Bytes)
You can install and use in both Windows and Unix/Linux
environments
Availability 7x24-hour walk – High availability solutions (DG,GG,RAC)
Easily accessible by other applications.
Oracle Database Release
Number
Physical and Logical Phase of
Database:
Database is divided into Logical layer and Physical layer
Oracle Database Architecture:
Oracle Database Server Architecture contains 3 major structures.
a. Memory Structure
b. Process Structure
c. Storage Structure
A basic Oracle Database system consists of an,
a. Oracle Database
b. Oracle Instance
The Database consists of both,
a. Physical Structures – Storage/Database files
b. Logical Structures - Instance
The Instance consists of,
a. Memory Structure
b. Background Processes
Oracle Architecture:
Oracle Database Instance
Configurations
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
Oracle Database Memory
Structures
Two basic memory structures are associated with an instance,
a. SGA(System Global Area or Shared Global Area)
b. PGA(Program Global Area or Process Global Area)
c. UGA(User Global Area)
Shared Pool:
Used to store,
a. Most recently executed SQL statements
b. Most recently used data definitions
It also contains,
i. Library Cache
ii. Data Dictionary Cache
or row cache
iii. Server Result Cache –
Database Buffer Cache
Holds copies of data blocks that are read from data files
Managed through an LRU algorithm
Redo Log Buffer
Is a circular buffer in the SGA
Holds information about changes made to the database data blocks
Primary purpose is recovery
Contains redo entries that have the information to redo changes
made by operations such as DML and DDL
Large Pool
An optional area of memory in the SGA
Relieves burden places on the shared pool
User for
a. Session memory (UGA) for the shared server configuration
b. I/O server processes
c. Backup and restore operations or RMAN
d. Parallel execution message buffers
Java Pool
Required if installing and using Java
Java pool memory is used to store all session-specific Java code and
data in the JVM.
Streams Pool
Streams pool memory is used exclusively by Oracle Streams to:
a. Store buffered queue messages
b. Provide memory for Oracle Streams processes
Program Global Area (PGA)
Memory reserved for each user process connecting to an oracle database
Allocated when a process is created
Deallocated when a process is terminated
Used by only one process
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
Oracle Server Processes
– Listener
– Dispatcher
– Dispatcher Threads
Dispatcher threads are two types,
– Dedicated Server Processes
– Shared Server Processes
Process Structures
User & Server Processes:
User Process:
A program that requests interaction with the oracle server
Must first establish a connection
Does not interact directly with the oracle server
Server Process:
A program that directly interacts with the oracle server
Fulfills calls generated and returns results
Can be Dedicated or Shared server
Background processes
Background processes can be divided into two parts again,
a. Mandatory BP(SMON,PMON,LGWR,DBWRn,CKPT,ARCn)
b. Optional BP
I. Recoverer process (RECO)
II. Listener registration process (LREG)
III. Manageability monitor process (MMON)
IV. Manageability monitor lite process (MMNL)
V. Job queue coordinator (CJQ0)
VI. Job slave processes (Jnnn)
VII. Queue monitor processes (QMNn)… etc
Note: the V$BGPROCESS view for more information on the background
processes.
System Monitor Process (SMON)
Performs recovery at instance startup
Rolls forward changes in redo logs
Opens database for user access
Rolls back uncommitted transactions
Coalesces free space
Deallocates temporary segments
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
Database Writer Process
(DBWn)
It writes when:
Checkpoint occurs (To advance the checkpoint)
Dirty buffers reach threshold
There are no free buffers
Timeout occurs
RAC ping request is made
Tablespace OFFLINE, READ ONLY, BEGIN BACKUP
Table DROP or TRUNCATE
Log Writer Process (LGWR)
Writes the redo log buffer to a redo log file on disk
When a user process commits a transaction
When an online redo log switch occurs
When the redo log buffer is one-third full or contains 1 MB of buffered data
Before a DBWn process writes modified buffers to disk
When three seconds have passed since the last write
Serves as coordinator of LGnn processes and ensures correct order
for operations that must be ordered
Checkpoint Process (CKPT)
Records checkpoint information in
Control file
Each data file header
Signals DBWn to write blocks to disk
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
Listener Registration Process
(LREG)
Registers information about the database instance and dispatcher
processes with the Oracle Net Listener
Database Storage Architecture
Logical and Physical Database
Structures
Segments, Extents, and Blocks
Tablespaces and Data Files
SYSTEM and SYSAUX
Tablespaces
Interacting with an Oracle
Database:
Memory, Processes, and Storage