Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBMS_SCHEDULER program not executing as USER but does as SYS

12thMonkeyJul 18 2013 — edited Jul 19 2013

Hi Guys,

I'm using Oracle DB 10g EE 10.2.0.3.0

I have created a program to be executed with scheduler. however when I execute the job it fails due to a permissions error.


BEGIN
DBMS_SCHEDULER.CREATE_PROGRAM (
   program_name           => 'Billing_files_organise_prog',
   program_action         => '/home/ora10/data/organise.sh',
   program_type           => 'EXECUTABLE',
   comments               => 'To apply generic name to billing csv and archive original copy'
   );
END;


begin
DBMS_SCHEDULER.enable(   'Billing_files_organise_prog'   );
DBMS_SCHEDULER.CREATE_JOB (   job_name          =>  'billing_job',   program_name      =>  'Billing_files_organise_prog');
DBMS_SCHEDULER.enable(   'billing_job'   );
   end;

When I execute thisi get the following error. :

STANDARD_ERROR="mv: cannot rename /home/ora10/data/Monthly Report - July 2013.csv to /home/ora10/data/MonthlyReport-July2013.csv:

Permission denied

mv: cannot rename /home/ora10/data/Monthly R"

I have created a user BILLING_USER to specifically run this job and have granted all the permissions I think I need to.

CREATE EXTERNAL JOB

CREATE JOB

UNLIMITED TABLESPACE

CREATE SESSION

CREATE PROCEDURE

CREATE TABLE

EXECUTE ANY PROGRAM

The oracle user is also the author of the files on the server (which is Linux) so I do not think it is a permissions issue there.

When this is executed as SYS user the job runs fine no problems.

I have a feeling there is a permission or privilege missing somewhere but I cannot find which this is to grant. I have granted the BILLING_USER all the privileges that SYS has and still to no avail. SYS system privs are:

ALTER ANY RULE SET

EXECUTE ANY EVALUATION CONTEXT

DROP ANY EVALUATION CONTEXT

CREATE ANY RULE

DROP ANY RULE SET

EXECUTE ANY RULE SET

EXECUTE ANY RULE

ANALYZE ANY

DELETE ANY TABLE

INSERT ANY TABLE

CREATE RULE

EXECUTE ANY TYPE

LOCK ANY TABLE

CREATE EVALUATION CONTEXT

MANAGE ANY QUEUE

EXECUTE ANY PROCEDURE

CREATE ANY RULE SET

ALTER ANY EVALUATION CONTEXT

CREATE ANY EVALUATION CONTEXT

SELECT ANY SEQUENCE

UPDATE ANY TABLE

SELECT ANY TABLE

DROP ANY RULE

ALTER ANY RULE

CREATE RULE SET

DEQUEUE ANY QUEUE

ENQUEUE ANY QUEUE

Any help would be appreciated.

thanks in advance.

12

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 16 2013
Added on Jul 18 2013
1 comment
575 views