[Command]사용자 권한 확인 및 주기
CI계정 권한 확인
POSTPROD@ADT1> select * from user_sys_privs;
USERNAME PRIVILEGE ADMIN_OPT
-------------------- ------------------------------------------------------------------------------------------------------------------------ ---------
POSTPROD CREATE VIEW NO
POSTPROD CREATE SESSION NO
POSTPROD UNLIMITED TABLESPACE NO
POSTPROD@ADT1> select * from user_role_privs;
USERNAME GRANTED_ROLE ADMIN_OPT DEFAULT_R OS_GRANTE
-------------------- ------------------------------------------------------------------------------------------ --------- --------- ---------
POSTPROD CONNECT NO YES NO
POSTPROD RESOURCE NO YES NO
일반적으로 sys나 system만이 조회할 수 있는 v$session이나 v$process등을 일반 유저에게도 조회할 수 있도록 권한을 부여해보자
먼저, v$session 에 대한 select 권한 부여하기
v$session 은 synonym,
x$view → v_$view → v$view
이와 같은 절차로 내부적으로 생성된다.
즉, v$view 는 접근할 수 있는 권한을 가질 수(부여받을 수) 없다.
(ORA-02030: can only select from fixed tables/views)
하지만, v_$view 를 통해 권한을 부여할 수 있다.
즉, sys 계정에서
grant select on v_$session to scott;
scott 계정에서
select * from v$session;
grant select on v_$session to scott;
grant select on v_$process to scott;
grant select on v_$database to scott;
grant select on v_$lock to scott;
grant select on v_$locked_object to scott;
grant select on v_$OPEN_CURSOR to scott;
grant select on v_$sqltext to scott;
grant select on dba_objects to scott;
출처: http://koreantramp.tistory.com/254
http://blog.naver.com/min9888596?Redirect=Log&logNo=20099772599