Oracle授予普通用户dblink创建、删除权限

1、sys用户登录查询sys的权限和普通权限。

sys用户权限

SQL> select * from user_sys_privs where privilege like upper('%DATABASE LINK%');

普通用户权限

SQL> select * from user_sys_privs where privilege like upper('%DATABASE LINK%') AND USERNAME='SJZXHD';
no rows selected
SQL>

2、授予普通用户创建和删除权限

SQL> grant create public database link,drop public database link to SJZXHD;
Grant succeeded.

SQL> commit;

3、查询授权后的信息

3.1 在sys下查询
SQL> select * from dba_sys_privs where privilege like upper('%DATABASE LINK%') AND GRANTEE ='SJZXHD';
GRANTEE     PRIVILEGE                                           ADM COM INH
--------------    --------------------------                             ---   ---   ---
SJZXHD        DROP PUBLIC DATABASE LINK            NO  NO  NO
SJZXHD        CREATE PUBLIC DATABASE LINK         NO  NO  NO
SQL>

或者登录普通用户下查询
SQL> select * from user_sys_privs where privilege like upper('%DATABASE LINK%') AND USERNAME='SJZXHD';

 

posted @ 2023-02-09 10:59  花之旭  阅读(1273)  评论(0编辑  收藏  举报