SQL that shows current queries

Database
Enthusiast

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.

4 REPLIES
Senior Apprentice

Re: SQL that shows current queries

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';
Enthusiast

Re: SQL that shows current queries

Thank you,

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

Senior Apprentice

Re: SQL that shows current queries

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

Enthusiast

Re: SQL that shows current queries

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