A database schema is a logical container for data structures, called schema objects. Each Oracle Database user account owns a single schema, which has the same name as the user.
Note: The database also stores other types of objects that are not contained in a schema. These objects include database user account, roles, contexts, and dictionary objects.
Schema objects that are allocated physical space, like tables and indexes, are stored in data files. At the logical level, the database allocates data across the data files with tablespaces. There is no relationship between schemas and tablespaces: a tablespace can contain objects from different schemas, and the objects for a schema can be contained in different tablespaces.
Schemas include the following main types of objects:
- Tables store data in rows. Tables are the most important schema objects in a relational database.
- Indexes contain an entry for each indexed row of the table or table cluster and provide direct, fast access to rows.
- Partitions are pieces of large tables and indexes. Each partition has its own name and may optionally have its own storage characteristics.
- Views are customized presentations of data in one or more tables or other views. You can think of them as stored queries. Views do not actually contain data.
- Sequences can be shared by multiple users to generate integers. Typically, you use sequences to generate primary key values.
- Dimensions define parent-child relationships between pairs of column sets, where all the columns of a column set must come from the same table. However, columns in one column set (called a level) can come from a different table than columns in another set. You might use dimensions to categorize data such as customers, products, and time.
- Synonyms are aliases for other schema objects. Because a synonym is simply an alias, it requires no storage other than its definition in the data dictionary.
- PL/SQL is the Oracle procedural extension of SQL. A PL/SQL subprogram is a named PL/SQL block that you can invoke with a set of parameters. A PL/SQL package groups logically related PL/SQL types, variables, and subprograms.