Is it possible to show other processes in progress on an Oracle database? Something like Sybases sp_who
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With