ITPub博客

首页 > 数据库 > Oracle > [20220217]完善tpt gts.sql脚本.txt

[20220217]完善tpt gts.sql脚本.txt

原创 Oracle 作者:lfree 时间:2022-02-18 15:59:04 0 删除 编辑

[20220217]完善tpt gts.sql脚本.txt

--//有时候不小心使用gts分析生产系统的表,选择FOR TABLE FOR ALL COLUMNS SIZE 1,导致直方图消失.修改采用repeat,这样更加安全
--//一些.
--//method_opt=>'FOR TABLE FOR ALL COLUMNS SIZE 1'为method_opt=>'FOR TABLE FOR ALL COLUMNS SIZE REPEAT'.

-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.

prompt Gather Table Statistics for table &1....
exec dbms_stats.gather_table_stats(null, upper('&1'), null, method_opt=>'FOR TABLE FOR ALL COLUMNS SIZE REPEAT', cascade=>true, no_invalidate=>false);

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

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7971267