创建用户和设置密码
createusertestidentifiedbytest 123654;
允许用户连接权限
授权连接,资源到测试;
向用户询问权限
grantselectonabc.articlerestotest;
grant select on abc.PAGE to test;
grant select on abc.ISSUE to test;
grant select on abc.PAPER to test;
grant select on abc.ARTICLE to test;
允许test用户创建同义词权限
grant create synonym to test;
使用test登录创建同义词
createsynonymarticleforabc.article;
createsynonymarticleresforabc.articleres;
create synonym PAGE for abc.PAGE;
create synonym ISSUE for abc.ISSUE;
create synonym PAPER for abc.PAPER;
评论:
1、批量执行赋予多表查询权限的查询语句
选择' grantselecton '|| owner|| '.'|| object _ name|| ' to t1;'
from dba_objects
whereownerin('test ' ) )。
and object_type='TABLE ';
2、统一执行同义词检索语句的编写
select ' createorreplacesynonymmacs.'|| object _ name|| ' for '|| owner|. '|||object _ name |;'
from dba_objects
whereownerin('test ' ) )。
and object_type='TABLE ';