How to compare PL/SQL source in two databases using some smart trick
Hi,
Here is my scenario:
We have a very big team (>50) of developers working on PL/SQL.
As and when some new enhancements/bug-fixes are are tested successfully, DBA's migrate the new source code from DEV to QA and then to PROD instance.
Very often, developers are asked to verify if the source code migrated to the target instance is the correct one. This so, because we use an automated migration tools ...and sometimes DBA's might make mistake by migrating the wrong version (say a beta code).
So the developers are left with comparing the source manually or using file compare tools...a very time consuming job.
(I know a strict discipline of keeping a proper header and version history will help; but we have lots of exisiting code that does not adhere to this rules)
So, is there any way to do it in a "smart" way .... I was thinking about a way to get the HASHCODE/HASHKEY of all the source code lines of a pkg or procedure and then again get the HASHCODE/HASHKEY of all the HASHCODEs/HASHKEYs of the source lines for a particular pkg..to get a single HASHKEY for a pkg ....and then I can compare this HASHKEY of 2 instances ..and it they are same, means the code is same ..else the code is different
e.g.
select custom_hashkey_prc(text) from dba_source where name='MY_PKG'
Thanks.
Edited by: DT1977 on Jan 19, 2009 3:31 PM