SQL Logging Statements | Database Administration | VantageCloud Lake - SQL Logging Statements - 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

When creating the necessary rules to enable SQL logging using DBQL, a rule correlates exactly to a specific SQL statement. For example, the following SQL statements show a BEGIN QUERY LOGGING statement with its corresponding END QUERY LOGGING statement.

BEGIN QUERY LOGGING WITH SQL ON ALL ACCOUNT='$M00MSIR&D&H';
   END QUERY LOGGING WITH SQL ON ALL ACCOUNT='$M00MSIR&D&H';

The implication is that the SQL used to create the rules must be retained so as to easily facilitate removing a rule.

For more information on account string format, see Account String Variable

All rules can be easily removed by the following command:

END QUERY LOGGING ON ALL RULES;
If you use the WITH option of the END QUERY LOGGING statement, you get the following message: "Deprecated option WITH is used and will soon be removed. Do not continue to use WITH option, refer to END QUERY LOGGING statement syntax."