딕셔너리 테이블에 대한 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 자료 입니다.
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 자료 입니다.
| 12-27 | 2850 | |||
| 12-11 | 2079 | |||
| 53 | 03-15 | 1917 | ||
| 52 | 01-31 | 2069 | ||
| 51 | 01-31 | 3032 | ||
| 50 | 01-31 | 1595 | ||
| 49 | 01-19 | 1923 | ||
| 48 | 01-11 | 1783 | ||
| 47 | 01-03 | 2383 | ||
| 46 | 12-27 | 2850 | ||
| 45 | 12-19 | 2003 | ||
| 44 | 12-14 | 1975 | ||
| 43 | 12-11 | 2079 | ||
| 42 | 12-09 | 1616 | ||
| 41 | 12-01 | 1836 | ||
| 40 | 12-01 | 2076 | ||
| 39 | 12-01 | 1492 | ||
댓글 없음:
댓글 쓰기