我有一个接口列表,我想更新这些接口中的一些映射,但不幸的是我们的生产和开发环境不同步。
因此,在编辑任何接口之前,我们需要比较DEV和PROD环境以查看是否存在任何差异。对于一些小型工作,很容易手动完成。但在我的情况下,有超过100个接口,我想在某种程度上自动化这个过程。我需要一些建议。
任何帮助将不胜感激。 感谢
答案 0 :(得分:0)
对存储库使用此查询
- Repository_Object_Changed_by_date - 这里我的工作存储库用户是ODI_WORK_REPO - ODI版本11 g
WITH obj as(
SELECT i_package i_instance, i_folder, NULL i_project, pack_name obj_name,3200 obj_type, 'Package' obj_type_name, last_date, last_user FROM ODI_WORK_REPO.SNP_PACKAGE
UNION ALL
SELECT i_pop i_instance, i_folder, NULL i_project, pop_name obj_name,3100 obj_type, 'Interface' obj_type_name, last_date, last_user FROM ODI_WORK_REPO.SNP_POP
UNION ALL
SELECT i_trt i_instance, i_folder, i_project, trt_name obj_name,3600 obj_type, CASE trt_type WHEN 'U' THEN 'Procedure' ELSE 'Knowledge Module' END obj_type_name, last_date, last_user FROM ODI_WORK_REPO.SNP_TRT
UNION ALL
SELECT i_var i_instance, NULL i_folder, i_project, var_name obj_name, 3500 obj_type, 'Variable' obj_type_name, last_date, last_user FROM ODI_WORK_REPO.SNP_VAR t
UNION ALL
SELECT i_table i_instance, i_sub_model i_folder, i_mod i_project, table_name obj_name, 2400 obj_type, 'Table' obj_type_name, last_date, last_user from ODI_WORK_REPO.snp_table t
)
,fd (i_folder, i_project, folder_name, folder_path, lv) AS(
SELECT i_folder, i_project, folder_name, folder_name folder_path, 1 lv
FROM ODI_WORK_REPO.snp_folder
WHERE par_i_folder IS NULL
UNION ALL
SELECT tf.i_folder, tf.i_project, tf.folder_name, fd.folder_path||'\'||tf.folder_name, fd.lv+1
FROM ODI_WORK_REPO.snp_folder tf JOIN fd
ON fd.i_folder = tf.par_i_folder
)
,mpl as (
SELECT sm.i_smod i_mc, 'sm' typemc, COALESCE(sm.i_smod_parent,sm.i_mod) i_mp, NVL2(sm.i_smod_parent,'sm','m') typemp, sm.smod_name name --, m.i_mod_folder
FROM ODI_WORK_REPO.snp_sub_model sm
UNION ALL
SELECT i_mod, 'm' typ, i_mod_folder, 'mf', mod_name
FROM ODI_WORK_REPO.snp_model m
UNION ALL
SELECT i_mod_folder, 'mf', par_i_mod_folder, 'mf', mod_folder_name FROM ODI_WORK_REPO.snp_mod_folder
)
,mp (i_mc, typemc, i_mp, typemp, model_tech, model_path, lv) AS(
SELECT i_mc, typemc, i_mp, typemp, name tname, name model_path, 1 lv
FROM mpl
WHERE i_mp IS NULL
UNION ALL
SELECT mpl.i_mc, mpl.typemc, mpl.i_mp, mpl.typemp, mp.model_tech, mp.model_path||'\'||mpl.name model_path, mp.lv+1 lv
FROM mpl JOIN mp
ON mpl.i_mp = mp.i_mc AND mpl.typemp=mp.typemc
)
SELECT obj.i_instance, OBJ_NAME, CASE WHEN COALESCE(project_name,mp.model_tech) IS NULL THEN 'Global ' || OBJ_TYPE_NAME ELSE OBJ_TYPE_NAME END obj_type_name
,obj.last_date
,obj.last_user
,COALESCE(project_name,mp.model_tech) project_model
,COALESCE(fd.folder_path,mp.model_path) path
FROM obj
FULL OUTER
JOIN fd
ON fd.i_folder = obj.i_folder AND obj_type_name!='Table'
FULL OUTER
JOIN mp
ON mp.i_mc = obj.i_folder AND obj_type_name='Table'
FULL OUTER
JOIN ODI_WORK_REPO.snp_project p
ON p.i_project = COALESCE(obj.i_project, fd.i_project)
FULL OUTER
JOIN ODI_WORK_REPO.snp_model m
ON m.i_mod = obj.i_project