All Forums Database
Anonyme 16 posts Joined 12/14
24 Feb 2015
SQL that shows current queries

Good morning,
I would like to know if there is a SQL that shows all the queries that are currentely running. We used to have that SQL query in Oracle. I wonder if there is such a SQL in Teradata?
Thank you.

dnoeth 4628 posts Joined 11/04
24 Feb 2015

The easiest way to see all sessions is using Viewpoint's SessionMonitor.
It's using the Performance Monitor API which is also available as a set of UDFs in database syslib, e.g.

SELECT * FROM TABLE (MONITORSESSION(-1,'*',0)) AS ms
WHERE PEState  <> 'IDLE'
   OR AMPState <> 'IDLE';

 

Dieter

Anonyme 16 posts Joined 12/14
25 Feb 2015

Thank you,
However i need a query to show me all the current querries without using ViewPoint if its possible.
 

dnoeth 4628 posts Joined 11/04
25 Feb 2015

The query I posted is pure SQL, you can submit it from any client.
 

Dieter

hvganipineni 14 posts Joined 09/09
25 Feb 2015

You need to have an execute privilege on Monitorsession in syslib.
 

Harsha Ganipineni

You must sign in to leave a comment.