How can public_dependency contain references to objects not in all_objects?

本秂侑毒 提交于 2019-12-11 12:39:12

问题


I have the query below:

select * from public_dependency  pd 
where REFERENCED_OBJECT_ID = 305318

The strange thing is that this returns 26 rows. When I join in the referenced objects, I get three null rows, but a count of 26. And if I use 'join' I get back 23 rows. So there are objects seemingly not in all_objects but in public_dependency.

select * from public_dependency  pd 
left join all_objects o on o.OBJECT_ID = pd.OBJECT_ID
where REFERENCED_OBJECT_ID = 305318

How is it possible that there are objects in public_dependency that are not in all_objects?


回答1:


all_objects only shows you objects you have permissions on, not all objects in the database. You'd need to query dba_objects to see everything, if you have permissions to do that.

public_dependency appears to include object IDs for objects you don't have permissions on. The objecct IDs on their own don't tell you much, so it isn't revealing anything about objects you can't see (other than that there are some objects you can't see).

So it isn't odd that there is an apparent discrepancy between what the two views reference. Querying all_dependencies might give you a more comsistent picture.



来源:https://stackoverflow.com/questions/24541307/how-can-public-dependency-contain-references-to-objects-not-in-all-objects

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!