Oracle Instance Architecture
Published by : Obay Salah , November 18, 2024
Without this part, we cannot access the database. It is a part of memory and a group of processors through which we can deal with and access the database. It consists of two main parts: -
- Memory Structure
- Background Processes
1- Memory Structure :
It is formed the moment the shared global area is opened, which is a portion of memory that is allocated to the operation of the Oracle database
It consists of two parts:-
- System Global Area (SGA).
- Program Global Area (PGA).
1- System Global Area (SGA) :
It is also called the shared global area. It is a part of memory allocated to information that is shared and available to all database users. It contains control information that is used by Oracle Server. It consists of virtual memory and is formed the moment the Instance is opened. The capacity of this memory is determined by the variable SGA_MAX_SIZE in the variables ( Parameter File) is an automatic memory that can be changed in size without closing the database
It consists of two sections:-
- Mandatory Memory
- Optional Memory
Mandatory Memory:
1- Shared Pool:
The size of this memory is controlled by the variable SHARED_POOL_SIZE and contains two parts:
1-Library Cache
2-Data Dictionary Cache
2-Database Buffer Cache : The size of this portion of memory is controlled by the variable DB_CACHE_SIZE.
SQL> ALTER SYSTEM SET DB_CACHE_SIZE = 69M;
Thus, the rest of the memory parts are modified in the same way as before.
3- Redo Log Buffer: The capacity of this part of memory is determined by the variable LOG_BUFFER.
Optional Memory:
1- Large Pool
2- Java Pool
3- Streams Pool
The size of the SGA can be known by looking in the Parameters file, or by writing the following command: -
SQL> SHOW SGA
Or by taking V$SGA
2- Program Global Area (PGA) :
Instance is a part of memory that is formed outside the Process Global Area and is also called
This part of the current memory consists of the Server Process and contains information related to the current server process
This part is not available to the rest of the Server Process and ends the moment the Server Process finishes creating it
It contains private information about the PGA in the Server Process database, i.e. for each caller
It contains three parts:-
1- Private SQL Area
2-Session Memory
3- SQL Work Area
2- Background Processes :
Before talking about the Background Processes, it is necessary to note that there are three types of Processes -
1- User process :- It starts working when the user requests to connect to the database through one of the database tools.
2- Server Process :- It is created the moment of connecting to the Instances after the Process User requests to connect to the database, the user is verified, so the moment of connection is the moment of creating the Process Server, which is between the Process User and the Instance, so each Process User in the database has its own Process Server, if we are working in a Server Dedicated environment, but if we are working in a Server Shared environment, the matter is a little different (we will discuss this later).
3- Background Processes: - This is the topic of our discussion in this paragraph, which is processors that work in the database so that they perform different tasks that start working the moment the Instance is opened, and they are divided into two sections
- Mandatory: It must be done when the instance is opened, as shown in the figure.
- Optional: Without it, the instance cannot work. This type works in some cases where the database is configured to work on certain options.
Mandatory Processes:
The database cannot work without these (Processes) which are:-
1- System Monitor (SMON) :
The maximum number of this Process in the database is 1, and it performs recovery (Recovery) if a problem occurs in the instance category, and if we are working on the (RAC (Real Application Clusters) environment, which is the operation of more than one instance in the single database, then the SMON in the healthy instance can perform Recovery for the other instance in which a problem occurred. The SMON can also clean up temporary Segments that have not been used for a long time.
2- Process Monitor (PMON) :
The maximum number of this Process in the database is 1, and it performs a Recovery for the Process if a problem occurs in the User Process, and it also cleans the Cache Database Buffer to make resources available in this part of memory for the Process, and it also records information about the Instance and Dispatcher Processes, and it also performs a test for the Dispatcher Processes and the Server Processes and performs a restart in case of a problem in them.
3- Log Writer (LGWR) :
The maximum number of this Process in the database is 1, and it records the data in the Red Log Buffer in the Redo Log Files, and it performs this process in the following cases:
1- At the moment of Commit
2- Every three seconds
3- When a third of the Redo Log Buffer is full
4- At the moment of DBWn operation, we will discuss this later
LGWR also writes the synchronization for Groups Log Redo. If a problem occurs in File log Redo, LGWR logs the error in the Log Alert file. Note: It should be noted that when Commit is performed, LGWR writes the installed and uninstalled data in the Buffer log Redo to the File log Redo. We benefit from the LGWR process in recovery if a problem occurs in the instance.
4- Database Writer (DBWn) :
The maximum number of this Process in the database is 20. It writes the data in the Cache Buffer Database to the Datafiles. The database can be configured to work with more than one DBWn as needed with a maximum number of 20. The variable that controls the number of this Process is .DB_WRITER_PROCESSES. This Process writes the data in the Cache Buffer Database to the Datafiles in the following cases: -
1- The moment of the Checkpoint occurrence, we will talk about that later.
2- Every three seconds.
3- The moment of the Log Switch occurrence, we will talk about it later.
4- The moment of closing the database.
5- The moment the Block reaches the specified value.
6- The moment the Buffer is full.
7- When doing the following:
* Tablespace Offline
* Tablespace Read Only
* Table Drop or Truncate
* Tablespace Begin Backup
5- Checkpoint Process (CKPT) :
The maximum number of this Process in the database is 1, and it ensures that all modifications made to the data in the Buffer have been written and fixed in the Datafiles, and then performs a full synchronization of all Datafiles and modifies the Datafiles headers. The Control files are modified at the last SCN, so that the database is fully synchronized and we ensure the possibility of recovering the database in the event of a problem. CKPT is performed in the following cases: -
1- The moment of the log switch
2- When the time specified in the variable LOG_CHECKPOINT_TIMEOUT reaches
3- When the number of BLOCKS specified in the variable LOG_CHECKPOINT_INTERVAL reaches
4- When the number of Buffer specified in the variable FAST_START_IO_TARGET reaches.
5- When executing the following commands :-
SQL> ALTER SYSTEM SWITCH LOGFILE; SQL> ALTER SYSTEM CHECKPOINT;
6- Recover (RECO) :
The maximum number of this Process in the database is 1, and it is used to handle the problem of suspended distributed processes due to a problem in the network or system. After a specific period, the Process tries to connect remotely and try to complete the process or undo it.
Optional Processes:
The database can work without these Processes due to the large number of these Processes. We will discuss the most important of them:-
1- (ARCn) Archiver :
The maximum number of this Process in the database is 10. It writes the Online Red Log File in the archive file (Archive Log Destination) after the Switch Log occurs. This Process works if the database is working in Archive Log Mode.
The number of this process is controlled by the variable LOG_ARCHIVE_MAX_PROCESSES
2- Recovery Writer(RVWR) :
This Process was introduced in Oracle version 10g. We benefit from this Process in the Flashback Database process, we will discuss this topic later.
3- Lock Monitor (LMON) .
4- Lock Manager DAEMON .
5- Lock Process (LCKn).
6- Block Server Process (BSPn)
7- Queue Monitor (QMNn)َ
8- Event Monitor (EMNn)
9- Shared Server Processes (Snnn)ٍ
10- Memory Manager (MMAN)
11- Parallel Execution slaves (Pnnn)
12- Trace Writer (TRWR)
13 -DMON
14- Dispatcher (Dnnn)
15- MMON
16- Wakeup Monitor Process (WMON)
17- Memory Monitor Light (MMON)
18- RBAL
19- ARBx
20- ASMB
21- Change Tracking Writer (CTWR)
22- Job Queue Monitoring (CJQn)
Comments
no comment yet!