When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was created. If I execute the view's SQL Statement it works. What am I missing?
ORA-01031: insufficient privileges Solution: Go to Your System User. then Write This Code: SQL> grant dba to UserName; //Put This username which user show this error message. Grant succeeded.
You see the Insufficient Privileges error if you don't have the right access on different levels. For example, your profile prevents you from accessing the account object, or your role prevents you from accessing a case record.
ORA-01031 Error Message “Insufficient Privileges” Error ORA-01031 means you are attempting to execute an operation for which you do not have appropriate privileges.
Finally I got it to work. Steve's answer is right but not for all cases. It fails when that view is being executed from a third schema. For that to work you have to add the grant option:
GRANT SELECT ON [TABLE_NAME] TO [READ_USERNAME] WITH GRANT OPTION;
That way, [READ_USERNAME]
can also grant select privilege over the view to another schema
As the table owner you need to grant SELECT access on the underlying tables to the user you are running the SELECT statement as.
grant SELECT on TABLE_NAME to READ_USERNAME;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With