사용자 A 가 사용하는 테이블에 대해서 사용자 B 가 접근할수 있도록 synonym 을
걸어서 사용하고 있습니다.
근데 A 가 사용하고 있는 모든 Function 에 대해서 B 가 사용할수 있도록
권한을 주라고 하네요. Function 이 현재 100 개 정도 되는데
하나 하나 주기는 귀찮고..ㅜ.ㅜ
한꺼번에 줄수 있는 방법이 있을까요?
prompt +--------------------------------------------------------+prompt prompt grant one schema's function excution to another schema promptprompt ※주의 : DBA 유저로 로그인하여 실행할것 prompt +--------------------------------------------------------+
ACCEPT v_sppath prompt "type the spool filename with path[ex : /home/oracle/spool.sql] :"ACCEPT v_owner prompt "type the grantor username(functions owner) :"ACCEPT v_pass prompt "type the grantor password(f owner password) :"ACCEPT v_tns prompt "type the host string(the tnsname) :"ACCEPT v_grantee prompt "type the grantee username [ex : scott] :"
set headin offset verify offset feedback offset pagesize 0
spool &v_sppath
select 'GRANT EXECUTE ON '||owner||'.'||object_name ||' TO ' ||UPPER('&v_grantee')||';' from dba_objects where owner=UPPER('&v_owner') and object_type='FUNCTION';
spool off
connect &v_owner/&v_pass@&v_tns@&v_sppath
set pagesize 1000set feedback onset verify onset heading on
exit