odi资料库查询sql

查询接口基本信息:

SELECT C.I_POP                                 WID,
       C.POP_NAME                              JKMC,
       STH.FULL_TEXT                           ODI_INTERFACE_REMARK,
       C.I_TXT_POP_LIB                         JKMSID,
       P.PROJECT_NAME || '>>' || F.FOLDER_NAME JKWZ,
       C.LSCHEMA_NAME                          MBSJY,
       TAB.TABLE_NAME                          MBBM,
       C.LAST_DATE                             ZHXGSJ,
       C.LAST_USER                             ZHXGR
FROM dev_odi_repo.SNP_POP C
         JOIN dev_odi_repo.SNP_FOLDER F ON C.I_FOLDER = F.I_FOLDER
         JOIN dev_odi_repo.SNP_PROJECT P ON F.I_PROJECT = P.I_PROJECT
         JOIN dev_odi_repo.SNP_TABLE TAB ON C.I_TABLE = TAB.I_TABLE
         LEFT JOIN dev_odi_repo.SNP_TXT_HEADER STH ON C.I_POP = STH.I_TXT;

接口条件信息:

SELECT
CLAUSE.I_TXT_SQL WID,
C.I_POP JKID,
C.POP_NAME  JKMC,
TXTH.FULL_TEXT GLTJ,
CLAUSE.CLAUSE_TYPE,
CLAUSE.I_TABLE1,
CLAUSE.IND_OUTER1,
CLAUSE.I_TABLE2,
CLAUSE.IND_OUTER2,
CLAUSE.I_SRC_SET,
CLAUSE.JOIN_TYPE,
CLAUSE.IND_ENABLE,
CLAUSE.ORD_CLAUSE,
crossr.string_pos,
crossr.string_elt,
crossr.tab_alias
FROM DEV_ODI_REPO.SNP_POP C,DEV_ODI_REPO.SNP_POP_CLAUSE CLAUSE,DEV_ODI_REPO.SNP_TXT_HEADER TXTH,DEV_ODI_REPO.snp_txt_crossr crossr
WHERE C.I_POP=CLAUSE.I_DATA_SET AND CLAUSE.I_TXT_SQL=TXTH.I_TXT and crossr.i_txt = CLAUSE.I_TXT_SQL;
 

任务执行情况:

select
scen.scen_no rwid,
scen.scen_name rwmc,
scen.scen_version rwbb,
pac.i_package bid,
pac.pack_name bmc,
splan.lagent_name dl,
splan.stat_plan hdzt,
splan.s_year,
splan.s_month,
splan.s_day,
splan.s_month_day,
splan.s_week_day,
splan.s_hour,
splan.s_minute,
splan.s_second,
splan.s_week_day_rank,
splan.s_type ,
splan.log_level,
splan.s_begin_date,
splan.s_end_date,
splan.s_begin_hour,
splan.s_end_hour,
splan.s_ex_days_month,
splan.s_ex_days_week,
splan.r_time,
splan.r_dur_interval,
splan.r_interval_unit,
splan.r_dur_cycle,
splan.r_cycle_unit,
splan.r_deadline,
splan.r_deadline_unit,
splan.r_time_error,
'当前任务'||
case when splan.stat_plan = 'E' THEN '为活动'
when splan.stat_plan = 'D' then '为非活动'
else (
     CASE WHEN splan.s_begin_date IS NOT NULL AND splan.s_end_date IS NOT NULL THEN  '从'||to_char(splan.s_begin_date,'yyyy-mm-dd')||'到'||to_char(splan.s_end_date,'yyyy-mm-dd')
     WHEN  splan.s_begin_date IS NOT NULL AND splan.s_end_date IS NULL THEN  '从'||to_char(splan.s_begin_date,'yyyy-mm-dd')||'后'
     WHEN  splan.s_begin_date IS NULL AND splan.s_end_date IS NOT NULL THEN  '到'||to_char(splan.s_end_date,'yyyy-mm-dd')||'前'
     ELSE '' END
     )
     ||
     (
     CASE WHEN splan.s_ex_days_month IS NOT NULL THEN  ',除了每月'||splan.s_ex_days_month||'号'
     ELSE '' END
     )
     ||
     (
     CASE WHEN splan.s_ex_days_month IS NOT NULL AND splan.s_ex_days_week IS NOT NULL  THEN  '、'||f_zsj_sjjc_weekconvert(splan.s_ex_days_week,'1')
     WHEN splan.s_ex_days_month IS NULL AND splan.s_ex_days_week IS NOT NULL  THEN  ',除了'||f_zsj_sjjc_weekconvert(splan.s_ex_days_week,'1')
     ELSE '' END
     )
     ||
     (
     CASE WHEN (splan.s_begin_date IS NOT NULL OR splan.s_end_date IS NOT NULL) AND splan.s_begin_hour IS NOT NULL THEN  ',每天'||to_char(splan.s_begin_hour,'hh24:mi:ss')||'到'||to_char(splan.s_end_hour,'hh24:mi:ss')
     WHEN  (splan.s_begin_date IS NULL AND splan.s_end_date IS NULL) AND splan.s_begin_hour IS NOT NULL THEN  '每天'||to_char(splan.s_begin_hour,'hh24:mi:ss')||'到'||to_char(splan.s_end_hour,'hh24:mi:ss')
     ELSE '' END
     )
     ||'为活动'
