1、所有表表查询权限赋予
使用管理员账号登入,v_from 表用户 v_to 给权限用户
1 create or replace procedure test(v_from in varchar2, v_to in varchar2) is
2 v_sql varchar2(1000);
3 cursor v_cur is
4 select t.* from dba_tables t where t.OWNER = v_from;
5
6 begin
7 for v_row in v_cur loop
8 v_sql := ‘grant select on ’ || v_from || ‘.’ || v_row.table_name ||
9 ’ to ’ || v_to;
10 execute immediate v_sql;
11 end loop;
12 end test;
某一张表查询权限赋予
该表用户登入
grant select on A to oa1;