SHOW QUERY LOGGING Usage Notes - 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

Alternative Method for Listing Query Logging Rules

You can also determine the query logging rules stored in DBC.DBQLRuleTbl by submitting the following SELECT request against the DBQLRulesV view:

SELECT *
FROM DBC.DBQLRulesV;

Rules Hierarchy for SHOW QUERY LOGGING

SHOW QUERY LOGGING searches the rules cache and DBC.LogRuleTbl for a match in the following order:

Order in Hierarchy Type of Rule
1 A rule based on an application name.
2 A rule for this user and account.
3 A rule for this user or database and any account.
4 A rule for all users with this account.
5 A rule for all users, databases, and any account.

Vantage puts logging rules of the same type in creation order.

Vantage uses the following criteria to determine how to match SHOW QUERY LOGGING requests with the rules in the rules cache and DBC.LogRuleTbl. These criteria allow for conditions where the request does not match any specific rules in the rules cache or DBC.LogRuleTbl.

Specification Rule for Which SHOW QUERY LOGGING Searches
Application name Matching application name rule.
Single user or database name and account name:

{ user_name | database_name} andaccount_name

Matching rule from following, searching in this order:
  1. user_name:account_name
  2. { user_name | database_name}:ALL account names
  3. ALL user names:account_name
  4. ALL user and database names:ALL account names
Single user or database name, without account name:

{ user_name | database_name}

Matching rule from following, searching in this order:
  1. { user_name | database_name}:ALL account names
  2. ALL user and database names:ALL account names
ALL account_name Matching rule from following, searching in this order:
  1. ALL user names:account_name
  2. ALL user names:ALL account names
ALL Matching rule for ALL user names:ALL account names.