How to view Oracle database processes running on the Linux server?

Problem

You want to view processes currently running on the Oracle database server (Linux / Solaris).

Solution

To view process information, use the ps (process status) utility. If you type the ps command without any parameters, you see all processes that have been started by the user you’re currently logged on as:

 

$ ps

PID   TTY      TIME CMD

12620 pts/1    00:00:00 bash
14103 pts/1    00:00:00 ps

If you want to view all processes running on a box, use the -e and -f options to show every process in a full output format:

$ ps -ef

If many processes are running on a box, it is useful to pipe the output of ps to grep and display only a particular user or process name. For example, to determine which Oracle instances are running on the server, you can filter the output to display only Oracle system monitor (SMON) background processes executing. In this example, ps and grep are used to show any processes that contain the string smon (the grep -v grep removes grep from the output):

$ ps -ef | grep -i smon | grep -v grep

oracle    7994     1  0 Jan25 ?        00:01:43 ora_smon_TRG
oracle   28035     1  0 Feb23 ?        00:00:50 ora_smon_ORA12CR1

The first column indicates that oracle is the OS owner of the processes. The second column contains the process identifier. The fifth column shows that one Oracle instance was started on January 25th, and the other was started on February 23rd. The seventh column indicates that the TRG database SMON process has consumed 1 hour and 43 minutes of CPU time, and the ORA12CR1 database SMON process has consumed 50 minutes. The last column is the name of the process (and the target of the grep command). There are two databases running on this server, as evidenced by two Oracle SMON background processes.

 

How It Works

Every time you run a Linux/Solaris command, a process is automatically created for you. Each process is assigned a unique number called a process identifier (PID). DBAs use the ps utility for a couple of important reasons:

  • Checking on background processes
  • Identifying hung or runaway processes that need to be killed
  • Troubleshooting performance issues

When there are database connectivity issues, the ps command is useful to quickly identify whether a required database background processes is running. To list all processes for a specific user, use the -u (user) option and specify a username. This example lists all processes running under the oracle user with a full listing of the output:

$ ps -fu oracle

Here’s a snippet of the output:

UID       PID   PPID  C  STIME TTY     TIME     CMD

oracle    7964     1  0  Jan25 ?       00:03:54 ora_pmon_TRG
oracle    7966     1  0  Jan25 ?       00:11:35 ora_psp0_TRG
oracle    7968     1  0  Jan25 ?       08:55:51 ora_vktm_TRG
oracle    7972     1  0  Jan25 ?       00:02:23 ora_gen0_TRG
oracle    7974     1  0  Jan25 ?       00:01:41 ora_mman_TRG
...

When you diagnose database performance issues, it can sometimes be useful to get an overall count of the number of Oracle processes running on a server. Obtaining the overall count of Oracle processes is especially useful when trying to determine whether you have some sort of runaway process that is unnecessarily spawning SQL connections or parallel processes. This example pipes the output of ps to the wc (word count) command. The -l switch instructs wc to count the number of lines in the output:

$ ps -fu oracle | wc -l

84

This output indicates there are 84 Oracle processes running, which is within the normal range for a server running a database. Although there is no black-and-white rule of thumb to tell you how many processes should be running, if the process count is into the hundreds per database, you should investigate what program is starting the processes and determine whether it is normal for that database and application.

Вас заинтересует / Intresting for you:

How to use RMAN for Stop/Start...
How to use RMAN for Stop/Start... 1923 views Андрей Волков Mon, 31 Jan 2022, 17:35:05
RMAN: Backing UP Oracle Databa...
RMAN: Backing UP Oracle Databa... 927 views Андрей Волков Wed, 29 Sep 2021, 18:27:51
What Does Java Mean to an Orac...
What Does Java Mean to an Orac... 3205 views Александров Попков Tue, 27 Feb 2018, 18:52:19
Why Learn More About Oracle SQ...
Why Learn More About Oracle SQ... 1347 views Виктор Thu, 16 Jul 2020, 17:59:54
Comments (0)
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Suggested Locations