16.20 - Example: Using DBC.QryLogEventHisV - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ Data Dictionary

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
zzu1512081120577.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval

The following is an example SQL statement that demonstrates how data can be extracted from the QryLogEventHisV view to give an explanation of the expression and events which caused a RED SysCon.

WITH RECURSIVE
 CausalAnalysis(EntryTS,
         EntryKind, EntryID, EntryName, Activity, ActivityId) AS
 (
  SELECT EntryTS,
      EntryKind, EntryID, EntryName, Activity, ActivityId
  FROM DBC.QryLogEventHisV
  WHERE EntryKind = 'SYSCON'
    AND EntryName = 'RED'
    AND Activity = 'ACTIVE'
 UNION ALL
  SELECT Cause.EntryTS,
      Cause.EntryKind,
      Cause.EntryID,
      Cause.EntryName,
      Cause.Activity,
      Cause.ActivityId
  FROM CausalAnalysis Condition INNER JOIN
     DBC.QryLogEventHisV Cause
     ON Condition.EntryKind = Cause.ActivityId AND
      Condition.EntryID = Cause.ActivityId
 )
SELECT *
FROM CausalAnalysis
ORDER BY 1 DESC;