Solved

Version Control for Oracle Database objects

Posted on 2011-03-11
9
441 Views
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!
0
Comment
Question by:d27m11y
9 Comments
 
LVL 10

Expert Comment

by:Bawer
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.
0
 
LVL 14

Expert Comment

by:ajexpert
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.

HTH
0
 

Author Comment

by:d27m11y
ID: 35121685

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!

0
 
LVL 2

Expert Comment

by:swadhinray
ID: 35124529
@d27m11y: yes you need to check-in and out if you make any changes in your package body
0
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.

 
LVL 10

Expert Comment

by:Bawer
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.
0
 

Author Comment

by:d27m11y
ID: 35129137

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

Expert Comment

by:Akenathon
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 :-)
0
 
LVL 10

Accepted Solution

by:
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.
0
 

Author Closing Comment

by:d27m11y
ID: 35159853
Resolved the issue!
0

Featured Post

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.

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video shows how to recover a database from a user managed backup
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now