ITPub博客

首页 > Linux操作系统 > Linux操作系统 > dbms_stats_all

dbms_stats_all

原创 Linux操作系统 作者:golden_zhou 时间:2011-03-10 10:08:24 0 删除 编辑

#!/bin/bash

export ORACLE_SID=umlaut
export ORACLE_HOME=/u01/product/oracle
export PATH=$ORACLE_HOME/bin:$PATH
$ORACLE_HOME/bin/sqlplus ' / as sysdba'<set serveroutput on;
set time on;
spool /data/temp/gather_R_WIP_KEYPARTS_T.log;
select sysdate from dual;
declare
begin
     dbms_stats.gather_table_stats('SFISM4','R_WIP_KEYPARTS_T',NULL,10,FALSE,'FOR ALL COLUMNS SIZE 1',5,'DEFAULT',FALSE,NULL,NULL,NULL);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'IDX_KEY_PART_2D_SN',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'I_WIP_KP',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'I_WIP_KP_TIME',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'KP_KP',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'KP_SN',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
end;
/
spool off;
exit;
!


export ORACLE_SID=umlaut
export ORACLE_HOME=/u01/product/oracle
export PATH=$ORACLE_HOME/bin:$PATH
$ORACLE_HOME/bin/sqlplus ' / as sysdba'<set serveroutput on;
set time on;
spool /data/temp/gather_R_SN_DETAIL_T.log;
select sysdate from dual;
declare
begin
     dbms_stats.gather_table_stats('SFISM4','R_SN_DETAIL_T',NULL,10,FALSE,'FOR ALL COLUMNS SIZE 1',5,'DEFAULT',FALSE,NULL,NULL,NULL);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'R_SN_DETAIL_STATION_TIME_EF',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'SN_DETAIL_GRPTIME',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'SN_DETAIL_SN',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
end;
/
spool off;
exit;
!


export ORACLE_SID=umlaut
export ORACLE_HOME=/u01/product/oracle
export PATH=$ORACLE_HOME/bin:$PATH
$ORACLE_HOME/bin/sqlplus ' / as sysdba'<set serveroutput on;
set time on;
spool /data/temp/gather_R_WIP_TRACKING_T.log;
select sysdate from dual;
declare
begin
     dbms_stats.gather_table_stats('SFISM4','R_WIP_TRACKING_T',NULL,10,FALSE,'FOR ALL COLUMNS SIZE 1',5,'DEFAULT',FALSE,NULL,NULL,NULL);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'I_WIP_CONTAINER_NO',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'R_TRACKING_PALLET',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'SERIAL_NUMBER',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'TRACKING_CARTON_NO',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'TRACKING_MO',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'TRACKING_QA_NO',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'TRACKING_TIME',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
end;
/
spool off;
exit;
!


export ORACLE_SID=umlaut
export ORACLE_HOME=/u01/product/oracle
export PATH=$ORACLE_HOME/bin:$PATH
$ORACLE_HOME/bin/sqlplus ' / as sysdba'<set serveroutput on;
set time on;
spool /data/temp/gather_R_WIP_LOG_T.log;
select sysdate from dual;
declare
begin
     dbms_stats.gather_table_stats('SFISM4','R_WIP_LOG_T',NULL,10,FALSE,'FOR ALL COLUMNS SIZE 1',5,'DEFAULT',FALSE,NULL,NULL,NULL);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'R_WIP_LOG_TIME',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'WIPLOG_SERIAL_NO',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
end;
/
spool off;
exit;
!


export ORACLE_SID=umlaut
export ORACLE_HOME=/u01/product/oracle
export PATH=$ORACLE_HOME/bin:$PATH
$ORACLE_HOME/bin/sqlplus ' / as sysdba'<set serveroutput on;
set time on;
spool /data/temp/gather_R_FAN_KEYPARTS_T.log;
select sysdate from dual;
declare
begin
     dbms_stats.gather_table_stats('SFISM4','R_FAN_KEYPARTS_T',NULL,10,FALSE,'FOR ALL COLUMNS SIZE 1',5,'DEFAULT',FALSE,NULL,NULL,NULL);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'FAN_KP',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'FAN_KP2',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
     dbms_stats.gather_index_stats(ownname=>'SFISM4',indname=>'FAN_KP3',estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
end;
/
spool off;
exit;
!

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

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

注册时间:2011-03-09

  • 博文量
    238
  • 访问量
    300863