Previous Table of Contents Next


Part III
Oracle8 Components and Objects

In This Part
•  Oracle Processes
•  Oracle Memory Areas
•  Oracle Files
•  Oracle Database Objects
•  Oracle System and Object Privileges
•  Roles and Grants
•  Object-Oriented Extensions in Oracle8
•  Replication
•  Query and Transaction Processing
•  Supplied PL/SQL Packages

Chapter 9
Oracle Processes

by Joe Greene

In This Chapter
•  Map of the Oracle Processes
•  The Main Oracle Processes
•  Optional Processes

This chapter covers the processes associated with an Oracle database instance. Chapter 2, “Oracle Database Architecture,” introduced the three main components in the Oracle architecture (files, processes, and memory areas). This chapter covers processes in more detail. Its goal is to help you sufficiently understand this component of the Oracle architecture to be prepared for the tuning and administration discussions in future chapters.

Map of the Oracle Processes

Since it may have been a while since you read Chapter 2, let me present a brief map that will guide you through the discussion of the Oracle processes. I use the term process to describe any one of the operating system programs (threads, jobs, and so on, depending on your operating system’s terminology) that are executed to complete functions within the Oracle database management system.

For purposes of my discussion, I will group these Oracle processes into two categories—main and optional. The main processes are those associated with the minimal functions of the Oracle database. The optional processes are those you would start to improve performance, or those that have several alternatives from which you can choose (dedicated server processes or the multi-threaded server, for an example). The key here is that if any of the main processes are not present on a system (when you issue the ps command under UNIX, for example), your database is not operational. If an optional process is not present, it indicates that you chose not to start that optional process or that no one needs it at the current moment (as in the case of dedicated server processes that are only started when a user is connected to the database instance).

The Main Oracle Processes

The following are the main processes associated with an Oracle instance. If any one of them dies, the others will detect this problem and shut themselves down and the database instance. The four main processes are

  System Monitor (SMON)
  Process Monitor (PMON)
  Database Writer (DBWR)
  Log Writer (LGWR)

Figure 9.1 shows where these processes fit in the Oracle architecture. These are the key processes that service the data files and memory areas associated with an Oracle database instance. If your database had no connectivity to users to the outside world, you could still execute functions within the database using these processes (stored procedures running on a routine basis). Of course, such a database would be of little use to the world.


Figure 9.1  Main Oracle Processes.

These four main processes, combined with the memory areas, are what Oracle refers to as an Oracle instance. These four main processes can be connected to a number of different databases if needed. When these processes are started they derive parameters from one or more initialization files. You can use different initialization files to start the same database. This allows you to adjust performance characteristics for special functions such as bulk data loads.

To keep track of the various processes, Oracle uses the system identifier (SID), which is the key to connecting to a given instance. When the Oracle processes are started, they contain the SID as part of the process name for ease of identification. This parameter is also used by local connections, SQL*Net and Net8, to route a given request or transaction from a user to the appropriate database instance.

System Monitor

The first) main Oracle process I want to discuss is the system monitor (SMON). The System Monitor’s assignment is to clean up after the Oracle instance itself. SMON is the janitor for the Oracle background processes and data files. The System Monitor is activated under three circumstances (see Figure 9.2). First, it checks at startup to see whether the instance needs to be recovered. If the instance was not shut down cleanly (shutdown normal), there may be transactions that were in process that need to be rolled back, temporary segments (places where Oracle stores data in the data files that are not permanently committed) for such things as sorts that were being used that need to be cleared out, and so forth.


Figure 9.2  The Oracle) System Monitor (SMON).

Second, the System Monitor is also designed to wake up routinely to see whether the Oracle instance needs some cleanup. SMON checks to see whether there are any temporary segments that are no longer needed and could be cleaned up. This is important to ensure that the maximum amount of temporary space is available for new requests. SMON also has the task of searching for ways to group together the free extents in the data files. If you ask for a 1M extent for a table, Oracle searches for a 1M contiguous extent (all the blocks are located next to one another for speed of access). You could find yourself in a situation where you have several megabytes of free space within a data file, but they are scattered in a large number of small chunks. SMON will try to move things around so you have larger free chunks of disk. However, its capabilities are limited, so you may occasionally have to compress extents within a tablespace.

One specialty function that System Monitor performs in parallel server environments is recovering an instance on a failed CPU or instance. This is actually quite a tricky operation in that you want to recover as much as possible about what activities, jobs, and so on were running on the CPU or instance at the time of failure. A number of features have been built-in to track the activity of a given parallel server instance) in the common database files and allow this recovery to take place.

The third case where System Monitor is activated is when it is called by other processes. For example, if the Database Writer detects the need for temporary segments, it can ask the System Monitor to see what it can do to free up some. This is an important feature to note with Oracle.


Previous Table of Contents Next
Используются технологии uCoz