• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

PL/SQL: ORA-00942: table or view does not exist

mysql 搞代码 4年前 (2022-01-09) 23次浏览 已收录 0个评论

在用户jytest下可以直接查询jytest1.test表但是在jytest下创建一个过程,在过程中引用jytest1.test表编译不通过.在过程中引用别的

有两个用户jytest,jytest1都拥有dba权限在jytest1用户创建了一个表test

create 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 altered

SQL> 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=本文来源gaodaima#com搞(代@码$网652603

上面的查询是查询jytest1.test表中的列的定义


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:PL/SQL: ORA-00942: table or view does not exist

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址