Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 622
Andy5 Avatar asked Feb 25 '12 19:02

Andy5


People also ask

How do I grant a user?

Database-Specific Privileges To GRANT ALL privileges to a user , allowing that user full control over a specific database , use the following syntax: mysql> GRANT ALL PRIVILEGES ON database_name. * TO 'username'@'localhost';

How do I grant permission to user in SQL?

To grant permissions for the user, switch to the Object Permissions tab. In the Objects block, select the database object on which you want to grant privileges. In the Available Privileges block, select the permissions to be assigned and click Save.


1 Answers

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.

like image 132
cagcowboy Avatar answered Sep 20 '22 12:09

cagcowboy