analyze.sql
sqlplus /nolog
<< EOF
conn center_admin/inxite;
set pagesize 5000
set heading off
SPOOL ANALYTAB.SQL
SELECT 'ANALYZE TABLE CENER_ADMIN.'||TABLE_NAME||' ESTIMATE STATISTICS SAMPLE 20 PERCENT ;' FROM user_tables;
SPOOL OFF
SPOOL ANALYIND.SQL
SELECT 'ANALYZE TABLE CENTER_ADMIN.'||TABLE_NAME||' ESTIMATE STATISTICS SAMPLE 20 PERCENT FOR ALL INDEXES;' FROM user_tables;
SPOOL OFF
SPOOL ANALYZE.LOG
@ANALYTAB.SQL
@ANALYIND.SQL
SPOOL OFF
EXIT
阅读(2269) | 评论(0) | 转发(0) |