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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare database

Status
Not open for further replies.

mkey

Programmer
Oct 3, 2001
288
CA
Hi all,
I need to compare two databases that are in the same schemas and compare databases that are in different schmas.
I need to check the table structure and well as the data in them.
I ran this query for the database that is in the same schema:

select table_name
from DBA_tables where owner = 'database_one'
MINUS SELECT TABLE_NAME FROM DBA_TABLES WHERE OWNER = 'database_two';

Result: It compared the number of tables in database_one and database_two and returned me that tables that are not in database_one. How can I do the same thing when the database in different schema and check the tables structure at the same time?
Thank you for all your help
mkey
 

You are just comparing tables of different schemas, if you want to go deepre to the column structures. You'll have to write down a script using DBA_TAB_COLUMNS. If you want to campare from another database, you have to greate a database link.

To make this easier for you, download a beta copy of TOAD by Quest Software and do these tasks from there it has a utility to compare databases/schemas.

Robbie

"The rule is, not to besiege walled cities if it can possibly be avoided" -- Art of War
 
Hi Robbie,
Thank you for you input. I need to write a script to compare the structure of two tables. I guess I could use the software for now. But I need to develop the script soon. Do you have anything that could help me?
Thank you!!
mkey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top