Schemas and Schema Objects

How Oracle Organizes Your Data Structures

🧠 What Is a Schema?
A schema is a logical container that holds data structures called schema objects.

  • Each Oracle user account owns one schema with the same name as the user.
  • Some database objects like users, roles, and dictionary objects are not part of any schema.

📂 Schemas vs Tablespaces

  • Schema objects that use physical space (like tables and indexes) are stored in data files.
  • Data files belong to tablespaces — logical storage units that hold data.
  • A tablespace can contain objects from multiple schemas.
  • A schema’s objects can reside in different tablespaces.
  • So, schemas and tablespaces are independent in how they organize data.

📦 Main Types of Schema Objects

Object TypeWhat It Does
TablesStore data in rows. The fundamental object in a relational database.
IndexesProvide fast access to rows by storing entries for each indexed row in a table or cluster.
PartitionsPieces of large tables or indexes, each with a name and optional storage settings.
ViewsCustomized “stored queries” that present data from one or more tables or views. No data stored.
SequencesGenerate unique integers, often used for primary keys, sharable by multiple users.
DimensionsDefine parent-child relationships between column sets (levels), often for categorizing data like customers or time.
SynonymsAliases for other schema objects. They use no extra storage beyond their dictionary entry.
PL/SQLOracle’s procedural SQL extension:
Subprograms are named blocks you call with parameters.
Packages group related PL/SQL code, variables, and types.

🛠️ DBA Tip of the Day
💡 Understand your schemas and schema objects well. Proper use of tables, indexes, and partitions can greatly improve database performance and manageability.

ADVERTISEMENT