Hello, my name's John Pocknell, Toad for Oracle product manager. Welcome to this multi-part series on enabling agile database development using Toad for Oracle. In step 1, we're going to talk about what Team Coding is and how to set up Team Coding with version control and integration.
So why is this important? Well, Team Coding is a utility in Toad which provides a convenient way to control database objects and scripts within a team environment through a single common interface. You can also optionally link Team Coding to a third-party version control system, such as Subversion or Git, in order to maintain a revision history for database changes to your objects and scripts in a team-based environment.
Team Coding enables developers to work directly on a database object without having to access the files directly in source control.
Team Coding constantly reconciles any object changes that are made with the corresponding file in source control, and keeps them in sync at all times.
There are optional policies which facilitate PL/SQL regression tests and code reviews at check-in. This is important if you have a trigger which initiates an automated build process as developers check code into source control.
So effective version control becomes an essential part of moving traditional development processes to agile. So let's get started with a demo, and I'll walk you through the various steps to get Team Coding set up.
Here's my Toad UI. And the first thing you want to do is to go to the Team Coding menu item and select Configuration. So we're going to install the repository for Team Coding, and this will help reconcile the objects in your database with the files in source control.
When you run this for the first time, you need to be a user with the DBA role granted. And then once you have the repository built, there'll be a role created called a TC Admin role, and then that role can then be assigned to somebody in the dev team to administer Team Coding moving forward.
OK, so the first to do is on this button here, Install Team Coding to Database. And by default, it's going to create the objects in a schema called Toad. This is generally recommended, actually, so that you can have all the Toad-related objects in one place.
It will create a role called TC Admin role. You just need to specify the table spaces in which to create the repository tables and indexes. Click Next.
So here's the script that will create the repository. You can just go ahead and run that. OK, so now we have the repository objects created.
The next thing you want to do is to select your version control provider, because we're going to need to tie Team Coding with the back-end version control system. So these are all the version control providers that we currently support. I'm currently using Subversion, so I'll select Subversion. This button at the end here will enable you to check the settings. It gives you the executable name, any server defaults, any options that you might want to have set.
So once you have your Team Coding Repository created, the next thing to do is to create a project inside of Team Coding that maps to a project inside your version control provider. OK, so go to Team Settings just to make sure you have a VCS provider selected. In my case, Subversion. You can see a list of other providers that we have here.
And then select Team Projects, and click Create a New Team Project. Now, you can call this anything you like. I'm just going to call it dev project.
And then go to your VCS window and just click this button here to look up any projects that you have in your version control provider. So here's my VCS log-in. In my case, Subversion. If you're using a different version control provider, then obviously this will look different. Click OK.
And you can see here, this is my top-level SVN, but I don't have any projects defined in my version control system yet. So I'm going to create one inside of Toad. If you did have projects already existing, then you could just simply select the one that you want to map to your Team Coding project, and then you can start mapping the files back to objects in your database.
So I'm going to click New and type in here the same name, dev project. And click OK. So that's now created a project called dev project in my version control system.
There it is there. I'll select it and click OK. So that's the VCS project mapped to my team project.
I can use subfolders to distinguish different types of objects. So each object, whether it's a table or a view or a function or a stored procedure, will be contained in its own subfolder. I'm not going to use a parent folder, because I don't need one in this particular example.
And then I'm going to add the schema, and the objects in that schema that I want to have relate to that version control project. So I'm going to select quest dev as my schema.
And now I can select which objects I want to include. I can include all of them, or I can just have PL/SQL. Equals So I could unselect anything that's not PL/SQL. I'll go ahead and select them. There are not that many objects in here.
You can also-- so these include filters that you can set, which we click this button at the end here, Edit Object Filters. You can decide whether you've got specific objects that you want to include and specific objects that you want to exclude.
So I'm going to go ahead and click OK. If you want to set a policy whereby you run a code review each time a developer checks their code in, then you can assign