File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comapre two DB conntaction/schema

 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using sqldeveloper. Want to know how could i compare two different connection/schema. holding same type of tables. I need to comapre values from both schema and try to figureout difference

Thanks
KS
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you need to compare rows in two tables that have the same columns?

I'd use the SQL MINUS operator:
This is just the easiest. A more sophisticated compare might also list rows that have the same primary key but differ in other columns. You'll be much safer if you enumerate the columns instead of using * (see Always use column list).

If the two tables reside on the same database in different schemas, do the compare using an account that was granted the SELECT privilege on both tables. If the two tables reside in different databases, you have several options:

1) Create a database link and run the "minus" queries using the link,
2) Use data pump (expdp/impdp) to bring the two tables into one database, so that you can compare them,
3) Export the data somehow into text/csv files and compare them using different tools (diff, excel or the like).
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Martin
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic