Database Storage Structures
π§ Introduction
Ever wondered how Oracle actually stores your data?
Letβs break it down β from big-picture storage like tablespaces, down to the tiniest data block.
Whether you’re using a CDB (Container Database) or PDB (Pluggable Database), these layers apply.
π§± Storage: Two Levels β Physical and Logical
πΉ Physical Level β Where data is actually stored (on disk)
πΉ Logical Level β How Oracle organizes and manages that storage
Letβs look at each in detail β¬οΈ
ποΈ πΈ Physical Storage Options
Oracle can store data files using three main mechanisms:
- File System
β€ Traditional OS-based file structure
β€ Most Oracle DBs use this by default - Cluster File System
β€ Used in Oracle RAC (Real Application Clusters)
β€ Makes shared storage look like a single file system
β€ Multiple servers can access the same data - Oracle ASM (Automatic Storage Management)
β€ Oracle-managed storage
β€ Provides performance + reliability
β€ Reduces manual storage management
π Data files = The actual files that store your tables, indexes, etc.
π§ πΉ Logical Storage Structures (Inside Oracle)
Layer | Description |
---|---|
Tablespace | A logical container for data. Can hold multiple segments. Each PDB has its own set of tablespaces. |
Segment | Set of extents used by a schema object (like a table or index). One object = one segment. |
Extent | Set of contiguous data blocks. More extents are added as needed. |
Data Block | Smallest unit of logical storage. Usually 2KB, 4KB, 8KB, etc. Stored in data files. |
π Flow of Storage:
Tablespace β Segment β Extent β Data Block β Data File
π¦ Tablespaces in Detail
β
USERS tablespace
β€ Default location for user data
β
Custom Tablespaces
β€ Can be created for separating system data, app-specific data, etc.
π One tablespace = many data files
π One data file = belongs to one tablespace only
π οΈ DBA Tip of the Day
Understanding how Oracle organizes storage helps you optimize performance and space usage.
When things go wrong β like fragmentation or storage alerts β this is where you start debugging.