zoukankan      html  css  js  c++  java
  • copy_part_stat.sql

    spool 04_copy_part_stat.log

    conn / as sysdba

    execute sys.dbms_stats.export_schema_stats(ownname=>'test',statown=>'OPER',stattab=>'STAT_TABLE',statid=>'test_20160831');

    execute sys.dbms_stats.export_schema_stats(ownname=>'test',statown=>'OPER',stattab=>'STAT_TABLE',statid=>'test_20160831');

    --execute sys.dbms_stats.export_schema_stats(ownname=>'test',statown=>'OPER',stattab=>'STAT_TABLE',statid=>'test_20160831');

    execute sys.dbms_stats.export_schema_stats(ownname=>'test',statown=>'OPER',stattab=>'STAT_TABLE',statid=>'test_20160831');

    disconnect;

    @/testdb/change/env/env_test.sql

    conn &v_test_un/&v_test_pw

    set time on set timing on set echo on set linesize 150 set pagesize 400

    EXEC DBMS_STATS.COPY_TABLE_STATS('test','test','PART148','PART145');

    select table_name,PARTITION_NAME,num_rows,AVG_ROW_LEN,BLOCKS from user_tab_partitions where table_name in ('test') order by table_name, partition_name;

    select index_name , partition_name from user_ind_partitions where status !='USABLE';

    select index_name from user_indexes where status='UNUSABLE';

    select distinct status from user_indexes; select distinct status from user_ind_partitions;

    REF:

    COPY_TABLE_STATS      (new 11g parameters)
          Copy statistics from one table partition to another dbms_stats.copy_table_stats(       ownname      IN VARCHAR2,       tabname      IN VARCHAR2,       srcpartname  IN VARCHAR2,       dstpartname  IN VARCHAR2,         scale_factor IN NUMBER  DEFAULT 1,         flags        IN NUMBER  DEFAULT NULL,         force        IN BOOLEAN DEFAULT FALSE);
    SELECT partition_name FROM user_tab_partitions WHERE table_name = 'SALES';
         exec dbms_stats.copy_table_stats('SH',      'SALES', 'SALES_Q3_2002', 'SALES_Q3_2003');
  • 相关阅读:
    luoguP3822 [NOI2017]整数
    luoguP2150 [NOI2015]寿司晚宴
    luoguP3868 [TJOI2009]猜数字
    luoguP4777 【模板】扩展中国剩余定理(EXCRT)
    luoguP2048 超级钢琴
    题解 P1004 【方格取数】
    戊戌年西安游记
    题解 P4388 【付公主的矩形】
    题解 P4277 【河城荷取的烟花】
    001 dynamic Linq
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/5893256.html
Copyright © 2011-2022 走看看