Oracle Architecture
Basically, these are two main components of ORACLE Database Architecture.
Oracle Architecture is an Object – Relational Database Management System, provides an open comprehensive & integrated approach to info. Management.
Oracle Features:
[amazon_link asins=’9351343707′ template=’ProductAd’ store=’encrypt0f-21′ marketplace=’IN’ link_id=’bd5c630f-7ae4-11e7-929f-bd83ceff8f58′]
- Client/Server ( Distributed Environment )
- Large Database and Space Management
- Many Concurrent database users
- High Availability
- Control Availability
- Portability / Compatibility / Convertibility
- Manage Security & Openess Industry Standard
Oracle Instance ( Combination of background process + memory buffers )
It consists of the Oracle processes & shared m/m to access info. in the database. The instance is made up of the user processes, Oracle Background Process & the shared m/m used by these processes.
SGA ( System Global Area )
Everytime the database is started the System Global Area (SGA) is allocated & Oracle background process is started.
SGA is an area of m/m used for database info. shared by database users. The SGA is allocated when the oracle instance starts and de-allocated when the oracle instance shuts down. Each oracle instance that starts has its own SGA.
The info. in SGA consists of following elements, each of which has a fixed size & created a instance at instance startup.
Oracle Structure:
Oracle Instance ( Combination of background process + memory buffers )
It consists of the oracle processes & shared m/m to access info. in the database. The instance is made up of the user processes, oracle background process & the shared m/m used by the processes.
Database Buffer Cache
This m/m structure is the cache especially for the data coming from the database. This buffer caches the blocks of data retrieved from the database.
ie. If the desired piece of data is found here, it is retrieved from this very area otherwise it is read from the database.
Redo Log Buffer
This stores redo entries or a log of changes made to the database. The redo log buffer are written to the redo log as quickly and efficiently as possible. Remember, that redo log is used for instance recovery in the event of the system failure.
The Shared Pool
This area of SGA that stored shared m/m structure such as shared SQL areas in the library cache and internal info. in the data dictionary. It is impossible because an insufficient amount of m/m allocated to the shared pool can cause performance degradation.
It consists of
Library Cache + Data Dict. Cache
Library Cache
Used to store shared SQL. If multiple app. issues the SQL statement, the shared SQL area can be accessed by each to reduce the amount of m/m needed & to reduce the processing time used for parsing & execution planning.
Data Dictionary Cache
Contains set of tables & view that Oracle uses as reference to the database. Data Dict. Contains
- User Info. ( Privileges )
- Integrity Constraints defined for table in database
- Names & datatypes of all columns in database tables
- Info. of space allocated & used for schema object
User Processes
Are the user connections to the RDBMS system. The user process manipulate the user I/P & communicates with the Oracle Server process through Oracle prog. interface. It is also used to display the info. requested by the user and if necessary can process this info. into more useful form.
Dedicated Server Processes : ( Shadow Processes )
These are processes perform by the Oracle for the users.
Communicate with the user & interacts with the Oracle to carry out users request.
ie If user process request a piece of data not already in the SGA, the shadow process is responsible for reading the block of data from data files into the SGA.
There can be one-to-one co-relation b/w user processes & shadow processes.
One shadow process can connect to multiple user processes. ( doing so it reduce utilization of system resources )
Large Pool
Optional area in SGA. It is used to relives the burden place on the shared pool. It is also used for I/O processes. The large pool size can be set by LARGE_POOL_SIZE parameter in init.ora initialization parameter file.
Java Pool
As its name, java pool is used for services parsing the java commands. Its size can be set by JAVA_POOL_SIZE parameter in init.ora initialization parameter file.
Background Processes
Another oracle processes used to perform various tasks in RDBMS sys. These tasks may vary from communicating with other Oracle instances & performing sys. maintenance and cleanup to writing dirty blocks to disks.
-
DBWR ( Database Writer )
The DBWR process writes database blocks from the database buffer cache in SGA to the actual datafiles on disk. An Oracle instance can have upto 10DBWR processes at a time.
-
LGWR ( Log Writer )
This background process is responsible for writing the redo info. from redo log buffer in SGA to all copies of current redo log file on disk. As long as the transaction is processed, its redo info. is stored in the redo log buffer in SGA. Once transaction is successfully completed ( commit ), its redo info. is permanently stored on the disk by LGWR process.
-
CKPT ( Checkpoint )
The Checkpoint responsible for signaling the DBWR process to perform a checkpoint and to update all the data files and control files for the database, to indicate the most recent checkpoint.
A checkpoint is an event in which all modified database buffers are written to DBWR. ( It is optional, if CKPT is not present, LGWR assumes these responsibilities .
-
ARCH ( Archiver )
Responsible for copying the online redo log files to archiver storage when they become full. ARCH is active only when the RDBMS is operated in ARCHIVE LOG mode. When a system is not operated in archive log mode, it might not possible to recover system after failure.
-
LKCn ( Parallel Server Lock )
Up to 10 LCK processes are used for inter instance locking when the Oracle parallel server option is used.
-
Dispatcher
When the multithreaded server option is used; atleast one dispatcher process is used for every communication protocol in use. Responsible for routing request from the user processes to a available shared server processes and back.
PMON ( Process Monitor )
Background process monitors the user processes accessing the database. If a user process terminates abnormally then PNOM cleans up the resources.
ie memory that were being used by the user-process and releases the locks held by the failed process. It is also responsible for starting any dispatcher process that might have failed.
SMON ( System Monitor )
Responsible for monitoring & maintaining the proper functioning of Oracle instance. It carries out many tasks, if required
ie cache recovery cleaning up adjacent pieces of free space in the data files by merging then into one piece & getting rid of space that is no longer needed.
RECO ( Recovery )
Used to clean transactions that were pending in distributed database. Responsible for commit or rollback the local portion of the dispute transaction.
Database Physical Structure
Structure that are not directly manipulated by Users.
-
Data Files
Corresponds with a tablespace. One data file can be used by one tablespace. ( 1 tablespace has more than 1 data file )
Contains all database data
The data of logical database structure such as tables & indexes is physically stored in data files.
One or more datafiles from a logical unit of database storage called tablespace.
These files are used to read, as needed during normal database operation and stored in the m/m cache of Oracle.
-
Control Process Files
Every oracle database has control file.
Contains the entries that specify the physical structure of the database.
Eg.
-
- Database name
-
- Name & Location of database files & redo log file
-
- Time Stamp of Database creation
Like redo, Oracle also allows control file to be multiplexed.
Every time Oracle instance started; its control file is used to identify the database & redo log file that must be opened for database operation proceed.
-
Redo Log File
Every oracle database have set of two or more redo log files. The primary function of redo log file is to record all changes made to the data. Failure time changes can be obtained from redo files and work is never lost. ( critical in protecting Database against failures )
Oracle allows a multiplexed redo log so that two or more copies of the redo log file can be maintained on different disks.