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
| Item | Value |
|---|---|
| Storage unit | Block, 8KB by default. Chosen from 2, 4, 8, 16, and 32KB when the database is created |
| Space structure | Block → extent → segment → tablespace → data file |
| Table storage | Heap. An IOT (Index-Organized Table), which stores rows in primary key order, is optional |
| Row address | ROWID (object number, file number, block number, row number) |
| Buffer pool | Buffer cache, part of the SGA |
| Large value handling | LOB (CLOB, BLOB, NCLOB, BFILE) |
VARCHAR2 maximum length | 4,000 bytes. 32,767 bytes if MAX_STRING_SIZE = EXTENDED |
| Concurrency control | Read consistency (CR blocks), which rebuilds past-time blocks from Undo segments |
| Default isolation level | Read Committed. Serializable is also supported (in practice, snapshot isolation) |
| Log | Redo log (online, archived) |
| Execution structure | Dedicated server process (one per connection) or shared server |
Memory and Processes
| Component | Description |
|---|---|
| SGA | Memory shared by the instance. Buffer cache, shared pool (parsed SQL and execution plans), redo log buffer, large pool, and so on |
| PGA | Memory that each server process owns separately. Work area for sorts and hash joins |
| DBWn | Writes dirty blocks to the data files |
| LGWR | Writes the redo log buffer to the redo log files. A commit completes when LGWR finishes writing |
| CKPT | Records the checkpoint position |
| SMON, PMON | Instance 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_HISTORYand 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 oldoccurs. - DDL commits implicitly before and after it runs, so it cannot be rolled back.
- Oracle treats the empty string
''asNULL.
In the Articles
NOTE Defaults and restrictions can vary by version and edition.