ITPub博客

首页 > 数据库 > Oracle > gather stats的小程序

gather stats的小程序

原创 Oracle 作者:tolilong 时间:2012-10-17 09:09:53 0 删除 编辑
create or replace procedure get_table_history_stats
is
begin
dbms_stats.gather_schema_stats(ownname=>'HISSAAS');
insert into table_history_stats
select table_name,num_rows,BLOCKS,empty_blocks,AVG_SPACE,avg_row_len,
to_date(to_char(sysdate,'yyyy/mm/dd'),'yyyy/mm/dd')
from user_tables where num_rows<>0;
commit;
end get_table_history_stats;
[@more@]

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

请登录后发表评论 登录
全部评论

注册时间:2010-07-13

  • 博文量
    406
  • 访问量
    1208669