COMPONENTS OF ORACLE DATABASE ARCHITECTURE
USER PROCESS : It is the process which places request from client side and will be created when user starts any application.
SERVER PROCESS : It is the process which will do work on behalf of user process on server side.
PRIVATE GLOBAL AREA (PGA)
- It is the memory area allocated to server process to perform execution of the SQL statement & to store session information.
- The size of memory allocated will be defined using PGA_AGGREGATE_TARGET
- Before 9i, PGA is configured using
- HASH_AREA_SIZE etc
- Sorting will takes place in PGA if the data is small in size. This is called as in-memory sort.
- If the data size is larger than sort are size of PGA, Oracle will use both PGA and TEMP table space which needs no.of I/O’s and automatically database performance will get degraded.
ORACLE INSTANCE : It is a way through which users will access / modify data in the database. It is a combination of memory structures and background processes.
SHARED GLOBAL AREA (SGA) : It is the memory area which contains several memory caches helpful in reading and writing data.
- Shared pool contains following components
- Library cache – it contains shared SQL & PL/SQL statements.
- Data dictionary cache – it contains dictionary information in the form of rows, hence also called as row cache.
- Size of shared pool is defined using SHARED_POOL_SIZE.
DATABASE BUFFER CACHE
- It is the memory area where a copy of the data is placed in LRU list.
- The status of block in DBC will be any of the following status
- UNUSED – block which is never used
- FREE – block which is used already but currently it is free
- PINNED – block currently in use
- DIRTY – block which got modified
- DBC contains LRU list and WRITE list which helps in splitting modified blocks with other blocks.
- Size of DBC is defined using DB_CACHE_SIZE or DB_BLOCK_BUFFERS.
LOG BUFFER CACHE : It is the memory area where a copy of redo entries are maintained and size is defined by LOG_BUFFER.
Note: LBC should be allotted with smallest size than any other memory component in SGA.
- Large pool will be used efficiently at the time of RMAN backup.
- Large pool can dedicate some of its memory to shared pool and gets back whenever shared pool is observing less free space.
- Size is defined using LARGE_POOL_SIZE.
JAVA POOL : It is memory area used to run java executables (like JDBC driver) and size is defined using JAVA_POOL_SIZE.
- It is the memory area used when replicating a database using oracle streams.
- This parameter is introduced in 10g and can be defined using STREAM_POOL_SIZE.
- If stream pool is not defined and streams are used, then 10% of memory from shared pool will be used. This may affect the database performance.
SMONn : It is the background process responsible for following actions
- Instance recovery – this will be done in following phases
- Roll forward – compares the SCN between redo log files and data files header and will make sure committed data is written to data files.
- Opens the database for user access.
- Rollbacks uncommitted transactions with the help of undo table space.
- It will coalesce the table spaces which are defined as automatic segment space management.
- It will release the temporary segments occupied by the transactions when they are completed (a more detailed post available @ http://pavandba.wordpress.com/2010/04/20/how-temporary-tablespace-works/ )
The below diagram’s will explain SMONn instance recovery in detail
- We know that LGWR wiill write redo entries into redo log files. But if we have more and more redo entries generated (for huge transactions), redo log file size increases and even terabytes of storage is not sufficient.
- To overcome this Oracle designed its architecture so that LGWR will write into 2 or more redo log files in a cyclic order (shown in the below diagram)
- When doing this, certain events will trigger out which are listed as below.
LGWR moving from one redo log file to another is called LOG SWITCH. At the time of log switch, following actions will take place
- Checkpoint event will occur – this tells that committed data should be made permanent to data files. (Eg: Its just like automatic saving of email when composing in gmail)
- CKPT process will update the latest SCN to data file header and control files by taking the info from redo log files.
- DBWRn will write the corresponding dirty blocks from write list to data files.
- ARCHn process will generate archives (copy of online redo log files) only if database is in archive log mode.
Note: Checkpoint event not only occurs at log switch. It can occur at repeated interval and this is decided by a parameter LOG_CHECKPOINT_INTERVAL (till 8i) and FAST_START_MTTR_TARGET (from 9i)