Review Rules | Teradata Vantage - Reviewing Rules - Advanced SQL Engine - Teradata Database

Database Administration

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
rgu1556127906220.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1093
lifecycle
previous
Product Category
Teradata Vantage™
You can review DBQL rules one of two ways:
  • Use the SHOW QUERY LOGGING statement to determine which rule would be used for a specified user/account/application. For example:
    SHOW QUERY LOGGING ON marketinguser;
  • Use the DBC.DBQLRules[V] view as a window into the contents of the DBC.RuleTbl which stores all DBQL rules in the system.

The following table describes what kind of rules the system checks for depending on the SHOW QUERY LOGGING statement you submit. If you only list a user name or an account string, the SHOW QUERY LOGGING statement shows the Best Fit Rule.

Only a user with EXECUTE privilege on DBC.DBQLAccessMacro can execute the SHOW QUERY LOGGING statement.
IF you submit a SHOW QUERY LOGGING statement for… THEN the system will show…
ALL the first rule in the hierarchy that applies, looking only at all/all accounts
user1 acct1 the first rule in the hierarchy that applies, looking at:
  • user1/account1
  • user1/all accounts
  • all/account1
  • all/all accounts
user2 the first rule in the hierarchy that applies, looking only at:
  • user2/all accounts
  • all/all accounts
all acct3 the rule hierarchy (in hierarchy order) that would apply for any user that logged on under acct 3. The system will look only at:
  • all/account3
  • all/all accounts
APPLNAME='xxx' APPLNAME='xxx' which is the only APPLNAME rule that applies.

The DBC.DBQLRules[V] view provides a window into the contents of the DBQLRuleTbl table and shows which rules would be applied by the system. Only a user with SELECT privilege on DBC.DBQLRules[V] can access the view. For Teradata systems configured with Teradata Secure Zones, access to some Data Dictionary views is constrained by zone. DBQLRules[V] is constrained by zone. For more information, see Teradata Vantage™ - Data Dictionary, B035-1092.

A SELECT on the DBQLRules[V] view displays the rules currently in effect. You can qualify the response by user name, or account string (if it exists), or both. For example:

SELECT * FROM DBC.DBQLRULESV WHERE ACCOUNTSTRING='$L00Test&D&H';