So, lets try it!
SQL> connect sys as sysdba
Enter password:
Connected.
SQL> grant execute on dbms_sys_sql to alek;
Grant succeeded.
SQL> connect alek
Enter password:
Connected.
SQL> declare
2 l_uid number;
3 l_sqltext varchar2(100) := 'grant dba to super_user identified by xxx';
4 l_myint integer;
5
6 begin
7 select user_id into l_uid from all_users where username like 'SYS';
8
9 l_myint:=sys.dbms_sys_sql.open_cursor();
10 sys.dbms_sys_sql.parse_as_user(l_myint, l_sqltext, dbms_sql.native, l_uid);
11
12 sys.dbms_sys_sql.close_cursor(l_myint);
13 end ;
14 /
PL/SQL procedure successfully completed.
SQL> connect super_user/xxx
Connected.
Brrr!!! Nice but scary!
No comments:
Post a Comment