cat g_stats_1_test.sh
sqlplus / as sysdba <<EOF
set head off
conn / as sysdba
set serveroutput on
set timing on
set echo on
spool dict_stats_test.log
exec DBMS_STATS.gather_table_stats (ownname => ‘SCOTT’,tabname => ‘EMP’,method_opt=>’FOR COLUMNS SIZE AUTO STATUS’);
spool off
set timing off
set serveroutput off
exit;
EOF
chmod 777 g_stats_1_test.sh
nohup ./g_stats_1_test.sh &
Note: Please test scripts in Non Prod before trying in Production.
Swetha
Nice information in this article