end || '状态' zt,
'当前任务'||
case when splan.s_type = 'O' then
'在启动时执行一次'
when splan.s_type = 'S' then
'在'||splan.s_year||'-'||splan.s_month||'-'||splan.s_day||' '||splan.s_hour||':'||splan.s_minute||':'||splan.s_second||'执行'
when splan.s_type = 'H' then
'在每小时'||splan.s_minute||':'||splan.s_second||'执行'
when splan.s_type = 'D' then
'在每天'||splan.s_hour||':'||splan.s_minute||':'||splan.s_second||'执行'
when splan.s_type = 'W' then
'在每周'||f_zsj_sjjc_weekconvert(splan.s_week_day,'2')||'中的'||splan.s_hour||':'||splan.s_minute||':'||splan.s_second||'执行'
when splan.s_type = 'M' then
'在每月'||
        case when splan.s_month_day > 0 then splan.s_month_day||'号'
        when splan.s_month_day > 0 then '月末最后一天'
        when splan.s_month_day < 0 then '月末前一天'
        end
        ||'的'||splan.s_hour||':'||splan.s_minute||':'||splan.s_second||'执行'
when splan.s_type = 'N' then
'在每月第'||splan.s_week_day_rank||'个'||f_zsj_sjjc_weekconvert(splan.s_week_day,'2')||splan.s_hour||':'||splan.s_minute||':'||splan.s_second||'执行'
when splan.s_type = 'Y' then
'在每年'||splan.s_month||'月'||splan.s_day||'号的'||splan.s_hour||':'||splan.s_minute||':'||splan.s_second||'执行'
||
case when splan.r_dur_interval is not null then ',且每'||splan.r_dur_interval||splan.r_interval_unit||'循环一次'
     ||case when splan.r_time>0 then ',最大循环次数为'||splan.r_time end
     ||case when splan.r_DUR_CYCLE>0 then ',最大循环持续时间为'||splan.r_DUR_CYCLE||splan.r_cycle_unit end
     ||case when splan.r_time_error>0 then ',失败是尝试次数为'||splan.r_time_error end
     ||case when splan.r_deadline>0 then ','||splan.r_deadline||splan.r_deadline_unit||'后停止执行'||splan.r_time_error end
end
end zx
from DEV_ODI_REPO.snp_scen scen, DEV_ODI_REPO.snp_package pac,DEV_ODI_REPO.snp_plan_agent splan
where  scen.i_package = pac.i_package
   and scen.scen_name = splan.scen_name and scen.scen_version = splan.scen_version;
 

任务与接口的对应关系:

select
pac.i_package pakid,
pac.pack_name pakmc,
s.i_step bzid,
s.step_name bzmc,
s.nno bzsx,
s.i_pop jkid,
p.pop_name jkmc,
pac.last_date zhxgsj,
pac.last_user zhxgr
from DEV_ODI_REPO.snp_step s,DEV_ODI_REPO.snp_pop p ,DEV_ODI_REPO.snp_package pac
where s.i_pop = p.i_pop and s.i_package = pac.i_package;
 

近一年接口是有执行记录:

select distinct  a.step_name,b.sess_name from dev_odi_repo.SNP_SESS_STEP a left join dev_odi_repo.snp_session b on a.sess_no = b.sess_no where to_char(sess_beg,'yyyy-mm-dd')  >'2022-05-01' 

查询字段映射关系:

SELECT
  M.I_TXT_MAP WID,
  P.I_POP JKID,
  P.POP_NAME  JKMC,
  P.LSCHEMA_NAME MBSJY,
  MTAB.I_TABLE MBBID,
  MTAB.TABLE_NAME MBBM,
  COL.I_COL MBBZDID,
  COL.COL_NAME MBBZDM,
  YTAB.LSCHEMA_NAME YBSJY,
  YTAB.I_SOURCE_TAB YBID,
  YTAB.TABLE_NAME YBBM,
  crossr.string_elt BDS,
  COL.IND_KEY_UPD SFGJZ
FROM DEV_ODI_REPO.SNP_POP P,DEV_ODI_REPO.SNP_POP_COL COL,DEV_ODI_REPO.SNP_TABLE MTAB,DEV_ODI_REPO.SNP_SOURCE_TAB YTAB,DEV_ODI_REPO.snp_pop_mapping m,DEV_ODI_REPO.snp_txt_crossr crossr
WHERE P.I_POP=COL.I_POP  AND P.I_TABLE = MTAB.I_TABLE and COL.I_POP_COL = m.i_pop_col AND M.I_SOURCE_TAB = YTAB.I_SOURCE_TAB AND M.I_TXT_MAP = crossr.i_txt;
 

你可能感兴趣的:(oracle,odi)