Search code examples
oracle-databasedatabase-administration

Which Oracle privilege implicitly grant access to other schemas


I know IMP_FULL_DATABASE can let current schema to access tables from other schema

Is there any other privileges do the same?


Solution

  • To grant tables from one schema to other, you have to develop the script:

    Login as schema from which you want to grant

    begin
      for i in (select * from user_tables)
      loop
        execute immediate 'grant select, insert, update, delete on ' || i.table_name || ' to <target_schema>';
      end loop;
    end;
    /
    

    <target_schema> is the target user to which grants have to be given. Above script grants select, insert, update, delete on all tables from the schema you logged in to <target_schema>. Replace <target_schema> with the schema name you want to grant to.