Oracle Database is the foundational data management backbone for mission-critical industries, including global financial institutions, healthcare providers, defense systems, and telecommunications networks. Its architecture is engineered around the principle of absolute physical-to-logical data decoupling, multi-version concurrency control (MVCC), and crash resilience.
Physical vs Logical Storage Hierarchy
Understanding Oracle requires understanding the distinction between what exists on the operating system disks versus how the database engine presents storage to applications:
Logical Storage Structure Physical Storage Structure
========================= ==========================
[ Tablespace: USERS_TBS ] -------------> [ Datafile 1: users01.dbf ]
| [ Datafile 2: users02.dbf ]
+---> [ Segment: EMPLOYEES ]
|
+---> [ Extent (1MB) ] ---> Contiguous Disk Blocks
|
+---> [ Oracle Data Block (8KB standard) ]
- Oracle Data Block: The finest unit of database storage (typically 8 KB). Contains row data, block header, and transaction slots.
- Extent: A contiguous set of data blocks allocated at one time.
- Segment: The set of extents allocated for a specific database object (e.g., a table, index, or undo segment).
- Tablespace: A logical container grouping one or more segments. Every table belongs to a tablespace.
- Datafiles: The physical files on the host storage disk that constitute a tablespace. A tablespace can span multiple physical datafiles, but a datafile belongs to exactly one tablespace.
Memory Architecture: SGA and PGA
An Oracle Instance consists of memory structures and background processes running on the host server:
- SGA (System Global Area): Shared memory region allocated when the instance starts:
- Database Buffer Cache: Holds cached copies of data blocks read from disk.
- Shared Pool: Caches parsed SQL execution plans (Library Cache) and data dictionary definitions (Dictionary Cache).
- Redo Log Buffer: High-speed circular buffer recording all database changes before flushing to disk.
- Large Pool: Optional memory for RMAN backups, parallel query execution, and I/O server processes.
- PGA (Program Global Area): Private, non-shared memory allocated to each dedicated server process handling an individual client connection. Used for session data, cursor state, and sort operations (e.g.,
ORDER BY, hash joins).
Essential Background Processes
- DBWR (Database Writer): Flushes dirty data blocks from the Buffer Cache to datafiles asynchronously.
- LGWR (Log Writer): Flushes redo log entries from the Redo Log Buffer to physical online redo log files synchronously on transaction
COMMIT. - CKPT (Checkpoint): Updates datafile headers and control files with current checkpoint sequence information, synchronizing memory with disk state.
- SMON (System Monitor): Performs instance crash recovery during startup and coalesces free extents.
- PMON (Process Monitor): Cleans up failed client processes, releases locks, and frees PGA resources.
The DUAL Table Concept
In ANSI SQL standards, a query requires a source table. Because Oracle strictly adheres to this relational model, it provides the built-in system table DUAL owned by schema SYS. DUAL has exactly one row and one column named DUMMY of type VARCHAR2(1) holding the value 'X'.
Whenever you need to evaluate an expression, call a scalar function, inspect system metrics, or evaluate a sequence, you select against DUAL:
-- Evaluate current server timestamps and user session context
SELECT
SYSDATE AS current_db_date,
SYSTIMESTAMP AS high_precision_time,
USER AS connected_user,
SYS_CONTEXT('USERENV', 'SESSIONID') AS session_id,
SYS_CONTEXT('USERENV', 'IP_ADDRESS') AS client_ip
FROM DUAL;
-- Mathematical and string evaluations
SELECT
ROUND(145.789, 2) AS rounded_value,
MOD(105, 10) AS remainder,
UPPER('enterprise oracle architecture') AS capitalized_text,
NVL(NULL, 'Default Fallback') AS resolved_null
FROM DUAL;
Exercises
- Write a query against
DUALthat calculates the number of days remaining until December 31st of the current year usingTO_DATEandSYSDATE. - Query
SYS_CONTEXT('USERENV', 'DB_NAME')fromDUALto retrieve the connected database identifier. - Explain why the database log writer (
LGWR) writes ahead of the database writer (DBWR) during a standard transaction commit.