Oracle檢視授權(with grant option)
今天領導讓我給一個使用者授權幾個檢視的查詢許可權
遇到了一點小意外.還是基本功不紮實啊
模擬如下
create user a identified by a;
create user b identified by b;
create user c identified by c;
grant connect,resource to a;
grant connect,resource to b;
grant connect,resource to c;
grant create view to b;
conn a/a
create table t1 as select rownum rn from dual connect by level<10;
grant select on t1 to b;
conn b/b
create table t2 as select rownum rn from dual connect by level<10;
create view v1 as select * from a.t1 union all select * from t2;
grant select on v1 to c;
conn c/c
select * from b.v1;
使用者a有一個基表,
使用者b有使用者a基表的查詢許可權,並建立了一個檢視,
現在需要把使用者b建立的檢視,授權給使用者c.
實際上grant select on v1 to c;命令執行會報錯(ORA-01720).
那是因為a.t1的查詢授權不能傳遞.
解決這個問題也很容易,在給b使用者a.t1的授權中增加with grant option
create user a identified by a;
create user b identified by b;
create user c identified by c;
grant connect,resource to a;
grant connect,resource to b;
grant connect,resource to c;
grant create view to b;
conn a/a
create table t1 as select rownum rn from dual connect by level<10;
grant select on t1 to b with grant option;
conn b/b
create table t2 as select rownum rn from dual connect by level<10;
create view v1 as select * from a.t1 union all select * from t2;
grant select on v1 to c;
conn c/c
select * from b.v1;
遇到了一點小意外.還是基本功不紮實啊
模擬如下
create user a identified by a;
create user b identified by b;
create user c identified by c;
grant connect,resource to a;
grant connect,resource to b;
grant connect,resource to c;
grant create view to b;
conn a/a
create table t1 as select rownum rn from dual connect by level<10;
grant select on t1 to b;
conn b/b
create table t2 as select rownum rn from dual connect by level<10;
create view v1 as select * from a.t1 union all select * from t2;
grant select on v1 to c;
conn c/c
select * from b.v1;
使用者a有一個基表,
使用者b有使用者a基表的查詢許可權,並建立了一個檢視,
現在需要把使用者b建立的檢視,授權給使用者c.
實際上grant select on v1 to c;命令執行會報錯(ORA-01720).
那是因為a.t1的查詢授權不能傳遞.
解決這個問題也很容易,在給b使用者a.t1的授權中增加with grant option
create user a identified by a;
create user b identified by b;
create user c identified by c;
grant connect,resource to a;
grant connect,resource to b;
grant connect,resource to c;
grant create view to b;
conn a/a
create table t1 as select rownum rn from dual connect by level<10;
grant select on t1 to b with grant option;
conn b/b
create table t2 as select rownum rn from dual connect by level<10;
create view v1 as select * from a.t1 union all select * from t2;
grant select on v1 to c;
conn c/c
select * from b.v1;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29254281/viewspace-1299022/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle grant 授權語句Oracle
- 關於GRANT賦權時,WITH GRANT OPTION和WITH ADMIN OPTION的使用
- grant with admin/grant option
- v檢視的授權
- 關於WITH GRANT OPTION
- with grant option與with admin option區別
- 淺談MySQL中授權(grant)和撤銷授權(revoke)用法詳解MySql
- 【檢視】with check option
- Oracle 許可權(grant、revoke)Oracle
- Oracle建立表空間、建立使用者、授權、授權物件的訪問以及檢視許可權集合Oracle物件
- Oracle 建立表空間、建立使用者以及授權、檢視許可權Oracle
- oracle 建立檢視用 with check option 子句詳解Oracle
- mysql操作命令梳理(4)-grant授權和revoke回收許可權MySql
- the --skip-grant-tables option so it cannot
- Oracle users / 許可權 / grant privOracle
- oracle授權Oracle
- Oracle檢視許可權Oracle
- 如何檢視資料庫中的授權資訊資料庫
- oracle受權與回收許可權grant和revokeOracle
- oracle顯式授權和隱式授權Oracle
- Oracle ORA - 01720 grant option does not exist for..報錯解決Oracle
- oracle許可權相關檢視Oracle
- oracle常見受權與回收許可權 grant和revokeOracle
- Oracle建立使用者並給使用者授權查詢指定表或檢視的許可權Oracle
- 皕傑報表之如何檢視授權的使用時限
- Oracle檢視使用者許可權Oracle
- 檢視oracle 使用者許可權Oracle
- MySQL使用GRANT授權某使用者瀏覽和修改表許可權操作一例MySql
- 檢視中with check option的作用是什麼?
- oracle的儲存許可權的檢視Oracle
- 授權某使用者,檢視動態效能檢視的許可權(如v$latch,v$lock,v$sqlarea,v$sql,v$sysstat)SQL
- 微信網頁授權視訊教程網頁
- 在ASP.NET中基於Owin OAuth使用Client Credentials Grant授權發放TokenASP.NETOAuthclient
- Oracle許可權(二)許可權相關的動態效能檢視與資料字典檢視Oracle
- Oracle Grant / REVOKE 正解Oracle
- Oracle使用者、授權、角色管理Oracle
- oracle建立使用者並授權Oracle
- Oracle建立使用者和授權Oracle