EBS 对特定表单独收集统计信息 - fnd_stats.gather_table_stats

本文介绍了一种针对EBS中特定表进行统计信息收集的方法,通过创建存储过程gather_pmpc_stats并利用fnd_stats.gather_table_stats函数对指定表进行统计信息收集,最后通过dbms_scheduler创建定时任务实现每周自动执行。
对于某些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 ;
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-774146/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/35489/viewspace-774146/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值