ORA-01031: insufficient privileges

oracle stored procedure execution error

create or replace procedure test1as sql1 varchar2 ( 4000); no_result exception; begin sql1: = 'update oa.test set id = 1'; execute immediate sql1; commit; exception when no_result then dbms_output.put_line ( 'error'); end;
this stored procedure is used to update a user table, and then log on to perform OANEWPLATDJ Times

ORA-01031: insufficient privileges
ORA-06512: at "OANEWPLATDJ.TEST1", line8
ORA-06512: at line 3

Baidu, the

There are two ways to solve: First, when you create a stored procedure increased Authid Current_User If, after the name of the stored procedure
create or replace procedure tt_senquence Authid Current_User is ...
 
Second, the display gives the user the relevant system privileges, such as:
Grant to Update the Table & the any user_name ;
Grant & insesrt to the any USER_NAME Table;

Both methods have advantages and disadvantages;
first process without displaying various system privileges granted, more convenient.
But if you call the stored procedure in the job will be in the report ORA-01031: insufficient privileges error.

The second method: although the trouble, but you can call a stored procedure to solve the job problem.

Guess you like

Origin www.cnblogs.com/cainiaoputeng/p/12103554.html