Query Bands and Teradata Viewpoint/Database Query Log - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
imq1591724555718.ditamap
dita:ditavalPath
imq1591724555718.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™

Query band information is used by Teradata Viewpoint for workload classification and by the Database Query Log for logging. Vantage logs query bands in DBC.DBQLogTbl, as explained by the following table.

IF you create … THEN the query band text contains …
no query band an empty string.
only a transaction query band the following string:

=T> transaction_queryband

where the transaction_queryband string element specifies the query band for the current transaction.

only a session query band the following string:

=S> session_queryband

where the session_queryband string element specifies the query band for the current session.

both a transaction query band and a session query band the following concatenated string:

=T> transaction_queryband =S> session_queryband

where:

  • transaction_queryband specifies the query band for the current transaction.
  • session_queryband specifies the query band for the current session.

For example, a combined session and transaction level query band might look like the following string:

=T> job=x1; =S> org=Finance;report=Fin123;

The state of a query band must be static once the query has been processed by those features; therefore, you cannot change a query band once its defining request has been dispatched.

When using Teradata Viewpoint, you can associate query band name:value pairs with filter rules and define them as workload classification attributes. In a trusted session, filter and throttle rules and workload classification are based on the trusted user. You can set a query band to create a filter rule or workload classification for a proxy user by doing any of the following.
  • Associate a query band name:value pair with a filter rule.
  • Set a query band name:value pair as part of the workload classification.
  • Specify PROXYUSER as the name in a name:value pair, for example,

    PROXYUSER=proxy_user_name

When Teradata Viewpoint compares rules and classification criteria to the query bands, it uses the first name:value pair found in the query bands in which the name in the name:value pair matches the name in the criteria to determine if it should use the rule or classification.

This enables Teradata Viewpoint to do the following things.
  • Restrict access to a database object based on the request query band.
  • Classify a request into a specific workload based on its query band.

If a query band specifies both a transaction query band and a session query band, and both have the same name, Teradata Viewpoint always uses the name:value pair in the transaction query band.

Vantage searches the query bands in the following order.

  1. Transaction query band
  2. Session query band

All comparisons are case insensitive.

You can specify a classification object to match query band name:value pairs. The definition contains the query band name with a values include or values exclude list.

See Function of Query Bands and Teradata Vantage™ - Database Administration, B035-1093 for details.