Active running Queries?

Database

Active running Queries?

All,

Is there a script where i can pull all the active users along with the queries they are running? I know that we can view this information from Teradata manager but is there any script which does the same?

Thanks in Advance!!!

5 REPLIES

Re: Active running Queries?

I dont know about a script,but I regularly use viewpoint for active users,

I use the query on DBQlogtbl :

SELECT *
FROM DBC.DBQLogTbl
WHERE
USERNAME = 'USER'
ORDER BY
COLLECTTIMESTAMP DESC

cheers

KS

N/A

Re: Active running Queries?

You can not get the queries but the username and a lot of other information for ACTIVE users is available from DBC.SESSIONIFNO.

DBQL only shows stats for the queries that have finished processing, not the ACTIVE ones.

Cheers,

Re: Active running Queries?

Thanks!! Thought it might be somewhere in the DBC database.

N/A

Re: Active running Queries?

All the information returned in PMon/TD Manager is also available using the PMON Open Api functions found in SysLib:

SELECT * FROM TABLE (MonitorSession(1,'*',0)) AS dt

You probably want to filter for some specific PEstate or AMPstate, e.g.

WHERE PEstate <> 'Idle' or AMPstate <> 'Idle'

More details are in the "Workload Management API: PM/API and Open API" manual.

Dieter

Teradata Employee

Re: Active running Queries?

Hi Dieter,

I try to run the query above

SELECT * FROM TABLE (MonitorSession(1,'*',0)) AS dt

on my TD 14.10 with dbc user. The result is

 *** Failure 7507 The UDF/XSP/UDM SYSLIB.MonitorSession could not be found

                Statement# 1, Info =0

 *** Total elapsed time was 1 second.

but if i run the query

show function syslib.MonitorSession;

I get the function definition!

why ?

thanks in advance,

regards,

Pietro.