oracle 将a用户权限赋给b用户
也是从CSDN上找来的.....
1).logon as grantor, for instance USER1 2). run PL/SQL scripts: DECLARE p_grantee VARCHAR2(30):='ywxt_module_admin'; BEGIN FOR rec IN (SELECT object_name, object_type , DECODE (object_type, 'TABLE', 'ALL', 'VIEW', 'SELECT', 'EXECUTE') grant_type FROM user_objects) LOOP BEGIN EXECUTE IMMEDIATE 'grant all on ' || rec.object_name || ' to ' || p_grantee; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(SUBSTR (SQLERRM,1,240)); END; END LOOP; END; /
|