2014년 12월 15일 월요일

Dictionary Table에 SELECT 권한 주기[오라클자바커뮤니티/빅데이터/오라클/PLSQL/SQL쿼리/SQL튜닝실무교육/SQL기초교육]

딕셔너리 테이블에 대한 SELECT 권한을 주고 싶은데... 

select any table 권한을 부여하기는 싫은 경우 다음과 같은 SQL을 이용합니다. 

========================================================================== 

-- grantdd.sql 

connect / as sysdba 

create or replace procedure sysgrants(myuser varchar2) 
is 
c integer; 
cmd varchar2(2000); 

begin 
    c := DBMS_SQL.OPEN_CURSOR; 
    for r in (select object_name from user_objects 
              where object_type = 'VIEW') 
    loop 
      cmd := 'grant select on "' || r.object_name || '" to ' || myuser; 
      DBMS_SQL.PARSE(c, cmd, dbms_sql.native); 
    end loop; 
    DBMS_SQL.CLOSE_CURSOR(c); 
end; 


create user operator identified by &&operators_passwd temporary tablespace temp; 
grant connect to operator; 

exec sysgrants('operator'); 

-- This step may take a while. 

-- And how to revoke these privileges from operator ? 

create or replace procedure sysrevokes(myuser varchar2) 
is 
c integer; 
cmd varchar2(2000); 

begin 
    c := DBMS_SQL.OPEN_CURSOR; 
    for r in (select object_name from user_objects 
              where object_type = 'VIEW') 
    loop 
      cmd := 'revoke select on "' || r.object_name || '" from ' || myuser; 
      DBMS_SQL.PARSE( c, cmd, dbms_sql.native ); 
    end loop; 
    DBMS_SQL.CLOSE_CURSOR(c); 
end; 




------------------------------------ 

SQL> @grantdd 

Procedure created. 

Enter value for operators_passwd: operator 
old  1: create user operator identified by &&operators_passwd temporary tablesp 
ace temp 
new  1: create user operator identified by operator temporary tablespace temp 

User created. 

Grant succeeded. 

PL/SQL procedure successfully completed. 

Procedure created. 

SQL>              

METALINK 자료 입니다. 



 [100%환급,실무전문]SQL/빅데이터/자바/스프링/웹퍼블리싱/안드…오라클자바…12-272850
 [채용확정무료교육]오라클자바개발잘하는신입뽑기2개월과정,교육…오라클자바…12-112079
53 [평일100%환급7건]웹퍼블리싱,자바&JSP,안드로이드,C#닷넷,SQL기… 오라클자바…03-151917
52 [주말]C#,ASP.NET마스터 오라클자바…01-312069
51 [기업100%환급,평일주간]SQL기초에서스키마오브젝트,PLSQL,힌트… 오라클자바…01-313032
50 [주말주간]자바&웹,jQUERY,스프링프레임워크,마이바티스 오라클자바…01-311595
49 [평일주간/야간,주말주간/야간]Spring,MyBatis,Hibernate개발자… 오라클자바…01-191923
48 [평일주간/야간,주말주간/야간]안드로이드개발자과정(Adnroid 교… 오라클자바…01-111783
47 [평일야간,주말주간야간]JAVA,Network&JSP&Spring,MyBatis,Hiber… 오라클자바…01-032383
46 [100%환급,실무전문]SQL/빅데이터/자바/스프링/웹퍼블리싱/안드… 오라클자바…12-272850
45 [주말야간]개발자를위한PLSQL,SQL튜닝,힌트(토/일) 오라클자바…12-192003
44 [평일주간/야간,주말주간/야간]웹퍼블리싱 마스터(HTML5,CSS3,jQ… 오라클자바…12-141975
43 [채용확정무료교육]오라클자바개발잘하는신입뽑기2개월과정,교육… 오라클자바…12-112079
42 [주말야간]JAVA,JSP,Spring,PLSQL,힌트,웹퍼블리싱,안드로이드,… 오라클자바…12-091616
41 [평일야간,주말야간]닷넷(C#,Network,ADO.NET,ASP.NET)마스터 오라클자바…12-011836
40 [기업100%환급]오라클&자바웹스프링신입과정3주(SQL,JAVA,JSP,Se… 오라클자바…12-012076
39 [평일야간,주말]SQL기초에서실무까지(SQL기초,PLSQL,힌트,튜닝) 오라클자바…12-011492

댓글 없음:

댓글 쓰기