API Definition
REPLACE PROCEDURE TDStats.AuditTrail( IN jIn JSON(2000) CHARACTER SET UNICODE) DYNAMIC RESULT SETS 1
JSON Input Keys
| JSON Key | Data Type | Description |
|---|---|---|
| DatabaseName | VARCHAR(128) | Limit the audit trail to events that apply to a specified database. |
| TableName | VARCHAR(128) | Limit the audit trail to a specified table of DatabaseName. |
| EventType | VARCHAR(50) | Limit audit trail to a particular type of event. Valid values are:
|
| StartTime | TIMESTAMP(6) | Start time of the desired audit period. |
| EndTime | TIMESTAMP(6) | End time of the desired audit period. |
| ReturnTable | BOOLEAN | When true, results will be stored in a session level temporary table named AutoDBA_AuditTrail rather than being returned as a dynamic result. Default value is false. |
Dynamic SQL Result Columns
| Column Name | Data Type | Description |
|---|---|---|
| EventTimeStamp | TIMESTAMP(6) | Timestamp of when the event occurred. |
| EventType | VARCHAR(50) | Type of recorded event. Valid values are:
|
| DatabaseName | VARCHAR(128) | Database on which the event occurred. |
| TableName | VARCHAR(128) | Table on which the event occurred. |
| FieldNames | VARCHAR(10000) | Comma separated list of field names on which the event was applied. |
| StatsOrIndexId | INTEGER | Dictionary identifier of the relevant statistic or index. |
| SCOID | BIGINT | AutoStats assigned identifier of the relevant statistic. |
| DDLText | VARCHAR(10000) | SQL DDL text that was executed during the event. |
| StatsSubmitted | INTEGER | Number of individual statistics submitted within DDLText. |
| StatsCollected | INTEGER | Number of individual statistics collected (not skipped). |
| UtilityName | VARCHAR(128) | Name of bulk load utility. This field is relevant only for events of type BL. |
| UDIActivity | BIGINT | Number of rows inserted, updated, or deleted during bulk load. |
| ErrorText | VARCHAR(512) | Error (if any) from executing DDLText. |
| Description | VARCHAR(256) | Supporting evidence for the the action applied during the event. |
| TotalQueries | BIGINT | When EventType = 'M': Total number of queries expected to benefit from recommendation. |
| CardinalityEstimateErrors | BIGINT | When EventType = 'M': Number of relevant queries that had Optimizer cardinality estimation errors. |
| MissedSLGFrequency | BIGINT | When EventType = 'M': Number of relevant queries that missed their Service Level Goal (SLG). |
| AvgOptimizerImportance | VARCHAR(10) | When EventType = 'M': Optimizer assigned importance of the recommendation. |
| PlanCostMagnitude | INTEGER | When EventType = 'M': Average cost of relevant queries expressed as number of digits in cost. |