infa日志获取视图脚本

CREATE OR REPLACE VIEW ETL_VIEW
(workflow_run_id, subj_name, workflow_name, session_name, start_time, end_time, run_err_msg, run_status)
AS
SELECT a.WORKFLOW_RUN_ID, e.subj_name,d.WORKFLOW_NAME,a.INSTANCE_NAME, a.
START_TIME, a.END_TIME, case when a.RUN_STATUS_CODE=1 THEN '成功导入'||rtrim
(to_char(b.TARG_SUCCESS_ROWS)) || '条,失败了' || rtrim(to_char(b. TARG_FAILED_ROWS
)) || '条' ELSE '错误' END RUN_ERR_MSG, CASE a. RUN_STATUS_CODE WHEN 1 THEN
'ok' WHEN 2 THEN 'Disabled' WHEN 3 THEN 'fail' WHEN 4 THEN 'Stopped' WHEN 5
THEN 'Aborted' WHEN 6 THEN 'Running' WHEN 7 THEN 'Suspending' WHEN 8 THEN
'Suspended' WHEN 9 THEN 'Stopping' WHEN 10 THEN 'Aborting' WHEN 11 THEN
'Waiting' WHEN 12 THEN 'Scheduled' WHEN 13 THEN 'Unscheduled' WHEN 14 THEN
'Unknown' WHEN 15 THEN 'Terminated' END RUN_STATUS FROM opb_task_inst_run a
, opb_sess_task_log b ,opb_wflow_run d,opb_subject e where d.WORKFLOW_NAME
like 'wf_%' and a.instance_name like 's_%' and e.subj_id =d.subject_id and a
.WORKFLOW_ID=b. WORKFLOW_ID and a.WORKFLOW_RUN_ID=b.WORKFLOW_RUN_ID and d.
WORKFLOW_ID=b. WORKFLOW_ID and d.WORKFLOW_RUN_ID=b.WORKFLOW_RUN_ID and a.
INSTANCE_ID=b. INSTANCE_ID and a.
workflow_run_id in ( select distinct workflow_run_id from opb_task_inst_run
);
原文地址:https://www.cnblogs.com/fenggouzi/p/3276430.html