Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

it has totally eluded me!

Status
Not open for further replies.

deddleston

Programmer
Oct 4, 2002
43
0
0
GB
How do you view all the tables in oracle again? i just want to view table names not the data within the table.

cheers

M$ arn't the only option!
 
As user

select table_name from user_tables;

As DBA

select table_name from dba_tables;

Alex
 
To view any object name in any schema:

SELECT object_name, object_type FROM dba_objects WHERE objects_type = 'TABLE | PROCEDURE | FUNCTION | ....' AND owner = 'OWNER_NAME_YOU_WANT';


Hope that helps,

clio_usa

 
Wouldn't

select table_name from dba_all_tables

as any user give you all the tables and you wouldn't have to type two commands to list them all?
 
bi - It would if you didn't get this message;

SQL> select * from dba_tables;
select * from dba_tables
*
ERROR at line 1:
ORA-00942: table or view does not exist


SQL>

Alex
 
bi

Of course that should say;

SQL> select * from dba_all_tables;
select * from dba_all_tables
*
ERROR at line 1:
ORA-00942: table or view does not exist

Alex
 
alexhu: you should be granted SELECT ON DBA_TABLES or SELECT ANY TABLE. The later is included into DBA role, but DBA role is NOT NECESSARY to query this view.
ALL tables are listed there, contrary to only ACCESSIBLE tables listed in ALL_TABLES and only OWN tables, listed in USER_TABLES. Of course, if you're granted SELECT ANY TABLE, then ALL_TABLES coincides with DBA_TABLES.

Regards, Dima
 
sem - I never said you had to have DBA role. only that it is default behaviour not to have access to this view :)

Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top