Site icon IT Tutorial

Oracle Database Architecture -3 SMON, PMON, DBWR,CKPT and LGWR Processes

Hi,

I will continue to explain Oracle database architecture in this article. I’m adding the following image to be memorable. If you didn’t read the previous articles, I suggest you read these articles.

 

Read previous article before this.

Oracle Database Architecture -2 Buffer Cache, Redolog Buffer, Onlinelog and Archivelog

 

 

SMON (System Monitor): It is an important process responsible for recovering Oracle Instance. If this process does not work, the database is down.

This process ensures that the instance to open consistently, during the database opening using the online redo log files when the Oracle database is closed inconsistently. This process also allows the recovery of suddenly killed transactions.

We can see this process via the operating system as follows.

bash-4.1$ ps -ef | grep smon
oracle    9055     1  0 13:38 ?        00:00:00 ora_smon_TESTDB
oracle    9250  8803  0 14:24 pts/0    00:00:00 grep smon
bash-4.1$

 

When we kill this process through the operating system, the database will shut down suddenly as follows.

bash-4.1$ ps -ef | grep smon
oracle    9055     1  0 13:38 ?        00:00:00 ora_smon_TESTDB
oracle    9258  8803  0 14:28 pts/0    00:00:00 grep smon
bash-4.1$ kill -9 9055
bash-4.1$ ps -ef | grep smon
oracle    9260  8803  0 14:29 pts/0    00:00:00 grep smon
bash-4.1$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 4 14:29:08 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to an idle instance.
SQL>

 

 

PMON (Process Monitor): This process frees up system resources that are used by processes that have failed or are suddenly terminated, and will give back this resources to the server.

It also allows Oracle instance to communicate with the listener.

We can see this process on the operating system as follows.

 

bash-4.1$ ps -ef | grep pmon
oracle    9423     1  0 14:37 ?        00:00:00 ora_pmon_TESTDB
oracle    9559  8803  0 14:37 pts/0    00:00:00 grep pmon
bash-4.1$

RECO (Recoverer Process): This process enables the completion of unfinished operations.

DBWn (Database Writer): The DBW process is a process that shuttles between Datafiles and Database Buffer Cache. That is, when a transaction starts, if the corresponding blocks are not in the buffer cache, DBW move these blocks from the datafiles to the Buffer cache. In the same way, it writes the dirty blocks that should be written to the Datafiles to the Datafiles from the Buffer cache.

bash-4.1$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 4 13:39:44 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved. 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter db_writer_process

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_writer_processes                  integer     1
SQL>

 

These processes work when the following events occur, and the changing blocks in Buffer Cache are written to the datafiles.

The following code can be used to manually write the data in the buffer cache to the datafiles.

 

SQL> Alter system checkpoint;

LGWR (Log Writer Process): This process is a process that writes the data in the buffer memory to physical files like DBW process. This process runs between the Redo log buffer and the Online Redo log files. Writes transaction information in Redo log buffer to Online redo log files respectively. The LGWR process writes the data in the Redo log buffer to the Online Redo log files when the following conditions occur.

 

CKPT (Checkpoint Process): When this process is triggered, the Database Writer (DBW) process writes dirty blocks in the database buffer cache to datafiles. It also updates the header information of Datafiles.

If this process is triggered at very frequent intervals, the database will slow down because disk I / O will increase.

If it is rarely triggered, it will take some time to recover instance when the Oracle database instance crashes suddenly. Because changing blocks are not written to datafiles and the number of changing blocks is accumulated. Therefore, during the recovery process, the number of blocks to be written from the online redo log to the data files will be more.

 

Determining the frequency of triggering of this process is important for the above reasons.

 

ARCn ( archiver process ): This is a process that is activated when the database is in archive mode. This process copies a copy of the redo log file to the archive file during the log switch operation when the online redo log groups are full. Another task of this process is send Redo log files to the “disaster/standby” server in the disaster recovery scenario.

So, I am completing the article series of the Oracle database architecture with this article.

 

 

Do you want to learn Oracle Database for Beginners, then read the following articles.

https://ittutorial.org/oracle-database-19c-tutorials-for-beginners/

Exit mobile version