kettle 6.1 日誌查詢

SELECT JB.ID_JOB,  ---做業ID
       JB.NAME,    ---做業名稱
       to_char(JB.DESCRIPTION) as JOB_DESCRIPTION , --做業描述

       case when jl.status='end' then
         '完成'
          when jl.status='running' then
          '運行中'
          when jl.status like 'stop%' then
           '中止'
         ELSE
           JL.STATUS
        END STATUS,    ---做業運行狀態
       JL.ERRORS AS JOB_ERRORS_NUMBER,   ---做業運行錯誤數
       JL.LOG_FIELD  AS JOB_LOG_COMMENT, ---做業日誌內容
       JL.STARTDATE  AS JOB_START_DATE,  ---做業運行開始時間
       JL.ENDDATE AS JOB_END_DATE,       ---做業運行結束時間
       JL.LOGDATE AS JOB_LOG_DATE        ---做業日誌記錄時間
  FROM R_JOB JB,ETL_JOB_LOG JL 
 WHERE JB.NAME= JL.JOBNAME(+)
 AND JB.ID_JOB  IN
 (SELECT J.ID_JOB FROM R_JOBENTRY J
  WHERE  J.ID_JOBENTRY_TYPE=22)
 ORDER BY JB.ID_DIRECTORY,JB.NAME,JL.LOGDATE
 ;
 
1.0查詢 主JOB 運行 日誌
SELECT JB.ID_JOB,  ---做業ID
       JB.NAME,
       SUBJ.ID_JOB,
       RY.NAME as SUB_JOB_NAME,    ---做業名稱
       to_char(JB.DESCRIPTION) as JOB_DESCRIPTION , --做業描述

       case when jl.status='end' then
         '完成'
          when jl.status='running' then
          '運行中'
          when jl.status like 'stop%' then
           '中止'
         ELSE
           JL.STATUS
        END STATUS,    ---做業運行狀態
       JL.ERRORS AS JOB_ERRORS_NUMBER,   ---做業運行錯誤數
       JL.LOG_FIELD  AS JOB_LOG_COMMENT, ---做業日誌內容
       JL.STARTDATE  AS JOB_START_DATE,  ---做業運行開始時間
       JL.ENDDATE AS JOB_END_DATE,       ---做業運行結束時間
       JL.LOGDATE AS JOB_LOG_DATE        ---做業日誌記錄時間
  FROM R_JOB JB,ETL_JOB_LOG JL ,R_JOBENTRY RY,R_JOB SUBJ
 WHERE JB.ID_JOB=RY.ID_JOB(+)
 AND JB.NAME= JL.JOBNAME(+)
 AND RY.NAME=SUBJ.NAME
 AND RY.id_jobentry_type=22
 ORDER BY JB.ID_DIRECTORY,JB.NAME,JL.LOGDATE
 ;
 
2. 查詢 子JOB 運行 日誌
查詢條件 : 執行批次,做業名稱,做業描述,轉換運行狀態,轉換日誌時間
SELECT ET.ID_BATCH,                      ----轉換執行批次
       JB.ID_JOB,                        ----做業ID
       JB.NAME    AS JOB_NAME,           ----做業名稱
       JB.DESCRIPTION AS JOB_DESCRIPTION,----做業描述
       RT.ID_TRANSFORMATION,             ----轉換ID
       RT.NAME              AS TRANS__NAME,          ----轉換名稱
       RT.DESCRIPTION       AS TRANS_DESCRIPTION,    ----轉換描述
       case when et.status='end' then
         '完成'
          when et.status='running' then
          '運行中'
          when et.status like 'stop%' then
           '中止'
         ELSE
           ET.STATUS
        END AS TRANS_RUN_STATUS,                     ----轉換運行狀態
       ET.ERRORS            AS TRANS_ERROR_NUMBER,   ----轉換運行錯誤數
       ET.LOG_FIELD         AS TRANS_LOG_COMMENT,    ----轉換運行日誌內容
       ET.STARTDATE         AS TRANS_STARTDATE,      ----轉換運行開始時間
       ET.ENDDATE           AS TRANS_ENDDATE,        ----轉換運行結速時間
       ET.LOGDATE           AS TRANS_LOGDATE         ----轉換日誌記錄時間

  FROM ETL_TRANSFORMATION_LOG ET,
       R_TRANSFORMATION       RT,
       R_JOBENTRY             RE,
       R_JOBENTRY_TYPE        JP,
       R_JOB                  JB
 WHERE ET.TRANSNAME = RT.NAME
   AND RE.NAME = RT.NAME
   AND RE.ID_JOBENTRY_TYPE = JP.ID_JOBENTRY_TYPE
   AND JB.ID_JOB = RE.ID_JOB
   AND JP.CODE = 'TRANS'
   ORDER BY ET.ID_BATCH,JB.ID_JOB,RT.ID_TRANSFORMATION,ET.LOGDATE
 ;
