0

Is it possible to modify an individual procedure inside an Oracle DB Package? instead of recreating (modification is not done using a SQL editor, so cannot modify a place and easily recompile the package) the package again every time we need to do a minor change?

Thanks.

2 Answers 2

2

No, it is not possible to modify only a part of a package. You have to replace the whole package or package body. If you don't have the current version of your code you can extract it from the database if you have the appropriate permissions.

1) You can read it from the ALL_SOURCE view. Many graphical client tools. sqldeveloper or similar client tools can simplify the extraction of the source.

2) you can use the package DBMS_METADATA to write the source code to a file on the database server .

3) expdp/impdp or exp/imp can be used to extract the source of a whole schema.

But all these methods only work if the code is stored in clear text in the database. If the code was obfuscated using the Oracle wrap utility (or some equivalent method) you can only extract the obfuscated code which is useless for further processing.

So all in all you should use some source control system as already mentioned by @Colin 't Hart

2

Don't. Keep all your package sources in a source control system. That way you can go back to a previous version if you need to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.