Oracle on linux process
This chapter discusses the processes in an Oracle database.
- Introduction to Processes
A process is a mechanism in an operating system that can run a series of steps. - Overview of Client Processes
When a user runs an application such as a Pro*C program or SQL*Plus, the operating system creates a client process (sometimes called a user process ) to run the user application. The client application has Oracle Database libraries linked into it that provide the APIs required to communicate with the database. - Overview of Server Processes
Oracle Database creates server processes to handle the requests of client processes connected to the instance. A client process always communicates with a database through a separate server process. - Overview of Background Processes
Background processes are additional processes used by a multiprocess Oracle database. The background processes perform maintenance tasks required to operate the database and to maximize performance for multiple users.
Introduction to Processes
A process is a mechanism in an operating system that can run a series of steps.
The process execution architecture depends on the operating system. For example, on Windows an Oracle background process is a thread of execution within a process. On Linux and UNIX, an Oracle process is either an operating system process or a thread within an operating system process.
Processes run code modules. All connected Oracle Database users must run the following modules to access a database instance :
- Application or Oracle Database utility A database user runs a database application, such as a precompiler program or a database tool such as SQL*Plus, that issues SQL statements to a database.
- Oracle database code Each user has Oracle database code executing on their behalf that interprets and processes the application’s SQL statements.
A process normally runs in its own private memory area. Most processes can periodically write to an associated trace file.
- Types of Processes
A database instance contains or interacts with multiple processes. - Multiprocess and Multithreaded Oracle Database Systems
Multiprocess Oracle Database (also called multiuser Oracle Database) uses several processes to run different parts of the Oracle Database code and additional Oracle processes for the users—either one process for each connected user or one or more processes shared by multiple users.
Types of Processes
A database instance contains or interacts with multiple processes.
Processes are divided into the following types:
- A client process runs the application or Oracle tool code.
- An Oracle process is a unit of execution that runs the Oracle database code. In the multithreaded architecture, an Oracle process can be an operating system process or a thread within an operating system process. Oracle processes include the following subtypes:
- A background process starts with the database instance and perform maintenance tasks such as performing instance recovery , cleaning up processes, writing redo buffers to disk, and so on.
- A server process performs work based on a client request. For example, these processes parse SQL queries, place them in the shared pool , create and execute a query plan for each query , and read buffers from the database buffer cache or from disk.
Note: Server processes, and the process memory allocated in these processes, run in the database instance. The instance continues to function when server processes terminate.
The process structure varies depending on the operating system and the choice of Oracle Database options. For example, you can configure the code for connected users for dedicated server or shared server connections. In a shared server architecture, each server process that runs database code can serve multiple client processes.
Figure 18-1 shows a system global area (SGA) and background processes using dedicated server connections. For each user connection, a client process runs the application. This client process that is different from the dedicated server process that runs the database code. Each client process is associated with its own server process, which has its own program global area (PGA) .
Figure 18-1 Oracle Processes and the SGA
- «Dedicated Server Architecture» and «Shared Server Architecture»
- Your Oracle Database operating system-specific documentation for more details on configuration choices
- Oracle Database Reference to learn about the V$PROCESS view
Multiprocess and Multithreaded Oracle Database Systems
Multiprocess Oracle Database (also called multiuser Oracle Database) uses several processes to run different parts of the Oracle Database code and additional Oracle processes for the users—either one process for each connected user or one or more processes shared by multiple users.
Most databases are multiuser because a primary advantage of a database is managing data needed by multiple users simultaneously. Each process in a database instance performs a specific job. By dividing the work of the database and applications into several processes, multiple users and applications can connect to an instance simultaneously while the system gives good performance.
In releases earlier than Oracle Database 12c , Oracle processes did not run as threads on UNIX and Linux systems. Starting in Oracle Database 12c , the multithreaded Oracle Database model enables Oracle processes to execute as operating system threads in separate address spaces. When Oracle Database is installed, the database runs in process mode. You must set the THREADED_EXECUTION initialization parameter to TRUE to run the database in threaded mode. In threaded mode, some background processes on UNIX and Linux run as processes (with each process containing one thread), whereas the remaining Oracle processes run as threads within processes.
In a database running in threaded mode, PMON and DBW might run as operating system processes, whereas LGWR and CMON might run as threads within a single process. Two foreground processes and a parallel execution (PX) server process might run as threads in a second operating system process. A third operating system process might contain multiple foreground threads. Thus, «Oracle process» does not always mean «operating system process.»
When the THREADED_EXECUTION initialization parameter is set to TRUE , operating system authentication is not supported.
Example 18-1 Viewing Oracle Process Metadata
The V$PROCESS view contains one row for each Oracle process connected to a database instance. For example, you can run the following query in SQL*Plus to get the operating system process ID and operating system thread ID for each process:
COL SPID FORMAT a8 COL STID FORMAT a8 SELECT SPID, STID, PROGRAM FROM V$PROCESS ORDER BY SPID;
The query yields the following partial sample output:
SPID STID PROGRAM ----- ----- --------------------------- 7190 7190 oracle@samplehost (PMON) 7192 7192 oracle@samplehost (PSP0) 7194 7194 oracle@samplehost (VKTM) 7198 7198 oracle@samplehost (SCMN) 7198 7200 oracle@samplehost (GEN0) 7202 7202 oracle@samplehost (SCMN) 7202 7204 oracle@samplehost (DIAG) 7198 7205 oracle@samplehost (DBRM) 7202 7206 oracle@samplehost (DIA0) . . .
- Oracle Database Performance Tuning Guide to learn how to use the V$PROCESS view
- Oracle Database Reference to learn about the THREADED_EXECUTION initialization parameter