Executing job in Background for one sql

Share via:

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 &

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (11 votes, average: 5.00 out of 5)
Loading...

One thought on “Executing job in Background for one sql

Add Comment