对于某些EBS某些特定的表要做分析, 需撇开相同schema下的超大表,那么必须使用 fnd_stats.gather_table_stats对表进行统计信息收集, 而不能针对 schema , 这样就需要对每个需要的表进行单独处理 。
如果是RAC, 想跨节点并行执行, 可加入 execute immediate 'alter session set parallel_force_local=false';
CREATE OR REPLACE PROCEDURE apps.gather_pmpc_stats as
BEGIN
begin fnd_stats.GATHER_TABLE_STATS('HWCUST','HW_PM_BUSINESS_KEY_T'); exception when others then null; end;
begin fnd_stats.GATHER_TABLE_STATS('HWCUST','HW_PM_CALENDERS_T'); exception when others then null; end;
begin fnd_stats.GATHER_TABLE_STATS('HWCUST','HW_PM_DELIVERY_UNIT_TI'); exception when others then null; end;
begin fnd_stats.GATHER_TABLE_STATS('HWCUST','HW_PM_DELIVERY_UNIT_TMP'); exception when others then null; end;
begin fnd_stats.GATHER_TABLE_STATS('HWCUST','HW_PM_DU_ACTIVITIES_TI'); exception when others then null; end;
.....
end gather_pmpc_stats ;
/
begin
dbms_scheduler.create_job
(
job_name=> 'GATHER_PMPC_STATS_JOB',
job_type=> 'STORED_PROCEDURE',
job_action=> 'APPS.GATHER_PMPC_STATS',
repeat_interval => 'FREQ=WEEKLY; BYDAY=SUN;BYHOUR=0',
enabled=> true,
comments => 'Gather statistics for specified tables in PM and PC'
) ;
end ;
CREATE OR REPLACE PROCEDURE apps.gather_pmpc_stats as
BEGIN
begin fnd_stats.GATHER_TABLE_STATS('HWCUST','HW_PM_BUSINESS_KEY_T'); exception when others then null; end;
begin fnd_stats.GATHER_TABLE_STATS('HWCUST','HW_PM_CALENDERS_T'); exception when others then null; end;
begin fnd_stats.GATHER_TABLE_STATS('HWCUST','HW_PM_DELIVERY_UNIT_TI'); exception when others then null; end;
begin fnd_stats.GATHER_TABLE_STATS('HWCUST','HW_PM_DELIVERY_UNIT_TMP'); exception when others then null; end;
begin fnd_stats.GATHER_TABLE_STATS('HWCUST','HW_PM_DU_ACTIVITIES_TI'); exception when others then null; end;
.....
end gather_pmpc_stats ;
/
begin
dbms_scheduler.create_job
(
job_name=> 'GATHER_PMPC_STATS_JOB',
job_type=> 'STORED_PROCEDURE',
job_action=> 'APPS.GATHER_PMPC_STATS',
repeat_interval => 'FREQ=WEEKLY; BYDAY=SUN;BYHOUR=0',
enabled=> true,
comments => 'Gather statistics for specified tables in PM and PC'
) ;
end ;
本文转自ITPUB博客tolywang的博客,原文链接:EBS 对特定表单独收集统计信息 - fnd_stats.gather_table_stats,如需转载请自行联系原博主。