Oracle Database

Oracle Database is a commercial relational DBMS made by Oracle. An instance, made up of memory structures (SGA, PGA) and background processes, opens the data files on disk. A free edition, Oracle Database Free (formerly Express Edition), is available, and this site's sandbox uses Oracle Database 23ai Free.

Key Specs

ItemValue
Storage unitBlock, 8KB by default. Chosen from 2, 4, 8, 16, and 32KB when the database is created
Space structureBlock → extent → segment → tablespace → data file
Table storageHeap. An IOT (Index-Organized Table), which stores rows in primary key order, is optional
Row addressROWID (object number, file number, block number, row number)
Buffer poolBuffer cache, part of the SGA
Large value handlingLOB (CLOB, BLOB, NCLOB, BFILE)
VARCHAR2 maximum length4,000 bytes. 32,767 bytes if MAX_STRING_SIZE = EXTENDED
Concurrency controlRead consistency (CR blocks), which rebuilds past-time blocks from Undo segments
Default isolation levelRead Committed. Serializable is also supported (in practice, snapshot isolation)
LogRedo log (online, archived)
Execution structureDedicated server process (one per connection) or shared server

Memory and Processes

ComponentDescription
SGAMemory shared by the instance. Buffer cache, shared pool (parsed SQL and execution plans), redo log buffer, large pool, and so on
PGAMemory that each server process owns separately. Work area for sorts and hash joins
DBWnWrites dirty blocks to the data files
LGWRWrites the redo log buffer to the redo log files. A commit completes when LGWR finishes writing
CKPTRecords the checkpoint position
SMON, PMONInstance recovery, cleanup of dropped sessions

You can size memory by hand (DB_CACHE_SIZE, SHARED_POOL_SIZE), or set only the total with SGA_TARGET (ASMM) or MEMORY_TARGET (AMM) and let Oracle divide it automatically. The SGA and PGA layout and the full list of background processes are in Memory and Process Structure; the listener and shared pool cursors are in Connections, Cursors, and the SQL Cache.

Editions and Restrictions

  • Many Enterprise Edition features (partitioning, advanced compression, the Diagnostics and Tuning Packs, and others) require a separate license. Some views, such as V$ACTIVE_SESSION_HISTORY and AWR, require a pack license.
  • Oracle Database Free is limited to 2 CPUs, 2GB of memory, and 12GB of user data.
  • Since 12c, Oracle uses a multitenant architecture with pluggable databases (PDBs) inside a container database (CDB), and since 21c it supports only this architecture. The sandbox data is in FREEPDB1.

Configuration and Checks

SELECT banner_full FROM v$version;
SELECT name, value FROM v$parameter WHERE name IN ('db_block_size', 'sga_target', 'memory_target', 'db_cache_size');
SELECT tablespace_name, block_size, contents FROM dba_tablespaces;

Comparison with Other DBMSs

  • Oracle keeps previous values in Undo and rebuilds past blocks when needed. This is similar to MySQL (InnoDB) and differs from the in-table row versions of PostgreSQL.
  • If the Undo that a long-running query needs is overwritten, ORA-01555: snapshot too old occurs.
  • DDL commits implicitly before and after it runs, so it cannot be rolled back.
  • Oracle treats the empty string '' as NULL.

In the Articles

NOTE Defaults and restrictions can vary by version and edition.

Related pages