Search This Blog

Difference between PMON and SMON in Oracle

In Oracle Database, both PMON (Process Monitor) and SMON (System Monitor) are background processes that play crucial roles in managing and maintaining the integrity of the database. Here's a brief overview of the differences between PMON and SMON:

1.    PMON (Process Monitor):

·     Responsibility:

·     PMON is responsible for process cleanup and process recovery.

·     It performs process recovery in the event of a process failure, ensuring that resources associated with failed processes are released and transactions are rolled back or recovered.

·     It monitors user processes and performs process recovery when a user process fails or is terminated abnormally.

·     It releases resources held by the failed processes and rolls back any uncommitted transactions associated with the failed processes.

 

·     Process Cleanup:

·     When a user process terminates abnormally or encounters an error, PMON cleans up the associated resources, such as rollback segments and locks, to prevent resource leaks.

·     PMON is involved in cleaning up the resources associated with dead or terminated sessions. This includes releasing locks held by those sessions and releasing memory and other resources.

·     Service Registration:

·     PMON is also responsible for registering the instance with the listener, allowing clients to connect to the database.

·     PMON is responsible for registering information about the database service with the listener so that clients can connect to the database.

2.    SMON (System Monitor):

·     Responsibility:

·     SMON is primarily responsible for instance recovery and coalescing free space in tablespaces.

·     It performs crash recovery when an instance crashes and needs to be recovered to a consistent state.

·     It coalesces free space in the database by merging adjacent free extents into larger, contiguous extents, improving space utilization.

·     Temporary Segment Cleanup:

·     SMON cleans up temporary segments that are no longer needed.

·     Temporary segments are created for sorting and other temporary operations. After the operation is complete, SMON frees up the associated temporary space.

·     Instance Recovery:

·     In the event of a database instance failure or crash, SMON performs instance recovery during the database startup to bring the database to a consistent state.

·     Coalescing Free Space:

·     SMON coalesces contiguous areas of free space in tablespaces, reducing fragmentation and improving space utilization.

·     Transaction Cleanup:

·     SMON performs transaction cleanup by cleaning up temporary segments and freeing resources associated with transactions that are no longer active.

3.    Differences:

·     Focus:

·     PMON primarily focuses on process-related tasks, such as process recovery and cleanup.

·     SMON primarily focuses on system-level tasks, such as instance recovery and space management.

·     Activities:

·     PMON is involved in cleaning up after user processes and ensuring a smooth termination.

·     SMON is involved in recovering the database after an instance failure and managing free space in tablespaces.

·     Triggering:

·     PMON is typically triggered when a user process fails or terminates abnormally.

·     SMON is triggered during database startup to perform instance recovery.

 

No comments:

Post a Comment

Featured Post

Oracle Architecture

  An Oracle Database consists of at least one database instance and one database. The database instance handles memory and...