I’m working on an oracle database which has a package with some stored procedures already defined and declared.
I need to add some new stored procedures and type definitions to it, which I have already done in developement environment using sql developer tool and working directly on the package.
But now, in order to pass it to the next environment I need to provide an sql script to add my changes to tests environment.
The only way I found to do this is to make an sql script to CREATE OR REPLACE all package information and not only my changes. And I’m afraid that the environment where I’m making this deploy is not a copy of the development one.
Any help?
If the package code in your test environment is not in sync with the code in your development environment, that’s really something you need to address before you start working on any code changes to the development version of the code. In other words, you would want to make sure the development version of the package matches test, and then make your changes.
You are correct that
CREATE OR REPLACE PACKAGEis the way to write the script, but you’ll need to be sure to do this for both the package specification as well as the package body, so 2 commands will be needed.Since you’ve already made the changes in development and you’re not sure if the version you started with in development matches test, see if your DBA can give you a copy of the package spec and body from test, then you can run a diff on the code for development vs. test to find out the differences. You’ll have to sync any differences back into your development version before promoting the code to test.
One handy tool I like for doing a graphical diff operation is diffmerge, and you can find it here: http://www.sourcegear.com/diffmerge/