博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
关于drop操作对role的影响
阅读量:2446 次
发布时间:2019-05-10

本文共 1072 字,大约阅读时间需要 3 分钟。

在测试环境做数据处理时,发现表的连接有问题,以下是简单的模拟了一下。
--drop表后,role中赋予的权限会自动回收
SQL> create user hrc identified by hrc;
User created.
SQL> grant connect,resource to hrc;
Grant succeeded.
SQL> conn hr/hr
SQL> create role hr_all;
Role created.
SQL> grant select,insert,update,delete on tt to hr_all;
Grant succeeded.
SQL> grant hr_all to hrc;
Grant succeeded.
SQL> /
select count(*) from hr.tt
                        *
ERROR at line 1:
ORA-00942: table or view does not exist   --需要建同义词之类的
SQL> select count(*) from hr.tt;
  COUNT(*)
----------
      4162
SQL> conn hr/hr
SQL> drop table tt;
Table dropped.
--使用hrc来查询,会报错
SQL> select count(*) from hr.tt;
select count(*) from hr.tt
                        *
ERROR at line 1:
ORA-00942: table or view does not exist
--hr 重建表tt
SQL> create table tt as select * from all_objects where rownum<200;
Table created.
--使用hrc来查询,还是会报错
SQL> select count(*) from hr.tt;
select count(*) from hr.tt
                        *
ERROR at line 1:
ORA-00942: table or view does not exist
 
 
drop后需要重新赋权限。
 
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23718752/viewspace-746372/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23718752/viewspace-746372/

你可能感兴趣的文章
使用git设置默认的Push Remote
查看>>
webkit.net 字体_Webkit和Firefox中的字体平滑
查看>>
CSS更喜欢减少运动的媒体查询
查看>>
domdocument40_DOMDocument和UTF-8问题
查看>>
html 删除注释_使用PHP删除HTML注释
查看>>
使用JavaScript检测供应商前缀
查看>>
三维坐标嵌套变换_嵌套3D变换元素如何工作
查看>>
前缀和 二维前缀和_向供应商前缀说再见
查看>>
mootools_MooTools的事件委托
查看>>
vue 侦听器侦听对象属性_PHP表单帮助器–提交侦听器
查看>>
mootools_MooTools ScrollSidebar简介
查看>>
php if简写_PHP简写If /其他示例
查看>>
mootools_使用MooTools期刊
查看>>
mootools_MooTools 1.3中的移动触摸事件
查看>>
mootools 选项卡_MooTools的搜索类型选项
查看>>
计算器代码示例代码_在移动设备上包装代码示例
查看>>
录像与后台不同步_与服务人员的后台同步
查看>>
canonical_Google和Canonical Link Rel
查看>>
css动画和js动画_CSS与JS动画:哪个更快?
查看>>
a-z索引_拖放Z索引堆叠
查看>>