Oracle中授予权限的参数with admin option/with grant option的区别

Oracle中授予权限的参数with admin option/with grant option的区别

 

 

相同点:
    两个都可以既可以赋予user 权限时使用,也可以在赋予role 时用
GRANT CREATE SESSION TO emi WITH ADMIN OPTION。 

1、with admin option
with admin option的意思是:被授予该权限的用户有权将某个权限(如create any table)授予其他用户或角色,取消是不级联的。
如授予A系统权限create session with admin option,然后A又把create session权限授予B,但管理员收回A的create session权限时,B依然拥有create session的权限。但管理员可以显式收回B create session的权限,即直接revoke create session from B.

2、with grant option
with grant option的意思是:权限赋予/取消是级联的,如将with grant option用于对象授权时,被授予的用户也可把此对象权限授予其他用户或角色,不同的是但管理员收回用with grant option授权的用户对象权限时,权限会因传播而失效,如grant select on table with grant option to A,A用户把此权限授予B,但管理员收回A的权限时,B的权限也会失效,但管理员不可以直接收回B的SELECT ON TABLE 权限。

 

 

CREATE USER cedar IDENTIFIED BY cedar DEFAULT TABLESPACE CEDAR_DATA TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK; -- 5 Roles for cedar GRANT DBA TO cedar; GRANT RESOURCE TO cedar WITH ADMIN OPTION; GRANT AQ_ADMINISTRATOR_ROLE TO cedar; GRANT CONNECT TO cedar WITH ADMIN OPTION; GRANT AQ_USER_ROLE TO cedar; ALTER USER cedar DEFAULT ROLE ALL; -- 44 System Privileges for cedar GRANT CREATE ANY DIRECTORY TO cedar WITH ADMIN OPTION; GRANT CREATE PUBLIC SYNONYM TO cedar WITH ADMIN OPTION; GRANT EXECUTE ANY CLASS TO cedar WITH ADMIN OPTION; GRANT DROP ANY VIEW TO cedar WITH ADMIN OPTION; GRANT CREATE CLUSTER TO cedar; GRANT ALTER SYSTEM TO cedar; GRANT UPDATE ANY TABLE TO cedar; GRANT INSERT ANY TABLE TO cedar; GRANT LOCK ANY TABLE TO cedar; GRANT CREATE EXTERNAL JOB TO cedar WITH ADMIN OPTION; GRANT EXECUTE ANY PROGRAM TO cedar WITH ADMIN OPTION; GRANT CREATE JOB TO cedar WITH ADMIN OPTION; GRANT DROP ANY DIRECTORY TO cedar WITH ADMIN OPTION; GRANT ALTER ANY TRIGGER TO cedar; GRANT CREATE DATABASE LINK TO cedar; GRANT DROP ANY TABLE TO cedar WITH ADMIN OPTION; GRANT CREATE TABLE TO cedar WITH ADMIN OPTION; GRANT QUERY REWRITE TO cedar; GRANT ANALYZE ANY TO cedar; GRANT DROP ANY TRIGGER TO cedar; GRANT EXECUTE ANY PROCEDURE TO cedar; GRANT SELECT ANY TABLE TO cedar WITH ADMIN OPTION; GRANT ALTER ANY TABLE TO cedar; GRANT UNLIMITED TABLESPACE TO cedar WITH ADMIN OPTION; GRANT CREATE SESSION TO cedar; GRANT CREATE ANY TRIGGER TO cedar; GRANT DROP ANY PROCEDURE TO cedar WITH ADMIN OPTION; GRANT ALTER ANY PROCEDURE TO cedar; GRANT DROP PUBLIC SYNONYM TO cedar WITH ADMIN OPTION; GRANT DROP ANY SYNONYM TO cedar WITH ADMIN OPTION; GRANT MANAGE SCHEDULER TO cedar WITH ADMIN OPTION; GRANT CREATE ANY PROCEDURE TO cedar; GRANT CREATE PROCEDURE TO cedar WITH ADMIN OPTION; GRANT CREATE SEQUENCE TO cedar; GRANT CREATE VIEW TO cedar WITH ADMIN OPTION; GRANT CREATE SYNONYM TO cedar; GRANT DROP ANY INDEX TO cedar; GRANT DELETE ANY TABLE TO cedar; GRANT CREATE ANY TABLE TO cedar; GRANT CREATE ANY JOB TO cedar WITH ADMIN OPTION; GRANT SELECT ANY DICTIONARY TO cedar WITH ADMIN OPTION; GRANT CREATE ROLE TO cedar; GRANT CREATE ANY SYNONYM TO cedar WITH ADMIN OPTION; GRANT ALTER SESSION TO cedar WITH ADMIN OPTION; GRANT EXECUTE ON sys.dbms_aq TO cedar; GRANT EXECUTE ON sys.dbms_aqadm TO cedar; GRANT EXECUTE ON sys.dbms_network_acl_admin TO cedar; GRANT ALL ON sys.DBMS_LOCK TO cedar; 这个SQL在oracle 能用吗
最新发布
06-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值