Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why does one user without TABLE privileges get an ORA-01031: insufficient privileges but another get

RedWhiteNBlueApr 11 2020 — edited Apr 14 2020

I'm curious as to why 2 differnt users, both without any privileges on the same table get two different responses (errors) when attempting to view the data in the same table?

I will say this. I was testing how the chain of privileges is revoked from users prior to getting these two error responses. I don't know if that's just merely coincidence or not. But here's what I did. Each statement is separately executed in it's own session instance while all 3 sessions are connected to the database server.

USER1-SQL> GRANT ALL ON TABLE1 TO USER2 WITH GRANT OPTION;

USER2-SQL> GRANT ALL ON USER1.TABLE1 TO USER3;

USER1- SQ;L> REVOKE ALL ON TABLE1 FROM USER2; -- This revoked all privileges from both USER2 and USER3 which is what I was confirming.

So, that's the history of the statements between the 3 users. But now when USER2 tries to SELECT * FROM USER1.TABLE1 the response is ORA-01031: insufficient privileges. When USER3 tries to do the same, the response is ORA-00942: table or view does not exists.

Can somebody please explain the reason for the differences? Thank You!

This post has been answered by Paulzip on Apr 12 2020
Jump to Answer
Comments
Post Details
Added on Apr 11 2020
15 comments
13,615 views