Search code examples
selectoracle11gsql-grant

Grant SELECT on multiple tables oracle


I have 3 tables table1,table2,table3. I want to grant(select for example) these tables to a user, user1.

I know that I can grant with:

grant select on table1 to user1;
grant select on table2 to user1;
grant select on table3 to user1;

Can I grant the 3 tables to user1 using only 1 query?

Thanks


Solution

  • No. As the documentation shows, you can only grant access to one object at a time.


    Oracle Database 23c has extended grant to allow you to give one user access to all tables in another schema:

    grant select any table
      on schema table_owner
      to query_user;