Deployment script ordering of objects

Compares and synchronizes the schemas of Oracle databases

Deployment script ordering of objects

Postby brendan_t » Wed Jan 29, 2014 3:45 am


When generating a deployment script after doing a schema comparison, the ordering of the objects that are being created/modified isn't always consistent. That makes it difficult when using a text comparison tool to identify incremental differences between deployment scripts.

It would be nice if given the same set of differences, we could expect to get the exact result in a deployment script. This doesn't seem to be the case at the moment. Is there a setting I am missing, or any way to ensure objects appear in the same order in separate comparisons?

Posts: 3
Joined: Wed Jan 29, 2014 2:55 am
Location: Sydney

Postby Chris Auckland » Thu Jan 30, 2014 3:30 pm

Thanks for your post.

Is the script that's being generated in a different order still functionally correct, or does are the scripts invalid every so often?
Chris Auckland
Posts: 760
Joined: Tue Oct 24, 2006 1:12 pm
Location: Red Gate Software Ltd.

Postby brendan_t » Thu Jan 30, 2014 10:24 pm

Hi Chris, thanks for your reply

The script is still functionally correct and can be executed successfully. Its more of a source control traceability issue. Unfortunately we do not have personal databases dedicated to a certain project or piece of work, so when we produce schema comparisons, we often only want to include a subset of the changes in the deployment script. Being able to then compare the deployment script with a previous deployment to ensure we have only captured the changes we want is important. It makes it difficult when objects appear in different parts of the script and are identified as differences by text comparison tools.

I assume there is a degree of ordering implemented to ensure dependencies are applied in the correct order etc. Apart from that, the ordering seems arbitrary as sometimes it is the same as previously, but not always. I thought it might be simple enough to add additional ordering criteria to ensure a specific order is retained each time.

Posts: 3
Joined: Wed Jan 29, 2014 2:55 am
Location: Sydney

Postby eddie davis » Wed Feb 19, 2014 1:46 pm

Hi Brendan

I have further explanation from a colleague in the Development Team.

The order that objects in the deployment script appear can be dependent on the order that the database gave them to us in the first place. So when Schema Compare for Oracle queries the system tables, the objects are listed in whatever order the database decides to pass us the information to Schema Compare. That order can change as the database manages its system tables.

When creating the Deployment Script, the dependency order is the most important criteria. The fact that Table_B gets created before Table_A but on the next occasion you create a deployment script, Table_A is created before Table_B is immaterial, it is the dependency order that is important and that the deployment script or when run is successful.

Many Thanks
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
eddie davis
Posts: 1148
Joined: Wed Jun 14, 2006 2:47 pm
Location: Red Gate Software

Postby brendan_t » Wed Feb 19, 2014 10:51 pm

Hi Eddie

Yes I understand, and I suspected that is what was occurring. Perhaps you could consider adding extra ordering criteria to the system table queries for future releases? That would improve the usefulness of this tool a great deal in my case, and hopefully for others too.

Thanks for the response
Posts: 3
Joined: Wed Jan 29, 2014 2:55 am
Location: Sydney

Return to Schema Compare for Oracle

Who is online

Users browsing this forum: No registered users and 0 guests