Hi, I'm using Oracle Linux 7.6 which holds an Oracle Database 12.1 installation.
Trying to run al simple one time job:
begin
dbms_scheduler.create_job
(
job_name => 'One_Time_Job',
job_type => 'EXECUTABLE',
job_action => '/home/oracle/temp/generate_files.sh',
start_date => sysdate,
enabled => TRUE,
auto_drop => TRUE,
comments => 'one-time job');
end;
Conttents of script:
[oracle@VrxiDB1 temp]$ ls -l generate_files.sh
-rwxr-xr-x. 1 oracle oinstall 71 oct 2 16:31 generate_files.sh
[oracle@VrxiDB1 temp]$ cat generate_files.sh
#!/bin/bash
cd /home/oracle/temp
/usr/bin/ls -1 *.csv > list_files.txt
[oracle@VrxiDB1 temp]
Script runs when executed from terminal. Also when executed from DB reports no error but does not execute really as confirmed where checking alert.log:
ORA-12012: error en la ejecuci▒n autom▒tica del trabajo "GPROSOFT_ILVIZIO"."ONE_TIME_JOB"
ORA-27369: fallo del trabajo de tipo EXECUTABLE con el c▒digo de salida: Permission denied
[oracle@VrxiDB1 trace]$
Files permissions:
[oracle@VrxiDB1 bin]$ ls -lth oracle
-rwsr-s--x. 1 oracle oinstall 297M sep 4 18:45 oracle
[oracle@VrxiDB1 bin]$ ls -lth extjob
-rwsr-x---. 1 root oinstall 1,6M sep 4 18:44 extjob
[oracle@VrxiDB1 admin]$ ls -l externaljob.ora
-rw-r-----. 1 root oinstall 1534 dic 21 2005 externaljob.ora
[oracle@VrxiDB1 admin]$
I'm not sure about changing file permissions of previous files. Seem ok to me.
Any help will be greatly appreciated !!!