3.查詢ETL 轉換運行日誌
查詢條件 : 轉換執行批次,轉換名稱,轉換描述,轉換運行狀態,轉換日誌時間
SELECT ETSL.ID_BATCH,                  ----轉換步驟批次
        JB.ID_JOB,                        ----做業ID
       JB.NAME    AS JOB_NAME,           ----做業名稱
       JB.DESCRIPTION AS JOB_DESCRIPTION,----做業描述      
       RS.ID_TRANSFORMATION,           ----轉換ID
       RT.NAME              AS TRANS_NAME,           ----轉換I名稱
       RS.ID_STEP           AS TRANS_STEP_ID,        ----轉換步驟ID
       RS.NAME              AS TRANS_STEP_NAME,      ----轉換步驟名稱
       RST.CODE             AS TRANS_STEP_TYPE_CODE, ----轉換步驟類型代碼
       RST.DESCRIPTION      AS TRANS_STEP_DESCRIPTION, ----轉換步驟描述
       CASE WHEN RST.ID_STEP_TYPE=139 THEN
         '數據輸入'
         WHEN RST.ID_STEP_TYPE IN10, 163, 100) THEN
          '數據輸出'
       END AS TRANS_STEP_INPUT_OUTPUT,   ----轉換步驟數據流
       ETSL.LINES_READ  ,                ----轉換步驟讀數據行數
       ETSL.LINES_WRITTEN,               ----轉換步驟寫數據行數
       ETSL.LINES_UPDATED,               ----轉換步驟更新數據行數
       ETSL.LINES_INPUT,                 ----轉換步驟輸入數據行數
       ETSL.LINES_OUTPUT,                ----轉換步驟輸出數據行數
       ETSL.LINES_REJECTED,              ----轉換步驟拋出數據行數
       ETSL.ERRORS AS TRANS_STEP_ERRORS_NUMBER,----轉換步驟錯誤數
       ETSL.LOG_DATE AS TRANS_STEP_LOG_DATE    ----轉換步驟日誌記錄時間
  FROM R_STEP             RS,
       R_STEP_TYPE        RST,
       R_TRANSFORMATION   RT,
       ETL_TRANS_STEP_LOG ETSL,
       R_JOBENTRY             RE,
       R_JOBENTRY_TYPE        JP,
       R_JOB                  JB
 WHERE RS.ID_STEP_TYPE = RST.ID_STEP_TYPE
   AND RS.ID_TRANSFORMATION = RT.ID_TRANSFORMATION
   AND ETSL.TRANSNAME = RT.NAME
   AND ETSL.STEPNAME = RS.NAME
   AND RE.NAME = RT.NAME
   AND RE.ID_JOBENTRY_TYPE = JP.ID_JOBENTRY_TYPE
   AND JB.ID_JOB = RE.ID_JOB
   AND JP.CODE = 'TRANS'
   AND RST.ID_STEP_TYPE IN (139, 10, 163, 100)
 ORDER BY ETSL.ID_BATCH,RS.ID_TRANSFORMATION, RS.ID_STEP,ETSL.LOG_DATE
4.查詢ETL 轉換輸入輸出端 運行日誌
相關文章
相關標籤/搜索