03-22-2007
23,
0
Join Date: Mar 2007
Last Activity: 28 March 2007, 2:05 AM EDT
Posts: 23
Thanks Given: 0
Thanked 0 Times in 0 Posts
using Oracle with Cron
Greetings,
I am doing some work on using Oracle with Cron and was wondering if you could help. I am relatively new both to Oracle and Unix. Please be patient :-)
Here is what I am trying to do:
I wish to know the contents of employees table in scott account everyday at 11 am, save a copy at my directory /home/alikun and send another to a user at email address removed by moderator
This is what I did but couldn't get results:
1. Created a vi script, scottcron.sql, containing the query:
spool /home/alikun
select * from employees;
exit;
2. wrote a separate script, scottshell, to execute the script above:
/home/alikun/Sqlplus scott/tiger @/home/alikun/scottrcron.sql
3. Finally, the cron script, mycron, as follows:
00 11 * * * “/home/alikun/scottshel” | mail -s “hi zalikun, this is your file” email address removed by moderator
crontab mycron
Please note: I did a bit of research on this and it seems that I would need two other things:
a) ORACLE_HOME=
b) B) ORACLE_SID=
How can I find the path for ORACLE_HOME in a), and the SID for b) on my unix system?.
Thanks all so very much,
Alikun
Last edited by blowtorch; 03-22-2007 at 03:10 AM..