Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Version Control for Oracle Database objects

Posted on 2011-03-11
Medium Priority
Last Modified: 2012-05-11

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!
Question by:d27m11y
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 10

Expert Comment

ID: 35114568
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.
LVL 14

Expert Comment

ID: 35118388
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.


Author Comment

ID: 35121685

Thanks all for the response.

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!

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 35124529
@d27m11y: yes you need to check-in and out if you make any changes in your package body
LVL 10

Expert Comment

ID: 35125543
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.

Author Comment

ID: 35129137


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!
LVL 11

Expert Comment

ID: 35131117
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 :-)
LVL 10

Accepted Solution

Bawer earned 2000 total points
ID: 35135475
Seems to be my earlier reply is not posted properly due to internet issues,

Regarding the last questions its not required to do C-in and C-out of spec in order to maintain the consistency as changing the required unit shall have the check-in and check-out so you can have proper records, if you do for dependent objects even those have not received any change then simply it will be confusing.

Author Closing Comment

ID: 35159853
Resolved the issue!

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to recover a database from a user managed backup

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question