Oracle SQL Developer: Single Object Compare

Posted by thatjeffsmith on Oracle Blogs See other posts from Oracle Blogs or by thatjeffsmith
Published on Mon, 9 Jun 2014 14:44:05 +0000 Indexed on 2014/06/09 21:33 UTC
Read the original article Hit count: 538

There’s a nasty rumor going around that you can’t compare database objects and/or code in Oracle SQL Developer. So let’s put that to bed right now. First, here’s how to compare:

So now that that’s settled, why don’t we take a look at how to compare a single table, to another table – whether it’s in the same database or a different database.

Database Diff

There’s no additional licensing requirement here. If you have SQL Developer, you can use this feature.

if you're going to compare 1 table to another, make sure you ONLY have 'tables' checked

if you’re going to compare 1 table to another, make sure you ONLY have ‘tables’ checked

And then, use this dialog to select your table(s):

Move over the object(s) you want to compare over to the right hand side.

Move over the object(s) you want to compare over to the right hand side.

And now we can move onto the results.

The differences, side-by-side, and the script to make B look like A

Common lines with differences are highlighted in blue, new lines are highlighted in red.

Common lines with differences are highlighted in blue, new lines are highlighted in red.

So that’s why they are different, but here’s the script to synch up the differences:

Read the script, TEST the script, apply the script.

Read the script, TEST the script, apply the script.

And that’s it. Well, that’s mostly it. If you have questions about how to compare a database object in a schema you don’t have the login information for, read this post next.

© Oracle Blogs or respective owner

Related posts about diff

Related posts about synchronize