DBC.AMPUsage View - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
The DBC.AMPUsage view provides information about the usage of each AMP for each user and account and also tracks the activities of any Console utilities. By user, account, or console utility session, DBC.AMPUsage stores information about the following:
  • CPU seconds consumed
  • Number of read/write (I/O) operations generated
AMPUsage reports logical I/Os explicitly requested by the database software, even if the requested segment is in cache and no physical I/O is performed.

DBC.AMPUsage uses the DBC.Acctg table to provide aggregated information by username, account ID, and AMP. Updates to the table are made periodically during each AMP step on each processor affected by the step. (This means if there are long-running steps, AMPUsage numbers show large increases periodically, instead of continuous incremental additions.) The data is collected and continually added to what is already in the table until you reset the counters to zero (see Purpose of System Accounting).

You can use the information provided by DBC.AMPUsage to do the following:
  • Bill an account for system resource use.
  • Determine what resources were used, by user and account string, after hours and during the day.
  • Summarize and archive the information, then zero the information out on a per shift, per day, or per week basis.
  • Determine which session caused reduced performance (in-depth analysis can be performed with DBQL data).
  • Derive capacity must plan for expansion.

DBC.AmpUsage does not record the activity of parsing the query, or of processing on a query basis.

You can use query logging to capture query text, step information, and elapsed processing time, and to differentiate queries submitted by SQL-generating products that do not provide a variety of user IDs and account ids in the logon string. For instructions and a description of the data capture options, see Tracking Query Behavior with Database Query Logging: Operational DBAs.

Example: Totaling CPU Time and I/O by User

This SQL statement requests totals for CPU time and I/O for user DBA01.

The totals are aggregates of all resources.

SELECT UserName (FORMAT 'X (16)')
,AccountName (FORMAT 'X (12)')
,SUM (CpuTime)
,SUM (DiskIO)
FROM DBC.AMPUsage
WHERE UserName = 'DBA01'
GROUP BY 1, 2
ORDER BY 3 DESC ;

For this example, AMPUsage returns the following rows:

UserName     AccountName        SUM (CpuTime)     SUM (DiskIO)
--------     --------------     -------------     ------------
DBA01        $M2$ABCD24053016       6,336.76          505,636
DBA01        $M2$EFGH24053016       4,387.14          303,733
DBA01        $M2$IJKL24053016       1.28              166
For detailed information on these and all the system views, see Using System Views.