If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > how to see the tables of other schema

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-19-09, 13:34
asimshrestha asimshrestha is offline
Registered User
 
Join Date: May 2009
Posts: 2
how to see the tables of other schema

can anyone tell me how can i see all the tables of some other schema in oracle.

i can use 'select * from tab ' for seeing all the tables in my schema but if i want to see all the tables of some say'xyz' schema , how can i do that. what is the sql command for that ?
i do have the priviledge to see the tables of the schema
Reply With Quote
  #2 (permalink)  
Old 05-19-09, 13:54
pablolee pablolee is offline
Registered User
 
Join Date: Dec 2007
Posts: 153
look at all__tables
Reply With Quote
  #3 (permalink)  
Old 05-19-09, 14:04
asimshrestha asimshrestha is offline
Registered User
 
Join Date: May 2009
Posts: 2
u mean 'select * from <schema_name>.all_tables' ????

i need to see all tables of a specific schema.
Reply With Quote
  #4 (permalink)  
Old 05-19-09, 14:28
beilstwh beilstwh is offline
Lead Application Develope
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 2,222
Code:
select table_name
from all_tables
where owner='OTHER_SCHEMA'
ORDER BY TABLE_NAME;
Please be aware, you will ONLY see those tables that you have privilege to see. Next time when someone says look at a table, at least do a describe of the table.
__________________
Bill
You do not need a parachute to skydive. You only need a parachute to skydive twice.
Reply With Quote
  #5 (permalink)  
Old 05-19-09, 14:29
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,415
Select Table_name From All_tables Where Owner = 'specific_schema';
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Reply With Quote
  #6 (permalink)  
Old 07-17-09, 07:50
FoKwame FoKwame is offline
Registered User
 
Join Date: Mar 2009
Posts: 41
The former suggestions are fine but you may also consider this one

First, It depend on whether your account has select right on other schemas

If it does, then this may work :

SELECT TABLE_NAME, OWNER FROM ALL_TABLES;

OR

SELECT TABLE_NAME
FROM ALL_TABLES
WHERE OWNER IN ('schema1','schema2' ,...)

OR
WHEN LOGGED IN AS SYSDBA
SELECT TABLE_NAME
FROM ALL_TABLES
WHERE OWNER IN ('schema1','schema2' ,...)

This statement lists all tables and their owners for you

Hope it works
Reply With Quote
  #7 (permalink)  
Old 07-17-09, 07:57
pablolee pablolee is offline
Registered User
 
Join Date: Dec 2007
Posts: 153
1. Dredges up a 2 month old post.
2. Adds nothing to the previous posts.
3. advises agaist best practices (do not log in as sysdba to perform such tasks. sysdba is a very special type of user and Oracle can and will behave differently when logged in as sysdba. Only log in as sysdba to perform tasks that only sysdba can perform).
4. Predicate would cause no data to return as Owner column stores data in upper case.
Reply With Quote
  #8 (permalink)  
Old 07-17-09, 11:08
The_Duck The_Duck is offline
Registered User
 
Join Date: Jul 2003
Posts: 2,292
Please read this document:
How to Use the Data Dictionary
The Data Dictionary
__________________
- The_Duck
you can lead someone to something but they will never learn anything ...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On