Home » RDBMS Server » Performance Tuning » Automating - Gathering Satistics
Automating - Gathering Satistics [message #206439] Thu, 30 November 2006 01:05 Go to next message
Brayan
Messages: 315
Registered: June 2002
Senior Member
Hi,

I have a PL/SQL for gathering statistics(dbms_stats.GATHER_TABLE_STATS). I want to automate the the scripts. At present I'm submitting a DBMS_JOB.

Can anybody help me in to cron the job, i mean running the sql from OS.

Regards,
Brian.
Re: Automating - Gathering Satistics [message #206506 is a reply to message #206439] Thu, 30 November 2006 06:12 Go to previous message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
That should be quite simple.
Write a wrapper shell script, say myshellscript.sh
Something like this (untested code)
#!/bin/bash
sqlplus -s scott/tiger <<EOF
exec dbms_job(.............);
exit;
EOF

give the execute rights for the file myshellscript.sh.
schedule it in cronjob. Search forum/google for examples.
http://www.orafaq.com/forum/m/201760/42800/?srch=cronjob#msg_201760
Previous Topic: SQL vs. PLSQL
Next Topic: Index Rebuild Taking Long
Goto Forum:
  


Current Time: Sat Dec 03 09:56:06 CST 2016

Total time taken to generate the page: 0.07823 seconds