BEGIN/REPLACE/END QUERY LOGGING Statements - Analytics Database - Teradata Vantage

Database Administration

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-10-04
dita:mapPath
pgf1628096104492.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
ujp1472240543947
lifecycle
latest
Product Category
Teradata Vantageā„¢

The purpose of each of the Teradata SQL DDL statements used to enable and disable DBQL logging is described in the following table.

Statement Purpose
BEGIN QUERY LOGGING When submitted by a user with EXECUTE privilege on DBQLAccessMacro, this statement enables logging for the named users, accounts, and applications triplet.
Log only a maximum of:
  • 100 users
  • One user with 100 accounts
  • 100 applications

per statement. If logging is to be enabled for more than 100 users, use blocks of BEGIN QUERY LOGGING statements with 100 users each. For active sessions, logging begins when Vantage receives the next query.

You can also enable a rule to make sure no logging takes place for a user, account, or application name.

For more information, see Logging Scenarios.

REPLACE QUERY LOGGING When submitted by a user with EXECUTE privilege on DBQLAccessMacro, this statement enables logging and deletes the existing rule in the DBC.DBQLRuleTbl table if one matches the users, accounts, applications triplet, and then creates a new rule. If no rule exists, the new rule is added to the DBC.DBQLRuleTbl table.
END QUERY LOGGING When submitted by a user with EXECUTE privilege on DBQLAccessMacro, this statement stops logging for the named users, accounts, or applications. Each END QUERY LOGGING statement should list fewer than 100 users/ 100 accounts for one user/ 100 applications. DBQL calls a routine that commits the data and flushes all the DBQL caches.

Each time you issue an END QUERY LOGGING statement, the system will flush all the rules cache and will flush the DBQL data tables.

You can also flush the DBQL cache using other methods. See Options for Flushing the DBQL Cache.

For more information on END QUERY LOGGING, see Effects of Dynamically Enabling/Replacing/Disabling Logging on Current Rules.

Every BEGIN QUERY LOGGING statement you enable must be disabled using the proper END QUERY LOGGING statement syntax. For example, if you submit:

BEGIN QUERY LOGGING WITH SQL ON user1 ACCOUNT='Marketing';

you must use the following syntax to end logging for that user:

END QUERY LOGGING ON user1 ACCOUNT='Marketing';

If you list more than one account, use parentheses. For example, ACCOUNT= ('Marketing', 'Finance').

For statement syntax, see Teradata Vantageā„¢ - SQL Data Definition Language Syntax and Examples, B035-1144. To enable other users to submit these statements, see Granting DBQL Administrative Privileges to Other Users.