stats_A2.sh
rq="start time":`date +"%Y-%m-%d %H:%M:%S"`
echo $rq>>/u01/bk/scripts/stats.log
sqlplus /nolog >/u01/bk/scripts/stats.log<<EOF
connect / as sysdba;
exec DBMS_STATS.GATHER_DATABASE_STATS (estimate_percent=>10,Degree=>8,Cascade=>TRUE,Granularity=>'ALL');
EOF
rq="stop time":`date +"%Y-%m-%d %H:%M:%S"`
echo $rq>>/u01/bk/scripts/stats.log
原文链接:https://www.f2er.com/oracle/211025.html