Welcome 微信登录

首页 / 数据库 / MySQL / PL/SQL: ORA-00942: table or view does not exist

有两个用户jytest,jytest1都拥有dba权限在jytest1用户创建了一个表testcreate user jytest identified by "jytest"default tablespace users temporary tablespace temp; 
grant dba to jytest;grant resource  to jytest;grant connect to jytest; 
create user jytest1 identified by "jytest1"default tablespace users temporary tablespace temp; 
grant dba to jytest1;grant resource  to jytest1;grant connect to jytest1; 
create table jytest1.test(userid number(20)); 
SQL> select a.owner,a.object_name,a.object_type from dba_objects a where a.object_id=52603; 
OWNER                          OBJECT_NAME                       OBJECT_TYPE------------------------------ ----------------------------------- -------------------JYTEST1                        TEST                               TABLE在用户jytest下可以直接查询jytest1.test表但是在jytest下创建一个过程,在过程中引用jytest1.test表编译不通过.在过程中引用别的用户对象不能通过role权限来访问,要通过对象授权才能在过程中访问SQL> alter session set events "10046 trace name context forever,level 12";Session alteredSQL> select * from jytest1.test; 
             USERID--------------------- 
SQL> alter session set events "10046 trace name context off"; 
Session altered 
它的跟踪文件中显示的记录部分信息如下:select col#, grantee#, privilege#,max(mod(nvl(option$,0),2)) from objauth$ where obj#=:1 and col# is not null group by privilege#, col#, grantee# order by col#, grantee#END OF STMTPARSE #2:c=0,e=86,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=1355777810000085BINDS #2:kkscoacd Bind#0  acdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00  acflg=08 fl2=0001 frm=00 csi=00 siz=24 ff=0  kxsbbbfp=b7f47498  bln=22  avl=04  flg=05  value=52603上面的操作显示了用户jytest在执行select * from jytest1.test查询时会查询jytest用户对jytest1.test表是否有select权限 
  select con#,obj#,rcon#,enabled,nvl(defer,0) from cdef$ where robj#=:1END OF STMTPARSE #4:c=0,e=55,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=1355777810001339BINDS #4:kkscoacd Bind#0  acdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00  acflg=08 fl2=0001 frm=00 csi=00 siz=24 ff=0  kxsbbbfp=b7ecffb8  bln=22  avl=04  flg=05  value=52603 
上面的查询是查询jytest1.test表中的列的定义
  • 1
  • 2
  • 3
  • 4
  • 5
  • 下一页
Oracle的回闪查询Oracle自定义过程来获得完整的sql语句相关资讯      PL/SQL  ORA-00942 
  • PL/SQL之存储过程和函数  (今 14:09)
  • PL/SQL Developer连接本地Oracle   (07月27日)
  • 【PL/SQL系列】Oracle存储过程使用  (04月23日)
  • PL/SQL Developer 使用技巧分享  (09月16日)
  • PL/SQL实现Java中的split()方法的  (07月10日)
  • 从一个案例看PL/SQL代码片的编译与  (03月04日)
本文评论 查看全部评论 (0)
表情: 姓名: 字数