Query tables listed in DBA_Tables

The third product we have in my company uses Oracle as a backend. I am trying to log into an Oracle database and look at the schema and data. I logged in as sys / sysdba, created a user with the default tablespace created by the application, and granted the user all the necessary permissions to query the structures. I also set O7_DICTIONARY_ACCESSIBILITY to true to allow querying data dictionary objects.

After logging in as a user and querying User_Tables, nothing is returned. But when I query DBA_Tables, the tables that I expect to find are returned. I'm new to Oracle, so I'm not quite sure how a non-system table can be in a table space, but not user_table.

More importantly, how do you query the data in these tables? Whenever I try to perform a simple "Select *" from tables, I get the error "table or view does not exist."

Thanks in advance.

+3
source share
1 answer

The default tablespace that you set for the user controls which tablespace objects belong to that user. They have nothing to do with what objects they can request.

  • USER_TABLESreturns information about tables owned by a specific user. This is not like your user owns any tables, so you expect them to be empty.
  • ALL_TABLES , . , .
  • DBA_TABLES , .

, ( OWNER ALL_TABLES)? , , , ,

SELECT *
  FROM schema_owner.table_name

,

  • ( )
  • CURRENT_SCHEMA . , . .

    ALTER SESSION SET current_schema = new_schema_name

    , - , .

+12

Source: https://habr.com/ru/post/1719674/


All Articles