Posts Tagged ‘Database Sessions’

How to Tie OS-level PIDs to Oracle Database Sessions (for Apps too!)

By David Ashlock September 16th, 2008 at 5:22 pm
Posted in OracleOracle E-Business Suite
Tags:

About once a week, our team gets a request from the server admins to provide some information on why a database server is running slowly. This typically begins a painstaking process of finding the main processes on the OS side and tracing them back to database sessions (and possibly even to Oracle Apps Concurrent Requests).

As we all know, writing SQL to do this tie-back-when-the-issue-is-happening is not a good practice — there is always the chance to mis-type something or to forget a join and have the data come back as unusable for good decision-making. Not to mention that there is usually a time constraint involved when diagnosing high server load, etc.

We started fairly small with a solution to our problem and simply joined the v$process view to the v$session to get the OS process ID tied out to a database session. Once you have that information from v$session, you can start to going in other views such as v$sort_usage, v$sql, v$session_wait, v$transaction, and so on. Some of these additional views may have relevant information for your specific issue.

We had an additional issue in our case — the databases that sit on our servers run Oracle Applications, so simply tying to a database session provides only half of the picture. You also need to be able to pull information from the fnd_concurrent_requests table to be able to see if the OS process may be generated from a Concurrent Request within Oracle Apps.

Attached to this post (see bottom for link) is a general diagram that the team came up with for relating our tables together, taking RAC into consideration. (more…)