aspose file tools*
The moose likes Oracle/OAS and the fly likes Table or view does not exist , when it actually does exist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Table or view does not exist , when it actually does exist" Watch "Table or view does not exist , when it actually does exist" New topic
Author

Table or view does not exist , when it actually does exist

Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 250

DBA_TAB_COLUMNS is the view that contains information about columns in tables,
and because of the DBA_ prefix, you know it contains information about tables and columns
that exist anywhere in the database, regardless of owner or privileges granted.


when I login to Oracle xe with user system and query the view dba_tab_columns it works.
But when I login to Oracle xe with a user abc that I have created and have given all privileges to abc , now I try to query dba_tab_columns it says "Table or view does not exist"

Can anybody tell whats the reason

Shukran


Oracle Java Programmer , Oracle SQL Expert , Oracle Java Web Component Developer
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

Mahtab Alam wrote:and because of the DBA_ prefix, you know it contains information about tables and columns
that exist anywhere in the database, regardless of owner or privileges granted.

Right. And because of the DBA prefix you know that the table is supposed to be accessible to database administrators only too. Which is the default setting and really shouldn't be changed unless absolutely necessary. (Or unless you're just learning about it, of course.)

But when I login to Oracle xe with a user abc that I have created and have given all privileges to abc ,

There's a lot of privileges and roles. Show us what privileges exactly you have granted. I really doubt you've granted them all. Ideally show the grant statements themselves.

now I try to query dba_tab_columns it says "Table or view does not exist"

Can anybody tell whats the reason

The "Table or view does not exist" message is displayed when the table being queried doesn't exist, or when it does exist, but the current user doesn't have privileges to select from it, which is your case. This is for security reasons, so that some user cannot try to guess the names of existing tables and have their existence confirmed by error messages indicating lack of privileges over an existing table.

DBA_TAB_COLUMNS is actually a public synonym for a view in the SYS schema, so the privilege needs to be granted to the underlying table, not to the public synonym.

You might want to read about Data Dictionary views and something about privileges and roles.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Table or view does not exist , when it actually does exist