RE: Controlling changes to database - Team Coding

Stephen Beausang <[email protected]>
Newsgroups gmane.comp.db.oracle.toad.free
Message-ID <87842ED9F185434DBFBB6BDF630A3C2231845052@ALVMBXW02.prod.quest.corp>
Timothy,

I'd like to chime in here if I may. 'Not cut and dry ..' is apt .  First Please see my comments below to your original post .

Some General Stuff :

Toad makes a distinction between Team Coding and File Based Source Control.  See the help under  Use Source Control - About Source Control, which gives a very useful breakdown of the options and advantages / disadvantages of each system. It also helps to outline how each works .

File based source control does not require any server side objects, and simply interfaces with the VCS Provider to manages source files.

Team Coding manages objects centrally in Toad and requires that you install the Team Coding Server Side Objects for each database that you wish to control. In addition Team Coding performs a 'lock' on controlled objects in the database.  In reality it is keeping a local copy of  the source for each object and using SVN (in your case) to manage version history and locking source locking centrally. There is also Server Side Table, usually in the Toad Schema ,which manages  the locking of objects.  The source is controlled in the SVN repository, and each user checks out a local copy of the source when he checks out the object (e.g in the Schema Browser).  When the user has an object 'checked out' Toad automatically opens the local copy of the object for editing.

In your case I would also read up on the help for Mirroring in Team Coding. This enables each user to create Sandbox in his own schema without effecting the production object. Toad manages locking  etc.  I'm not sure if this is appropriate for you dev environment or not.

I hope this helps
Stephen



From: [email protected] [mailto:[email protected]] On Behalf Of Bryan, Timothy
Sent: Wednesday, January 11, 2012 10:53 AM
To: [email protected]
Cc: Norman Dunbar
Subject: RE: [toad] Controlling changes to database - Team Coding



Hi Norm,

I guess I have to pay better attention to how I reply as my question did not go to the list; must have gone out to you only. I may repost it so it goes out.

The information you provided is very helpful and what I was looking for. I do have a couple of questions. When you indicate you are working on the files in your local repository, we do this too with our C sharp repository, but the local files (solution) is opened in Visual Studio this way by default. This makes it easy to open the solution, edit the files, then check in. With TOAD it is not so cut and dry. Most of our developers are accustomed to opening the schema browser then double clicking on an object to open it in the editor. Now we need to do a check out, but this may not be keeping our svn repository up to date.[STVCG]  This is a user preference under Options - Soruce Control - Team Coding - Automatic CheckOut. Set to true if the developer wants to perform check out when double clicking the object in the Schema Browser to open

How do you open the local files in TOAD typically if you need to update some object? I realize, I can open a file in TOAD, but I use the schema browser to locate what I am looking for, say a package and then can see the script. It would seem then, we need to open that file from the local repository to edit this. Also, does this keep the Team Coding piece in synch with the repository?[STVCG]  When you check out an object in the Schema Browser Toad automatically gets the latest revision from the VCS. It does synchronize the VCS Version with the Database Version and in will prompt the user as to which version to open if there is a discrepancy.

Sorry for so many newbie questions, but really need to fix our sloppy control process.

Best Regards

Timothy Bryan
We are what we repeatedly do. Excellence, therefore, is not an act but a habit.
Aristotle

-----Original Message-----
From: Norman Dunbar [mailto:[email protected]<mailto:toad%40dunbar-it.co.uk>]
Sent: Wednesday, January 11, 2012 8:57 AM
To: Bryan, Timothy
Subject: Re: [toad] Controlling changes to database - Team Coding

Hi Timothy,

> We are very new to Team Coding so just trying to learn the do's and don'ts.

Here's what I do, which may or may not help.

I have Toad configured so that I cannot compile anything that was loaded from the database - as previously mentioned.

I have a Subversion repository on a remote server.

I work on my code on my desktop in a folder that I checked out from Subversion.

So, I work away with everything that I need to, using Toad but only working on files I've loaded from my local folder. Any changes I make get saved back and when all is compiled and happily tested, I switch out of Toad and into Explorer where I use TortoiseSVN to commit all the files that I changed, in one transaction, back to the repository.

Older versions of Toad allowed only one file to be checked in. I think Stephen made some changes in 11 to allow all affected files (or all open tabs perhaps - I forget!) to be committed as one transaction.

I've only just got Toad 11, and I've not been able to use it in anger yet as my work changed recently and my new contract doesn't require a lot of Toad work. :-(

Anyway, I commit all the affected files in one go and I can see what changed in each of those files using TortoiseSVN to diff the previous version with the latest and so on.

It's not ideal because Subversion can't give you the script you need to bring a table, for example, up to date - it can give you a patch file that can be applied to the previous script (to create the table) to bring it up to date. However, in production you already have the table and all you ned is something like an ALTER TABLE command. It's not possible to get that from Subversion, unless, as part of the development process, you create one and check it in to Subversion.

It's better with creating patches for stored code, functions and packages as they tend to start with CREATE OR REPLACE ... whereas a CREATE OR REPLACE TABLE doesn't exist.

So, Subversion on it's own can't give you all that you need to bring a database up to date but it can help. Toad, on the other hand can create a script to do exactly that - but you need access to the production/QA database as well as the development one and you need the DBA module to actually be able to edit or save the generated script.

HTH

--
Cheers,
Norm. [TeamT]

----------------------------------------------------------
Waste Management recycles enough paper every year to save 41 million trees. Please recycle any printed emails.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.