HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Grant to one; then revoke from all: does it work in Oracle SQL?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
oracleallsqlgrantrevokeoneworkthendoesfrom

Problem

Consider the following:

  • grant select on books to frank.



  • revoke select on books from public.



At the end of executing the above SQL script, will frank have 'select' access to the 'books' table?

Solution

Yes, frank will be able to perform a select on books. Basically Oracle will use the most permissive privilege, which is the one allowing selection.

Reference: Documentation (under roles).

Note that this is different from you granting privileges with admin option to UserB, who in turn grants privileges to UserC. In this case revoking privileges from UserB would automatically "cascade" revoke them from UserC.

Context

StackExchange Database Administrators Q#9438, answer score: 2

Revisions (0)

No revisions yet.