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