Oracle 对象批量进行授权
环境:oracle
- 给用户多表只读权限
select 'grant select on '||owner||'.'||object_name||'' to 用户名;' from dba_objects where owner in (‘owner’) and object_type='TABLE';
- 批量创建多个同义词
SELECT 'create or replace SYNONYM 用户名.'||object_name||' FOR '||owner||'.'||object_name||';' from dba_objects where owner in (‘owner’) and object_type=’TABLE’;