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');
  • 相关阅读:
    Eclipse无法导入一些相关类的方法,出现Multiple markers at this line
    查看共享命令
    eclipse历史版本的下载地址
    MyEclipse的快捷键
    Hibernate的隔离级别
    eclipse插件下载地址
    UML类图几种关系的总结
    Oracle正则表达式函数:regexp_like、regexp_substr、regexp_instr、regexp_replace
    回滚段的学习
    Oracle 字符集的查看和修改
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/5893256.html
Copyright © 2011-2022 走看看