Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I show running processes in Oracle DB?

Tags:

process

oracle

Is it possible to show other processes in progress on an Oracle database? Something like Sybases sp_who

like image 551
Robert Brown Avatar asked Oct 14 '08 00:10

Robert Brown


People also ask

How can I see what processes are running in a database?

If you need to quickly view queries running for a long time, you can add sql. elapsed_time / 1000000 in the SELECT , plus constraint WHERE ... AND sql. elapsed_time IS NOT NULL , and finally ORDER BY sql.

How can I tell what Oracle processes are running on Windows?

Windows has own command to trace all running processes in the system. Using "tasklist" command Oracle DBA can able to trace all running processes in windows including oracle, sqlplus, exp, imp and others. Tasklist command is very closer to ps command.

How can I see what processes are running in SQL Developer?

You will see a running task in the Task Progress View by clicking on View -> Task Progress. Choose View . Then choose Task Progress . The view will appear in tab located in lower right corner.


1 Answers

I suspect you would just want to grab a few columns from V$SESSION and the SQL statement from V$SQL. Assuming you want to exclude the background processes that Oracle itself is running

SELECT sess.process, sess.status, sess.username, sess.schemaname, sql.sql_text   FROM v$session sess,        v$sql     sql  WHERE sql.sql_id(+) = sess.sql_id    AND sess.type     = 'USER' 

The outer join is to handle those sessions that aren't currently active, assuming you want those. You could also get the sql_fulltext column from V$SQL which will have the full SQL statement rather than the first 1000 characters, but that is a CLOB and so likely a bit more complicated to deal with.

Realistically, you probably want to look at everything that is available in V$SESSION because it's likely that you can get a lot more information than SP_WHO provides.

like image 105
Justin Cave Avatar answered Sep 18 '22 14:09

Justin Cave