Grant 및 role(권한 및 롤) 관리
- 롤생성
create role rl_nctown_all;
create role rl_nctown_sel;
create role rl_nctown_exec;
- 권한부여(권한 -> 유저별)
grant delete,insert,update on 유저명.테이블 to 상대방유저;
grant select on 유저명.테이블 to 상대방유저;
grant excute on 유저명.테이블 to role이름;
- 권한부여(권한 -> 롤별)
grant excute on 유저명.테이블 to rl_nctown_all;
grant excute on 유저명.테이블 to rl_nctown_exec;
- 롤부여(롤 -> 유저별)
grant rl_nctown_all to user;
grant rl_nctown_sel to user;
grant rl_nctown_exec to user;
- 롤 조회(부여된 권한)
select * from dba_roles ;
select * from dba_tab_privs where table_name= 'EMP';
select * from dba_tab_privs where table_name= 'EMPLOYEES' ;
-- user에 부여된 system 권한
select * from user_sys_privs;
-- user에 부여된 object 권한
select * from user_tab_privs;
-- user에 부여된 role에, 부여된 system 권한
select * from role_sys_privs;
-- user에 부여된 role에, 부여된 object 권한
select * from role_tab_privs;