Why can't I grant exec on dbms_lock.sleep() OR create a procedure using it (but I can run it fine on its own)
- by Richard Green
I am trying to write a small bit of PL/SQL that has a non-CPU burning sleep in it.
The following works in sqldeveloper
begin
dbms_lock.sleep(5);
end;
BUT (as the same user), I can't do the following:
create or replace
procedure sleep(seconds in number)
is
begin
dbms_lock.sleep(seconds);
end;
without the error "identifer "DBMS_LOCK" must be declared... Funny as I could run it without a procedure.
Just as strange, when I log in as a DBA, I can run the command
grant exec on dbms_lock to public;
and I get
ERROR at line 1:
ORA-00990: missing or invalid privilege
This is oracle version "Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production"