Search notes:

Oracle: Process

Show processes

With SQL

The current processes can be queried from v$process.

On the Command line

On a Unix command line, the Oracle Processes can be listed with something like
ps -eaf | grep ora

Foreground and background processes

While background processes do the work for Oracle itself, server processes (aka foreground processes) do the work for clients (such as executing SQL statements).

Processes with multiple threads

select
   count(*) over (partition by prc.spid) cnt_same_spid,
   prc.spid,
   prc.stid,
   prc.pname,
   prc.sosid,
   prc.execution_type
from
   v$process prc
order by
   cnt_same_spid desc;
--
-- CNT_SAME_SPID SPID                     STID                     PNAME SOSID                    EXECUTION_TYPE      
-- ------------- ------------------------ ------------------------ ----- ------------------------ --------------------
--             4 127                      127                      SCMN  127_127                  THREAD              
--             4 127                      135                      BG00  127_135                  THREAD              
--             4 127                      138                      BG00  127_138                  THREAD              
--             4 127                      140                      BG00  127_140                  THREAD              
--             4 139                      139                      SCMN  139_139                  THREAD              
--             4 139                      142                      BG01  139_142                  THREAD              
--             4 139                      143                      BG01  139_143                  THREAD              
--             4 139                      141                      BG01  139_141                  THREAD              
--             … …                        …                        …     …                        …
OS process 127 has 4 threads.
In a shell:
$ ps p 127 H o uid,pid,lwp,cmd
  UID     PID     LWP CMD
54321     127     127 ora_bg00_O21DB1
54321     127     135 ora_bg00_O21DB1
54321     127     138 ora_bg00_O21DB1
54321     127     140 ora_bg00_O21DB1

See also

A Program Global Area (PGA) is created for each server and background process.
Resources that are shared among processes are protected by latches from being corrupted.
Oracle internals: process (Windows)
Each process writes some information into a trace file.
The number of processes that were active during the last three seconds can be quried from v$pgastat:
select value from v$pgastat where name = 'process count';
When a session process dies, the client is notified with the error message ORA-03113: end-of-file on communication channel

Index