15.00 - Query Bands and Teradata Viewpoint/Database Query Log - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1184-015K

Query Bands and Teradata Viewpoint/Database Query Log

Query band information is used by Teradata Viewpoint for workload classification and by the Database Query Log for logging. Teradata Database 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.

    Teradata Database 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” on page 849 and Database Administration for details.