I am curious to run a SQL-query via a .Bat script to see the "current usage" of a database.
I currently run the query below via an ODBC connection in Teradata SQL Assistant. It gives me what I think is the current usage. But I would like to run from Command Line, via a Bat file instead.
/* Check Current Heavy Users Teradata SQL Assistant */
SELECT UserName
/*,AccountName */
,Sum (CPUTIME)
,Sum (DiskIO) / 1024 / 1024 AS DiskIO_MB
FROM DBC.AMPUsage
GROUP BY 1
ORDER BY 3 DESC
I want to be able to run the .Bat script to output the same result as the query would in SQL Assistant. This would give me a quick overview of the server capacity.