The system does not automatically clear logs or the tables underlying views such as the AccessLogV, LogOnOffV, and Software_Event_LogV. Teradata recommends copying data from the DBC tables into a separate database, archiving the data (as desired), and then deleting information from the DBC tables. DBC objects to consider clearing include the following:
- Resource usage (ResUsage) tables that have logging enabled.
- DBQL logs, which include all DBQL tables that have logging enabled.
(The tables DBC.DBQLRuleTbl and DBC.DBQLRuleCountTbl are not part of the log maintenance list. These tables are automatically maintained by the Teradata SQL BEGIN/END QUERY LOGGING statements; an error is returned if you attempt to delete their contents.)
- DBC.SW_Event_Log
- QCD.DataDemographics. (If you use Query Capture Facility [QCF] with the SQL COLLECT DEMOGRAPHICS statement, you need to explicitly delete rows from this table, DataDemographics, in your user-defined QCD databases.)Entries in DataDemographics are deleted automatically when you use the INSERT EXPLAIN WITH STATISTICS AND DEMOGRAPHICS statement. For more information, see Query Capture Facility and COLLECT DEMOGRAPHICS .
INSERT EXPLAIN is only supported on the Block File System on the primary cluster. It is not available for the Object File System.
The security administrator must clear the logs associated with access logging and any other security-related views as needed. You can reduce log file sizes as follows:
- Use only DBC.ResUsageSpma instead of activating logging on multiple ResUsage tables. ResUsageSpma may be able to provide all the information you need.
- Use roles to manage privileges which help reduce the size of DBC.AccessRights. For other tips on reducing the size of the DBC.AccessRights table, see Housekeeping on an Ad Hoc Basis.
- Track only the information you need for DBQL. The DBQLogTbl may be able to provide all the information you need.
- Track only the information you need for accounting.
- Use active row filter mode, where possible, for ResUsage tables.
For example, to keep the DBC.Acctg table from growing too large, use only the ASE variables that report the level of information you need. Using &T or &I for ASE accounting may make the DBC.Acctg table large, but using &D or &L typically has less impact on disk space and may provide enough detail. See Account String Variable.