The Database Query Log (DBQL) is a Teradata Database feature that provides a series of predefined tables that can store historical records of queries and their duration, performance, and target activity based on rules you specify.
DBQL is flexible enough to log information on the variety of SQL requests that run on Teradata Database, from short transactions to longer-running analysis and mining queries.
You can request that DBQL log particular query information or just a count of qualified queries. You can specify a hierarchy of rules that DBQL applies to sessions. This allows great flexibility in capturing the right amount of logging data for each use of the Teradata Database system. The rules may target:
Each rule may specify that the recording criteria be a mix of:
You can define rules, for instance, that tell the DBS to log the first 4,000 SQL characters of a query that runs during a session invoked by a specific user under a specific account if the query exceeds a specified time threshold.
To implement DBQL, you use simple SQL requests to control the starting and ending of the logging activity. These rules may be dynamically changed as needed to support management of the Teradata Database system.