Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







Find table in many Oracle databases

Oracle Database Tips by Donald BurlesonApril 13, 2016

Question: What do I do to locate a table that exists in one of many databases?  I know how to find a table in one database using dba_tables, but I need to check all of the databases for the table name.  How do I quickly check all databases for a table?

Answer:  To connect to all databases on all Oracle servers, the following script will connect to each database and check for the table name:

This will visit every database in your enterprise. In the following example, we perform a double loop, looping from server to server.  For each server, we loop from database to database. Here is the actual UNIX code that perform the loops.

# Loop through each host name . . .
for host in `cat ~oracle/.rhosts|cut -d"." -f1|awk '{print $1}'|sort -u`
  echo " "
  echo "************************"
  echo "$host"
  echo "************************"
  # Loop through each database name on the host /etc/oratab . . .
  for db in `rsh $host "cat /etc/oratab|egrep ':N|:Y'|grep -v \*|\
  cut -f1 -':'"`
     # Get the ORACLE_HOME for each database
     home=`rsh $host "cat /etc/oratab|egrep ':N|:Y'|grep -v \*|\
     grep {db}|cut -f2 -d':'"`
     echo " "
     echo "database is $db"
     sqlplus system/manager@$db <<!
     select owner from dba_tables where table_name = 'FRED';

This will search on all Oracle servers, and all instances on each server for a table.

WARNING!  This trick is only for secure shops without any outside access (internet connectivity).  There is a security exposure with rsh because a hack into one server will expose all servers that they can rsh onto.  Hence, this tip is only for secured server farms where rsh can be safely implemented.

Oracle Training from Don Burleson 

The best on site "Oracle training classes" are just a phone call away! You can get personalized Oracle training by Donald Burleson, right at your shop!

Oracle training

  Oracle consulting and training


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.



Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster