dbms_scheduler.create_job() job_type executable
I created a job using a dbms_scheduler.create_job()
here is the code:
BEGIN
DBMS_SCHEDULER.CREATE_JOB(
job_name=>'CRSJOB',
job_type=>'EXECUTABLE',
job_action=>'/tmp/crsrows2 > nul',
start_date=>SYSTIMESTAMP,
repeat_interval=>'freq=minutely; byminute=2',
end_date=>NULL,
ENABLED=>TRUE,
comments=>'crs listing job');
end;
/
here is the shell script:
#!/usr/bin/ksh
sqlplus -s regdb/password<<EOF
spool testcrs.dat;
select table_name from user_tables;
insert into abc
select table_name from user_tables;
spool off;
EOF
the shell script runs itself fine, but everytime when I run_job, I got the error that it can't open the file: /tmp/crsrows2.sh, not owner
what should i do? oracle is the owner of the shell script. it must be something so simple, but I can't fix it!
Thank you very much for your help.