ORA-01031 insufficient privileges
After userA creates a procedure and grants to userB, the userB cannot use the procedure.
It was on an Oracle 10.2.0.4 for Windows32bit. It works at another Oracle database (11g R1 on Windows 2008 64bit) . Thank you!
1. userA on SQL*Plus
CREATE OR REPLACE PROCEDURE proc1 (p_user IN VARCHAR2, p_pass IN VARCHAR2) IS
BEGIN
execute immediate 'alter user '||p_user||' identified by '||p_pass;
END;
create user userB identified by userB_pwd;
grant connect,resource to userB;
grant execute on proc1 to userB;
2. userB on SQL*Plus
execute userA.proc1('USERB', 'new_pwd');
BEGIN userA.proc1('USERB, 'new_pwd); END;