I’m assuming that it CAN be done, I just don’t know how or haven’t been able to find a way to do it.
In Oracle, can access to the ALL_* tables and USER_* tables be revoked, including select grants.
For example, the all_objects, all_procedures views. Can access to these be restricted?
The same goes for user_tables and user_procedures and any other user_* views. Can access to them be restricted?
No, you can’t (reasonably) prevent users from being able to query the
ALL_*orUSER_*views. You could go through and individually revoke access to each and every one of these views fromPUBLICbut that would be a rather painful effort to go through, it would cause all sorts of applications to break not to mention breaking scripts from Oracle. You would end up, at a minimum, re-granting access to those views to any account that connected to the database because every database API interrogates the data dictionary views. Whether you have an ODBC application, a JDBC application, a PL/SQL IDE like TOAD or SQL Developer, or just about anything else, those applications will need to query the data dictionary.The data that they will see in either view, however, will be limited to the objects that they have access to (for the
ALL_*views) or the objects that they own (for theUSER_*views). What purpose would be served by restricting a user’s ability to query the data dictionary to determine what objects the user owns or what objects the user has access to? It would seem extremely odd to want a user to own a table but then to not allow the user to know that he owned that table.Now, if you are really determined, you can create objects in the user’s schema (tables or views) named, say,
ALL_TABLESorUSER_TABLES. Assuming that the user just queriesALL_TABLESrather than specifying a fully qualifiedSYS.ALL_TABLES, they will be querying the local object not the data dictionary view. That is generally a very inadvisable thing to do– lots of products work by querying the data dictionary so causing the data dictionary queries to return the wrong set of data can lead to all sorts of bugs that are terribly hard to track down. But it is an option if you really, really want to restrict what data is returned from the data dictionary.