您当前的位置: 首页 > 

关于under any table/view 权限的解释

发布时间:2019-08-05 18:08:08 ,浏览量:0

关于under any table/view 权限的解释

用户拥有这个权限之后,对其它用户下的对象如果存在的话会显示 权限不足,而不会显示 表或视图不存在了,废话少说,直接看例子吧:

C:\Users\Administrator>sqlplus sys/lhr@orclasm as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期三 9月 10 11:10:20 2014

Copyright (c) 1982, 2010, Oracle. All rights reserved.

连接到:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

SQL> select * from v$version;

BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

PL/SQL Release 11.2.0.3.0 - Production

CORE 11.2.0.3.0 Production

TNS for Linux: Version 11.2.0.3.0 - Production

NLSRTL Version 11.2.0.3.0 - Production

---回收scott用户的2个权限

SQL> revoke under any table from scott;

撤销成功。

SQL> revoke under any view from scott;

撤销成功。

--查看lhr用户下的表products_lhr和视图vw_tmp_lhr,不存在表ttttttt

SQL> conn lhr/lhr@orclasm

已连接。

SQL> select count(1) from lhr.products_lhr;

COUNT(1)

----------

0

SQL> select count(1) from lhr.vw_tmp_lhr;

COUNT(1)

----------

0

SQL> select * from lhr.ttttttt;

select * from lhr.ttttttt

*

第 1 行出现错误:

ORA-00942: 表或视图不存在

--使用scott用户来查看lhr用户下的表products_lhr和视图vw_tmp_lhr,不存在表ttttttt

---这里的错误为 不存在

SQL> conn scott/tiger@orclasm

已连接。

SQL> select count(1) from lhr.products_lhr;

select count(1) from lhr.products_lhr

*

第 1 行出现错误:

ORA-00942: 表或视图不存在

SQL> select count(1) from lhr.vw_tmp_lhr;

select count(1) from lhr.vw_tmp_lhr

*

第 1 行出现错误:

ORA-00942: 表或视图不存在

--- 使用sys用户对scott用户授权

SQL> conn sys/lhr@orclasm

已连接。

SQL> grant under any table to scott;

授权成功。

---使用scott用户查询,错误变为了权限不足,至此大家就明白了这个权限的干啥用的了

SQL> conn scott/tiger@orclasm

已连接。

SQL> select count(1) from lhr.products_lhr;

select count(1) from lhr.products_lhr

*

第 1 行出现错误:

ORA-01031: 权限不足

SQL> select count(1) from lhr.vw_tmp_lhr;

select count(1) from lhr.vw_tmp_lhr

*

第 1 行出现错误:

ORA-00942: 表或视图不存在

SQL> conn sys/lhr@orclasm as sysdba

已连接。

SQL> grant under any view to scott;

授权成功。

SQL> conn scott/tiger@orclasm

已连接。

SQL> select count(1) from lhr.vw_tmp_lhr;

select count(1) from lhr.vw_tmp_lhr

*

第 1 行出现错误:

ORA-01031: 权限不足

SQL> select * from lhr.ttttttt;

select * from lhr.ttttttt

*

第 1 行出现错误:

ORA-00942: 表或视图不存在

SQL>

关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    107766博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0713s