Chinaunix首页 | 论坛 | 博客
  • 博客访问: 396895
  • 博文数量: 88
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 1054
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-07 12:23
文章分类
文章存档

2014年(88)

我的朋友

分类: Oracle

2014-06-17 14:31:10

在测试环境做数据处理时,发现表的连接有问题,以下是简单的模拟了一下。
--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后需要重新赋权限。
 
 
阅读(891) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~