对于一些管理的脚本,我们平时要注意收集,遇到相关问题拿过来执行一下就OK,下面是一个批量授权的脚本分享给大家。
begin
for grant_sql in (
select 'grant select,insert,update,delete on scott.' || table_name || ' to SH' exe_sql
from all_tables t
where t.owner = 'SCOTT'
)
loop
execute immediate grant_sql.exe_sql;
end loop;
end;