Bo's Oracle Station

查看: 1271|回复: 0

2014-07-09-plsqldeveloper.sql

[复制链接]

75

主题

115

帖子

2772

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2772
发表于 2014-7-14 17:16:50 | 显示全部楼层 |阅读模式
select  * from dba_sys_privs  sp where sp.grantee in ('HR', 'OPS$ORACLE','SH') order by 1;

select  * from dba_tab_privs tp where tp.grantee in ('HR', 'OPS$ORACLE','SH');

select  * from dbA_role_privs rp where rp.grantee in  ('HR', 'OPS$ORACLE','SH');

alter user sh identified by oracle_4U account unlock;

select  * from dba_roles order by 1;

create role r1 ;

select *  from role_tab_privs rtp where rtp.role='R1';


select * from dba_roles r where r.role  in ('CONNECT','RESOURCE','SELECT_CATALOG_ROLE','SCHEDULER_ADMIN','DBA','R1','R2');

create role r2;

grant select  on sh.channels  to r2 ;

grant r2 to r1;

select *  from role_role_privs  rrp where rrp.role='R1';

select * from dba_roles r where r.role  in ('CONNECT','RESOURCE','SELECT_CATALOG_ROLE','SCHEDULER_ADMIN','DBA','R1','R2');


select  * from dbA_role_privs rp where rp.grantee in  ('HR', 'OPS$ORACLE','SH');

grant r1 to hr;



select  * from dbA_role_privs rp where rp.grantee in  ('HR', 'OPS$ORACLE','SH');

alter user hr default role RESOURCE,SELECT_CATALOG_ROLE;

alter user hr default role none;

alter user hr default role all;

create role r3 identified by oracle_4U  ;

grant select  on sh.costs  to r3 ;

grant r3 to hr;

select  * from dbA_role_privs rp where rp.grantee ='HR';
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-12-5 10:23 , Processed in 0.030525 second(s), 24 queries .

快速回复 返回顶部 返回列表