在ODI资源库里如何手动删除一个情境以及与相关的报告
应用:
Oracle Data Integrator - Version: 4.1.01.05
该文档信息可以应用到任何平台
目标
在ODI资源库里如何手动删除一个情境以及相关的报告?
解决方案
SQL脚本移除ODI会话和与其相关的报告
下面的SQL指令要求从ODI10.1.3版本开始应用:
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_TASK_MESS from <w_schema>.SNP_SESS_TASK_LOG where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>'));
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_STEP_MESS from <w_schema>.SNP_STEP_LOG where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>'));
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_VAR from <w_schema>.SNP_VAR_SESS where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>'));
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_DEF_T from <w_schema>.SNP_VAR_SESS where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>'));
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_SESS_PARAMS from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>'));
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_SESS_MESS from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>');
下面的SQL指令要求应用于任何Sunopsis和ODI版本
delete from <w_schema>.SNP_SESS_TXT_LOG where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>');
delete from <w_schema>.SNP_SESS_TASK_LOG where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>');
delete from <w_schema>.SNP_STEP_LOG where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>');
delete from <w_schema>.SNP_TASK_TXT where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>');
delete from <w_schema>.SNP_SESS_TASK where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>');
delete from <w_schema>.SNP_SESS_STEP where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>');
delete from <w_schema>.SNP_SEQ_SESS where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>');
delete from <w_schema>.SNP_VAR_SESS where SESS_NO in (select SESS_NO from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>');
delete from <w_schema>.SNP_SESSION where SESS_NAME='<name>' and SCEN_VERSION='<version>';
SQL脚本删除ODI相关的报告
下面的SQL指令要求从ODI10.1.3版本开始应用
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_STEP_MESS from <w_schema>.SNP_STEP_REPORT where SCEN_NO = <id>);
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_SESS_MESS from <w_schema>.SNP_SCEN_REPORT where SCEN_NO = <id>);
下面的SQL指令要求应用于任何Sunopsis 和ODI版本:
delete from <w_schema>.SNP_STEP_REPORT where SCEN_NO = <id>;
delete from <w_schema>.SNP_SCEN_REPORT where SCEN_NO = <id>;
SQL脚本删除情境
下面的SQL指令要求从ODI版本10.1.3开始应用:
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_VAR from <w_schema>.SNP_VAR_SCEN where SCEN_NO = <id>);
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_DEF_T from <w_schema>.SNP_VAR_SCEN where SCEN_NO = <id>);
delete from <w_schema>.SNP_EXP_TXT where I_TXT in (select I_TXT_SCEN from <w_schema>.SNP_SCEN where SCEN_NO = <id>);
下面的SQL指令要求应用于任何Sunopsis 和ODI版本:
delete from <w_schema>.SNP_SCEN_TXT where SCEN_NO = <id>;
delete from <w_schema>.SNP_SCEN_TASK where SCEN_NO = <id>;
delete from <w_schema>.SNP_SCEN_STEP where SCEN_NO = <id>;
delete from <w_schema>.SNP_SEQ_SCEN where SCEN_NO = <id>;
delete from <w_schema>.SNP_VAR_SCEN where SCEN_NO = <id>;
delete from <w_schema>.SNP_PLAN_AGENT where SCEN_NAME ='<name>' and SCEN_VERSION = '<version>';
delete from <w_schema>.SNP_SCEN where SCEN_NO = <id>;
其中:
<w_schema> 是工作资源库架构的名字
<id> 是情境内部标识符 (打开设计工具: id 陈列在情境的版本标签上).
<name> 是情境的名字 (打开设计工具:名字就定义在情境的定义标签上).
<version> 是情境的版本号 (打开设计工具:版本号就定义在情境的定义标签上).
重要:
使用SQL指令删除情境报告是很有必要的:
当手动删除情境报告时,所有和它相关的报告也被删除
OdiPurgeLog 工具允许删除情境报告和会话报告
重要:
因为性能的原因,一旦成功的删除上面的操作,应该重新计算表和存储信息索引:
ANALYZE TABLE <myTable> COMPUTE STATISTICS
and
ALTER TABLE <myTable> ENABLE ROW MOVEMENT
and
ALTER TABLE <myTable> SHRINK SPACE CASCADE