How to Compare a Specific Subset of DB Objects

thatjeffsmith SQL Developer 1 Comment

Tell Others About This Story:

A question from the innerwebs –

Hello,

please, is it possible to define and save a (sub)set of objects for comparison? In Databasediff wizard we have an option to define objects, but it’s a bit cumbersome to do the same thing over and over again, so it would be highly useful to save options and selected items for comparison for future use.

Thanks a lot,

The answer is, Yes!

We have a nice Oracle By Example on this topic available here.

Use the Cart!

Define the objects to be used for the compare using Cart. Find them in your target database. Drag them to a cart.

Open the Cart.

I’m going to add 3 TABLES from HR.

Now I’m going to invoke the DIFF using the DIFF button on the Cart toolbar.

I need to pick my HR_COPY connection for the Destination Connection.

I need to change my CONNECTION to the Target Instance (HR_COPY) and click ‘Apply.’

And now we’re only going to compare those 3 tables.

Sweet.

And then we’ll get our results, as you normally would using the Database Diff item on the Tools menu.

I’m missing some important stuff it appears.

More on the Cart

The Cart can do a LOT.

Exporting Multiple Tables to a Single Excel file using the Cart

Use the Cart to Build Deployment Scripts

Introducing the ‘Shopping’ Cart

Batch Load Your Cloud via the Cart and our command line interface

More on Database Diff

Compare Objects from Multiple Schemas

Database Diff Enhancements

PS What about PL/SQL?

Yeah, you can drop that into a CART and do a DB DIFF to compare your PLSQL objects as well.

It’s just a text-compare…

Related Posts

Tell Others About This Story:

Comments 1

  1. Excellent article!

    We’re actually using this when we do version control. Maintaining a list of all objects related to a project in a cart. Export everything to separate files. Then those files, along with the cart, get committed to the repository. Might I add that the controlling script generated at the end is a pretty great feature too, as you can just “install” everything in one go. Works wonders for our flow.

    I see that there is a feature from within the cart to switch the data source for an object to a different connection. Any chance there will be a feature to do the same thing for the “owner” field?
    Backstory here is this: developers each have their own DB. When they work on a project, and have to get the latest version of the data model into their DB, they don’t necessarily want to drop the tables, as they will loose all the seed data that is in there. So we just import all the objects to a different schema, and then use the diff tool to get the latest changes into the main schema (as ALTERs). That implies that we end up manually modifying the cart to have it point to a different db connection and owner. And then changing it back.

    Being able to change the Data Source field in the cart takes us half way there. A similar feature on the Owner field, would completely solve this for us. I realize this is a little nitpicky, but I’m personally a big fan of streamlining things!

    Many thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *