Home » SQL & PL/SQL » SQL & PL/SQL » Code comparison (Oracle 10.2.0.3)
Code comparison [message #556044] Wed, 30 May 2012 13:52 Go to next message
pointers
Messages: 324
Registered: May 2008
Senior Member
Hi,

I have to compare my SVN source code (packages, views etc) with the production code in the database like views etc (actually we are not sure that what we have in the svn is the final version of production code, we have objects created in the production database, but we dont have latest scripts for that. we have to deploy the svn code in the unix box).

So here the comparison is between the OS files and the database objects.

I thought I would get scripts of all the packages, views etc from the production database by using DBMS_METADATA or some utility
and save the code in OS files then compare one svn file with OS file manually by using some comparison tools e.g toad provide one comparison tool.

Could you please advice if my approach is correct, if not please suggest best approach.

Thank you very much in advance.

Regards,
Pointers
Re: Code comparison [message #556045 is a reply to message #556044] Wed, 30 May 2012 13:58 Go to previous messageGo to next message
BlackSwan
Messages: 20086
Registered: January 2009
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/

>we have to deploy the svn code in the unix box).
What does this mean?

>I have to compare my SVN source code (packages, views etc) with the production code in the database
what is OS name & version of Production DB Server?

Why don't you simply replace the code in SVN with what exists from Production DB?
Re: Code comparison [message #556046 is a reply to message #556045] Wed, 30 May 2012 14:09 Go to previous messageGo to next message
pointers
Messages: 324
Registered: May 2008
Senior Member
@Blackswan:
Quote:
>we have to deploy the svn code in the unix box).
What does this mean?

As part of the release we copy all the source code of database from SVN to UNIX solaris directory and we run release script which will run all the source code.

Quote:
>I have to compare my SVN source code (packages, views etc) with the production code in the database
what is OS name & version of Production DB Server?

Its UNIX solaris, I am not sure about version at this moment as I am not at office, our DB server is Oracle 10.2.0.3

Quote:
Why don't you simply replace the code in SVN with what exists from Production DB?

The problem is there are too many objects to do that, its not straight forward, moreover we dont have readily available source code of production code, for that we need to write sql scripts to get the production code. By the way, we will replace svn code from the production code if both are not same may be at file level, before that we have to compare, thats where the actual question raised.

Regards,
Pointers
Re: Code comparison [message #556048 is a reply to message #556046] Wed, 30 May 2012 14:20 Go to previous messageGo to next message
BlackSwan
Messages: 20086
Registered: January 2009
Senior Member
>The problem is there are too many objects to do that,
regardless of the actual number of objects that exist,
*ALL* must reside in SVN

>its not straight forward,
yes, it is straight forward

>moreover we dont have readily available source code of production code,
>for that we need to write sql scripts to get the production code.
so, somebody needs to start writing code to extract source from the DB

>By the way, we will replace svn code from the production code
>if both are not same may be at file level,
>before that we have to compare, thats where the actual question raised.

I contend that doing the compare is as waste of time & CPU cycles.
The process will be simpler without any compare & doing blind replacement.

the *NIX utility "diff" compares two text files & reports any differences.
Re: Code comparison [message #556053 is a reply to message #556048] Wed, 30 May 2012 15:09 Go to previous messageGo to next message
pointers
Messages: 324
Registered: May 2008
Senior Member
@Blackswan: Thank you very much.

Regards,
Pointers
Re: Code comparison [message #556061 is a reply to message #556053] Wed, 30 May 2012 23:23 Go to previous message
Michel Cadot
Messages: 54127
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
To extract code, use DBMS_METADATA.

Regards
Michel
Previous Topic: select record as specified.
Next Topic: GROUP BY or HAVING or MAX (modify code help)
Goto Forum:
  


Current Time: Sun May 19 00:29:03 CDT 2013

Total time taken to generate the page: 0.07622 seconds