How to create a user in Oracle 11g and grant permissions

Andy5 picture Andy5 · Feb 25, 2012 · Viewed 544.2k times · Source

Can someone advise me on how to create a user in Oracle 11g and only grant that user the ability only to execute one particular stored procedure and the tables in that procedure.

I am not really sure how to do this!

Answer

cagcowboy picture cagcowboy · Feb 25, 2012

Connect as SYSTEM.

CREATE USER username IDENTIFIED BY apassword;

GRANT CONNECT TO username;

GRANT EXECUTE on schema.procedure TO username;

You may also need to:

GRANT SELECT [, INSERT] [, UPDATE] [, DELETE] on schema.table TO username;

to whichever tables the procedure uses.