Grant and Revoke privileges

Your rating: None Average: 5 (1 vote)

Typically in a database you have many users.

The owner shcema that owns the objects, usually decides the privileges given to other users on the objects it owns.

Lets call the schema owner "OWNER" and suppose we have another user in the database called "READER".

For the user "READER" to be able to view the data in a table owned by "OWNER", the owner has to grant the reader select priviliges.

GRANT SELECT ON <table name> TO READER;

Similarly the owner can grant insert,update, delete, etc privileges on a certain object to other users in the database.

To take away a certain privilege from a user

REVOKE INSERT ON <Table name> FROM READER;

Unless a user has select privileges on an object owned by another schema, or that object has a synonym created, the user will not be able to access that object.

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.

Post new comment

CAPTCHA
The question below is to prevent automated spam submissions.
8 + 11 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.