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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-27486: insufficient privileges ORA-06512: at "SYS.DBMS_ISCHED", line 12

user8731258Jun 19 2012 — edited Jun 19 2012
Error at line 1
ORA-27486: insufficient privileges
ORA-06512: at "SYS.DBMS_ISCHED", line 124
ORA-06512: at "SYS.DBMS_SCHEDULER", line 271
ORA-06512: at line 3
begin
DBMS_SCHEDULER.CREATE_JOB
        (
           job_name        => 'drop_acq_txn_1'
          ,start_date      =>  sysdate---TO_TIMESTAMP_TZ(to_char(sysdate+1/1200 ,'yyyy/mm/dd hh24:mi:ss')|| '.000000 +05:30','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm')
          ,repeat_interval => 'FREQ=DAILY; INTERVAL=1'
          ,end_date        => NULL
          ,job_class       => 'DEFAULT_JOB_CLASS'
          ,job_type        => 'STORED_PROCEDURE'
          ,job_action      => 'PRC_DROP_ACQ_TXN(''-7-jan-2012'')'
          ,enabled         =>  TRUE
        );   
end;
Edited by: user8731258 on Jun 19, 2012 3:17 AM

Comments

Hoek
ORA-27486: insufficient privileges
Cause: An attempt was made to perform a scheduler operation without the required privileges.
Action: Ask a sufficiently privileged user to perform the requested operation, or grant the required privileges to the proper user(s).

Do you have CREATE JOB or CREATE ANY JOB granted directly to you (and not through a ROLE)?
http://docs.oracle.com/cd/E11882_01/server.112/e25494/scheduse002.htm#i1006395
user8731258
Thanks.problem solved
user8731258
Hii..i got the previlige and i am able to atleast create a job but now
when i am trying to call a procedure i get error

Error at line 1
ORA-27452: PRC_DROP_ACQ_TXN('07-JAN-2012','NFSA','NFS') is an invalid name for a database object.
ORA-06512: at "SYS.DBMS_ISCHED", line 124
ORA-06512: at "SYS.DBMS_SCHEDULER", line 271
ORA-06512: at line 3
begin

DBMS_SCHEDULER.CREATE_JOB
        (
           job_name        => 'drop_acq_txn_1'
          ,start_date      =>  sysdate---TO_TIMESTAMP_TZ(to_char(sysdate+1/1200 ,'yyyy/mm/dd hh24:mi:ss')|| '.000000 +05:30','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm')
          ,repeat_interval => 'FREQ=DAILY; INTERVAL=1'
          ,end_date        => NULL
          ,job_class       => 'DEFAULT_JOB_CLASS'
          ,job_type        => 'STORED_PROCEDURE'
          ,job_action      => 'PRC_DROP_ACQ_TXN(''07-JAN-2012'',''NFSA'',''NFS'')'
         ,enabled         =>  TRUE
        );   
       
end;
Edited by: user8731258 on Jun 19, 2012 4:10 AM

Edited by: user8731258 on Jun 19, 2012 4:11 AM
Hoek
Add a BEGIN and END to the procedure call:
job_action      => ' BEGIN PRC_DROP_ACQ_TXN(''07-JAN-2012'',''NFSA'',''NFS''); END;'
(And use TO_DATE+appropriate format mask if your first parameter is of DATE datatype!)
user8731258
hi,
i did the changes.
but still getting the same error :(
begin

DBMS_SCHEDULER.CREATE_JOB
        (
           job_name        => 'drop_acq_txn_1'
          ,start_date      =>  sysdate
          ,repeat_interval => 'FREQ=DAILY; INTERVAL=1'
          ,end_date        => NULL
          ,job_class       => 'DEFAULT_JOB_CLASS'
          ,job_type        => 'STORED_PROCEDURE'
          ,job_action      => 'BEGIN PRC_DROP_ACQ_TXN(TO_DATE(''07-JAN-2012'',''DD-MON-YYYY ''),''NFSA'',''NFS''); END'
          ,enabled         =>  TRUE
        );   
       
end;
Edited by: user8731258 on Jun 19, 2012 4:10 AM
Hoek
Could it be because there's a semi-colon (';') missing after your END?
You have:
,job_action => 'BEGIN PRC_DROP_ACQ_TXN(TO_DATE(''07-JAN-2012'',''DD-MON-YYYY ''),''NFSA'',''NFS''); END'
Change it into:
,job_action => 'BEGIN PRC_DROP_ACQ_TXN(TO_DATE(''07-JAN-2012'',''DD-MON-YYYY ''),''NFSA'',''NFS''); END;'
user8731258
did that also..
but again the same error
begin

    DBMS_SCHEDULER.CREATE_JOB
            (
               job_name        => 'sfcia_drop_acq_txn_1'
              ,start_date      =>  sysdate
              ,repeat_interval => 'FREQ=DAILY; INTERVAL=1'
              ,end_date        => NULL
              ,job_class       => 'DEFAULT_JOB_CLASS'
              ,job_type        => 'STORED_PROCEDURE'
              ,job_action      => 'BEGIN PRC_DROP_ACQ_TXN(TO_DATE(''07-JAN-2012'',''DD-MON-YYYY ''),''NFSA'',''NFS''); END;'
              ,enabled         =>  TRUE
            );   
           
    end;
Hoek
OK, then try the following:
Change:
,job_type        => 'STORED_PROCEDURE'
into:
,job_type        => 'PLSQL_BLOCK'
SQL> begin
  2   
  3      DBMS_SCHEDULER.CREATE_JOB
  4              (
  5                 job_name        => 'sfcia_drop_acq_txn_1'
  6                ,start_date      =>  sysdate
  7                ,repeat_interval => 'FREQ=DAILY; INTERVAL=1'
  8                ,end_date        => NULL
  9                ,job_class       => 'DEFAULT_JOB_CLASS'
 10                ,job_type        => 'PLSQL_BLOCK'
 11                ,job_action      => 'BEGIN PRC_DROP_ACQ_TXN(TO_DATE(''07-JAN-2012'',''DD-MON-YYYY''),''NFSA'',''NFS''); END;'
 12                ,enabled         =>  TRUE
 13              );   
 14             
 15      end;
 16  /

PL/SQL procedure successfully completed.
user8731258
Yeahhh...It worked.
but then i am unable to understand
that when my action is stored procedure then why was it not working???

i had my

job_type => 'STORED_PROCEDURE'
,job_action => 'PRC_DROP_ACQ_TXN(TO_DATE(''07-JAN-2012'',''DD-MON-YYYY ''),''NFSA'',''NFS'')'
,enabled => TRUE
);

Edited by: user8731258 on Jun 19, 2012 4:49 AM
user8731258
Hi,

I ran the block but i am unable to see this job in user_jobs..
This job is not created...why???
Hoek
You must query user_scheduler_jobs, not user_jobs.
1 - 11
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 17 2012
Added on Jun 19 2012
11 comments
86,224 views