Version Control for Oracle Database objects

Posted on 2011-03-11
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
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!

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


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 500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Query 34 116
Create table from select - oracle 6 54
having some issue on pl sql procedure 1 23
Oracle function to insert records? 15 48
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

820 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