Question

User1 grants Select, Delete permissions on a Table(which has index say TableIndex) to a user2.

I can see that the user2 is not able to see the index existing on that table though.

User2 runs this SQL:

select DBMS_METADATA.GET_DDL('INDEX','TableIndex') from DUAL;
Result is:  The specified object was not found in the database.

When User2 executes Select SQL Queries on the Table, i hope Index will be used, without any further grants (altho index is not visible)?

Était-ce utile?

La solution

in order to use dbms_metadata.get_ddl you need select_catalog_role granted to user2 (see here). But the index will be used (where applicable/possible) even though you cannot see it.

Autres conseils

There is no such thing as an "index permission".

We grant permissions on tables, because we can run DML against them - select, update, delete, etc. But we don't execute such operations on indexes, and so there is nothing to grant.

The fact that USER2 cannot see the DDL to create the indexes on User1's tables is quite right. It's none of their business. User2 selects from the table and that query will make use of any appropriate indexes User1 has created.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top