Author: Bo Berglund
Notice:
This tutorial is written as a help for adding auditing to a CVSNT 2.5.03 installation.
The actual installation of the CVSNT server is covered by another page of mine.
This tutorial is not yet complete, I have trouble understanding some of the database table columns so I am in need
of help with that. Consider this page as a beta of a tutorial for the time being.
Table of contents
CVSNT auditing
Database backend selection
Database structure
SQLite database configuration
Microsoft SQL Server 2000 or MSDE2000 configuration
Generic ODBC configuration
Getting data from the audit database
LINKS
CVS Related links:
Innosetup Installer for CVSNT
CVSNT 2.5.03 installation tips
CVSMailer homepage, Automatic email on commits and other events
ViewCvs Installer download
SQLite:
SQLite homepage
SQLite Database browser A simple database manager application for SQLite
SQLite Spy A graphic interface to the SQLite databases
SQLite Explorer A Query Analyzer style interface to SQLite3
SQLite3Explorer A comprehensive and fast AQLite database browser
SQLite ODBC driver This driver makes it possible to access SQLite from any database aware application
The auditing system in CVSNT is based on a simple database table structure, which is created by CVSNT when the auditing
is configured (see below). The purpose of the auditing is to record the CVS operations in such a way that it will be possible
extract reports in a very fine-grained fashion at some later time.
This includes the timestamping of tag and branch creation and modification, which is not possible
with standard CVS.
In order for the auditing to work properly CVSNT must have read/write access to the database that will hold the
auditing data. For this CVSNT has been prepared with a number of database methods:
The selection of database server backend type is more or less a user preference.
It depends on what you are comfortable with and have available.
Since CVSNT supports ODBC access there is in effect no limit to the possible
database server types you can use.
CVSNT has native support for MySql, SQLite, Postgres and Microsoft SQLServer 2000 and its
redistributable MSDE2000 version.
Since I am daily working with SQLServer this is my preferred choice, but for testing purposes and to get
acquainted with the auditing functions I can recommend SQLite, since it has a very small footprint and is
rather capable.
SQLite has some drawbacks though, mainly because it is not a database server. Instead when
you use SQLite the database files are accessed directly through the SQLite dll and there is no concurrency possible.
The process will lock the database for the duration of the operation thereby locking out any other calls.
This will of course not happen with the server type databases, but they will instead require a more substantial
installation and maintenance effort.
Please observe that if you are watching the audit database using for example the "SQLite Database Browser" then the
database is also locked and noone can perform any cvs operations! For this reason SQLite is really only useful
for a small operation where the likelihood of concurrent cvs calls is small!
Note that SQLite is supported right from the CVSNT installation files, there is no need for any extra
download or installation in order to start using auditing if you select SQLite!
Irrespective of the type of database server used for auditing, the table structure is the same.

The database tables are written like this:
The CVSNT auditing has some problems that could have been solved in later versions, but here goes:
The SQLite database is the simplest to use with CVSNT. You need to do the following preparation steps:


If you are a Microsoft Visual Studio programmer then chances are high that you are already
familiar with the SQL Server 2000 or the MSDE 2000 database servers. In this case you could use this
type of database for your auditing. The advantages are that you will be using a full-fledged server
with support for concurrency and you are probably already familiar with the tools to extract data
from the database.
The following initial steps are needed before you begin:

If you use any other than the natively supported database types then you can always set up an
ODBC connection and then CVSNT can audit into virtually any database type there is.
Just make sure to create a System DSN so it will be available for the CVSNT service.
Then use that in the same way as is described above for the native connections.
Here is where the fun starts! When you have the auditing data inside the database you can play with it
using standard database queries anyway you like to! Just open the appropriate Query Analyzer type program
and enter your SQL queries there.
I have listed links to a number of tools appropriate for SQLite above, these all come with some form
of query entry and execution function. For the SQL Server type database the Microsoft Query Analyzer is a very
good tool for analyzing the database contents.
But you can also create stand-alone programs to extract data from the database more easily. For example
you could create a program that can be used bya a person who is not a database expert and does not know
any SQL at all. It is possible in almost all programming languages, they just need some database support
in the form of ODBC or similar.
This tutorial is written 2005-12-30 and is based on CVSNT version 2.5.03.2182.
I have also checked the bug mentioned above on 2006-11-22 with CVSNT 2.5.03.2382
The test system is Windows Enterprise Server 2003 with SP1 installed running in Virtual PC 2004 SP1
on my development PC. The server is not member of a domain.
Comments? Send me a message:
Email Bo Berglund