How To Find Database Query From the Linux PID

 

In Oracle databases running on Linux, you can access the relevant session information from each user processes. In most cases, it is necessary to detect queries that use excessive resources in the operating system. For this determination, the process id of the corresponding process on linux can be matched with the session’s spid information in the database.

For example, as in the example below, a process number 32370 consumes too much cpu. It is necessary to determine the session to which this process belongs and to arrange the related query.

You can use the following query to find out which query is working on this process and what the session information is.

You can get the sql id information that is returned from the query and you can create a tunning task and improve the query if possible.

dbtut
Author: dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *