Granting Rights on Stored Procedure to another user of Oracle

Basmah picture Basmah · Nov 29, 2010 · Viewed 153.1k times · Source

I am a student of Undergraduate studies , and I am facing little problem in granting rights of ownership to a user A to a stored procedure being owned by user B in database Oracle 10g mode =xe.

Please help me in writing sql commands for granting rights of ownership on stored procedure xyz to another user A.

Answer

Justin Cave picture Justin Cave · Nov 29, 2010

I'm not sure that I understand what you mean by "rights of ownership".

If User B owns a stored procedure, User B can grant User A permission to run the stored procedure

GRANT EXECUTE ON b.procedure_name TO a

User A would then call the procedure using the fully qualified name, i.e.

BEGIN
  b.procedure_name( <<list of parameters>> );
END;

Alternately, User A can create a synonym in order to avoid having to use the fully qualified procedure name.

CREATE SYNONYM procedure_name FOR b.procedure_name;

BEGIN
  procedure_name( <<list of parameters>> );
END;