Oracle Database Architecture Overview
Oracle Database consists of several interconnected components that work together to provide robust data management capabilities. Understanding these components is essential for database administration and development.
Instance
An Oracle instance provides the runtime environment for database operations. It comprises memory structures and background processes that manage database access.
Memory Structures
System Global Area (SGA): A shared memory region that caches database buffers and stores shared information across all processes.
Program Global Area (PGA): Memory allocated per server process, dedicated to storing session-specific data and private SQL work areas.
Background Processes
Database Writer (DBWn): Writes modified data blocks from the database buffer cache to physical data files.
Log Writer (LGWR): Records transaction changes by flushing redo log buffer contents to online redo log files.
Checkpoint Process (CKPT): Updates control files and data file headers with checkpoint information to synchronize database state.
Archiver Process (ARCn): Copies filled redo log files to designated archive destinations for point-in-time recovery.
Database
The Oracle database encompasses physical storage structures that persist data on disk.
Data Files
Data files contain the actual application data. Each tablespace maps to one or more data files.
-- Creating a new tablespace with data file
CREATE TABLESPACE app_data
DATAFILE 'app_data01.dbf' SIZE 200M;
Control Files
Control files maintain critical metadata about database structure, current state, and physical file locations.
Online Redo Log Files
Redo log files capture every transaction modification in chronological order, enabling recovery operations after system failures.
Tablespaces
Tablespaces function as logical storage containers that organize data files into manageable units.
-- Defining a tablespace for application objects
CREATE TABLESPACE production
DATAFILE 'prod_data01.dbf' SIZE 100M;
Storage Hierarchy
Data Block: The fundamental I/O unit in Oracle, typically 8KB (configurable).
Extent: A collection of contiguous data blocks allocated together when segment growth occurs.
Segment: A collection of extents reserved for storing a specific database object, such as table or index data.
Database Objects
Tables
Tables represent the primary data storage structure, organized in rows and columns.
-- Defining a personnel table
CREATE TABLE staff_members (
staff_id NUMBER NOT NULL,
first_name VARCHAR2(40),
surname VARCHAR2(40),
contact_email VARCHAR2(100),
employment_date DATE,
compensation NUMBER(10,2),
CONSTRAINT pk_staff PRIMARY KEY (staff_id)
) TABLESPACE production;
Indexes
Indexes accelerate data retrieval by providing efficient access paths to table rows.
-- Building an index on surname column
CREATE INDEX idx_surname ON staff_members (surname);
Views
Views are virtual tables derived from underlying queries against one or more base tables.
-- Establishing a filtered view for high earners
CREATE VIEW high_earners AS
SELECT staff_id, first_name, surname, compensation
FROM staff_members
WHERE compensation > 75000;
Synonyms
Synonyms provide alternative names for database objects, simplifying application code.
-- Creating an alias for the staff table
CREATE SYNONYM staff FOR staff_members;
PL/SQL Engine
PL/SQL extends Oracle's capabilities with procedural language features for building complex business logic.
-- Defining a procedure to adjust employee compensation
CREATE OR REPLACE PROCEDURE adjust_compensation (
v_staff_id NUMBER,
v_increase_pct NUMBER
) AS
BEGIN
UPDATE staff_members
SET compensation = compensation * (1 + v_increase_pct / 100)
WHERE staff_id = v_staff_id;
END adjust_compensation;
Oracle Net Services
Oracle Net Services enables network connectivity between clients and the database server through varrious protocols.
# tnsnames.ora network configuration
SALES_DB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbserver01)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = salesdb)
)
)
Oracle Enterprise Manager
Enterprise Manager delivers comprehensive graphical administration for monitoring database health, performance tuning, and routine administrative tasks.
Summary
These architectural components form an integrated system that delivers enterprise-grade data persistence, concurrent access management, transaction integrity, and recovery capabilities required for mission-critical applications.