Schemas and Schema Objects

Article Summary

How Oracle Organizes Your Data Structures 🧠 What Is a Schema?A schema is a logical container that holds data structures called schema objects. πŸ“‚ Schemas vs Tablespaces πŸ“¦ Main Types of Schema Objects Object Type What It Does Tables Store data in rows. The fundamental object in a relational database. Indexes Provide fast access to […]

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.

Was this helpful?