Oracle Database is developed on the basis of relational database management system (RDBMS) It can store and retrieve the large amounts of data. It has both physical and logical structures which work independently of each other.
A schema is a user who logs into the DB with his own credentials. A schema / User will have access to database, and he will have his own tables, views, indexes, triggers, clusters, procedures, functions, packages, and DB links. He will also have access to other schema / user objects. In short, a schema is a session of DB where he will have his own DB objects. SYS and SYSTEM are default schemas. One can create their own schema and delete them too.
A tablespace can be considered as folders in windows. Tablespaces are used for logical data storage. That means when we create table or view in DB, the actual data will be stored in the memory location as datafiles. Each datafile will have data about one or more tables. But when we see this data in the DB, it will be represented in a tabular form. This tabular representation of data is known as logical representation of the data. This logical data will also be stored in logical storage areas known as tablespace. This is similar to folders or datafiles in memory. But this tablespace will be linked to the datafiles.
A tablespace can have multiple datafiles from same schema or different schema; it can have DB objects from multiple schemas. Similarly, one schema can have multiple table spaces. By default, DB creates “SYSTEM” tablespace. User can create any new tablespace in their schema. All details about tablespace and its schema will be available in data dictionary.
Control file is a small binary file required for a DB to start and operate successfully. It will be updated continuously as DB is used by the user. It will not be accessible by user; but it will be read and modified by DB alone. It contains useful informations for normal functioning of DB. The list of information that are available in control files are:
Data block is smallest unit of database space. It is at the finest granularity. All the data in tables are stored in data blocks. Each data block will have specific bytes allocated in the physical memory for data storage.
Extent is a logical storage space allocated for data storage. It is at next level of data blocks i.e.; it is made up of contiguous set of data blocks. It is used for storing specific type of information.
A segment is a collection of extents, used for storing specific data structure. It is allocated in the same tablespace.
Rollback segment is the one where roll back information about any DB transaction is stored. It will be used when any transaction has to be rolled back.
There are mainly four types of segments.
This is the memory area in SGA which is used to maintain the redo log entries. It is a circular buffer cache where entries made whenever there is DDL or DML changes in the database. This is useful to rebuild the database in case of any failure or crash. The recovery system of DB uses the entries in this buffer cache to recover the lost data changes.
Whenever user performs some changes to DB, they are copied to redo log buffer in SGA. These are stored in the contiguous memory locations in redo log buffer. This is the only buffer where entries are stored in contiguous memory locations. The background process LGWR – log writer is responsible for writing these entries in redo log buffer into online redo buffer in the disk or database.
Table Cluster is a collection of tables which share columns of those tables and store the column data in the same data block. When a table is clustered, single data block can contain data from different tables that are clustered.
For example, consider two tables EMPLOYEES and DEPARTMENTS are clustered. Then datas from both these tables are stored in the same data block and they share common column – DEPARTMENT_ID. This common column is known as known as cluster key column.