Link to home
Start Free TrialLog in
Avatar of d27m11y d27m11y
d27m11y d27m11yFlag for United States of America

asked on

Version Control for Oracle Database objects


We recently installed Microsoft Team Foundation Server(TFS) and we would like to use for Version Control of the source code for the Oracle Database objects.
Am kind of new to this whole process. I understand that we will have to checkout the previous version and check-in the latest one.

Can someone guide me how we can put packages in the TFS. Do we have to put the package specification and package body together as a script or each of it seperately.

I have this question because..
Eg:    What if I have added some public variables in the package spec and that variable is not being used in package body.. then can I check-out only the  package spec not the package body.

Another qn: If I make changes in the procedures in package body, can I check in script the package body only.. for this to happen, do I have to maintain procedures/functions in the package bodies separately or should I maintain the whole package body script together.



Your valuable suggestion is appreicated. Please help. Quick reply is appreciated!
Avatar of Bawer
Bawer
Flag of Afghanistan image

I am using VSS for the control, don;t have exp  on TFS, as far as objects are concerned, you need to keep all objects separately this is only to keep better tracking, specs and bodies shall be separate and other objects procedure, functions, triggers shall be separate. Also create a proper comment list while making any change to objects, and maintain date wise including the name of the admin doing the change and the purpose.
We combine the package specs and package body in a single .sql file.  No matter, if we change package specs or body, the whole object is checked out and checked in.

I believe this is the best way to maintain the consistency.

HTH
Avatar of d27m11y d27m11y

ASKER


Thanks all for the response.

@Bawer:
If I make a change in the procedure in the package body, do I have to checkout and check-in the spec and body of the package. Please suggest!

@d27m11y: yes you need to check-in and out if you make any changes in your package body
If you are making changes in p-body its not necessary to make changes in package unless required. I hope i understood you question properly.

@Bawer:

If I make changes only in one of the procedures in the package body and not in package spec, do I have to check-in and check-out both the spec and body to maintain consistency across versions and compile..

Please suggest!
You don't have to mess with the spec if you only change something in the body. One of the advantages of using packages is precisely that: you can change the implementation (i.e. body) without invalidating dependent objects if you don't change the interface (i.e. specification). Of course, you must only compile the body in the DB... if you compile the spec everything will get invalidated :-)
ASKER CERTIFIED SOLUTION
Avatar of Bawer
Bawer
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Resolved the issue!