RE: Source Control for DB objects

From: Dunbar, Norman (Capgemini) <"Dunbar,>
Date: Thu, 4 Aug 2011 22:41:40 +0100
Message-ID: <919FC80F27E0C6428106496EDF92A7521331416F_at_EXCCLUS05.PRODDS.NTNL>



Evening Jeff,  

> As far as source control I think I would like to use Subversion but I
am not
> just sure how to configure it for our environment. Is it possible to
just
> check out a single file from a project and not the whole project?
In a word, yes. You can check out an entire project - usually trunk, branches and tags folders with *everything* that ever was in the project included.

You can check out a single tree - say trunk only, that's where the current changes are being made.

You can check out a single folder.

You can check out a single file.

I thoroughly recommend the use of TortoiseSVN which makes life so much easier.

> I don't really want to check out all files in a project if I am only
changing one,
> or if another person needs to modify another file in that same project
I don't want
> to have to worry about merging.

Well, it depends on how you work. I do my development work in a working folder. I keep all my files in there, and work on them as and when required. I may have originally checked out a project or created one, it makes no difference. All the files (unless I exclude some) are under version control and when I need to start work, the first thing I do is update the working area. That gives me the current version from the repository.

I then edit the files I want to, test (!) and when done, commit them all back as part of the same change. I can choose to commit a single file if I wish. If necessary.

At this point I still have all the files in my working area, but I don't worry and I just leave them there. Next time I need to make a change, update is my friend. If I forget to update and then attempt a commit, I'll get told off and reminded to update.

This will NOT wipe out my changes, it will merge them into whatever it has to download from the repository as part of the update.

It will raise a conflict if the updated files being merges have areas that have changed since my version was last successfully committed and which I have just changed. But that's why you update before making changes, it's safer.

As for merging, you don't worry about it.

If I change a file and you change it also, and our changes don't overlap, a commit will merge the changes into the repository.

If I change the same area as you, a conflict will result and whoever committed last (which will have failed) will need to sort out the conflict. There are 4 ways:

  • Choose my changes over yours;
  • Choose your changes over mine;
  • Revert back and lose both sets of changes;
  • Manually choose your changes or mine for each conflicting area in the file(s).

At the end, tell Subversion that there's no conflict and the commit will then work.

Once you get the hang of it, it's pretty good.

Cheers,
Norm.

Norman Dunbar
Contract Senior Oracle DBA
Capgemini Database Team (EA)
Internal : 7 28 2051
External : 0113 231 2051  

Jeff Chirco | Database Administrator
o 949 509 6374

-----Original Message-----
From: Dunbar, Norman (Capgemini)
[mailto:norman.dunbar.capgemini_at_environment-agency.gov.uk] Sent: Thursday, August 04, 2011 8:33 AM
To: jeremy.schneider_at_ardentperf.com; Joel.Patterson_at_crowley.com Cc: oracle_at_dbping.com; Jeff Chirco; oracle-l_at_freelists.org Subject: RE: Source Control for DB objects

Hi Jeremy,

>> In particular, I'd also be curious what development tools you use >> (Oracle's SQL Developer? Toad?)
Toad.
SQL*Plus.
TortoiseSVN.
Subversion command line utilities.

I tried SQL Developer, I just don't like it. But then again, I've been a Toad fan for a good many years now. Since before Quest owned it.

>> and if your tools integrate with your source control system for >> PL/SQL scripts.
Toad does, with Subversion plus a few others. I do have a problem with Toad's current (due for a refit soon!) implementation of source control using Subversion. When I have say 10 files open in the editor to fix one particular bug, then I have to check them all back in, via Toad, one at a time.

The whole point of Subversion is to check all 10 files in together as one commit.

A forthcoming version of Toad 11, I think, will allow this feature. In the meantime, I save all the files to a working folder and do the commit separately using TortoiseSVN. (Which Toad can interface with by the way.)

>> I'd also be curious to hear what you put into change control - just 
>> PL/SQL code, or also system configuration/schema updates?  How about 
>> shell scripts?

Just about everything I do to be honest:

PL/SQL
SQL scripts
Bash scripts
PHP scripts
Windows command files.
Text files (non script)
PDF files.
XML files.
C source.
C++ source.
68000 Assembly Source (Not Oracle related obviously!) Etc....

As I move from job to job, I take my scripts with me. They evolve. Keeping everything in a repository is great as I can dump the repository when I move on, and keep the latest versions (actually, entire history) with me.

I also run quite a few Subversion repositories on a USB stick.

Cheers,
Norm.

Norman Dunbar
Contract Senior Oracle DBA
Capgemini Database Team (EA)
Internal : 7 28 2051
External : 0113 231 2051

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it. We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Aug 04 2011 - 16:41:40 CDT

Original text of this message