The authid definer rights is the opposite of the
clause. Essentially the same as the "grant execute:" clause"
the authid definer rights allows the specified users' grants
to be used for privileges within Oracle.
Oracle needs to know explicitly what kind of privileges
to use when executing the stored procedure. The way to let
Oracle know that is to use AUTHID keyword in the CREATE OR
If you want the same level of privileges as the "grant
execute privilege"(i.e. the creator of the procedure), you
use AUTHID DEFINER. Conversely, if you want Oracle to use
the privileges of the user currently running the stored
procedure, you want to use AUTHID CURRENT_USER.
The use of definer rights are available in stored
procedure, functions and type definitions. Here we definer a
procedure with definer rights. Note that definer is
the default argument when using the authid clause:
create or replace
as . . . .
The above definer rights clause would be equivalent to
this grant execute statement:
grant execute on myproc to public;
In this example, we set the type to have definer
CREATE TYPE address_t
AS OBJECT (
WARNING: Writing PL/SQL code with the
default authid definer, can
injection attacks, because an intruder would get
privileges that they would not get if they used authid