Using MSSQL for Collection Database
From GreenstoneWiki
Installation Guide for MS-SQL database back end support
Tested Environment: Windows XP and Windows 2003 Server
Tested MS-SQL installation: Microsoft SQL server 2005 Express
Tested C++ Compiler: Microsoft Visual C++ 2008 Express Edition
Build time setup
- Modified files
- perllib/dbutil.pm
- Installation requirements
- Microsoft SQL server 2005
- Microsoft SQL server 2005 Manager
- Microsoft Visual C++ 2008 Express Edition
- Active Perl
- Perl Module required: DBD:ADO
Following are the steps for installing DBD:ADO manually- make sure ActivePerl is installed
- Make sure Visual C++ is installed
- Go to CPAN and download the source package
- Untar it and run Makefile.PL
- Run "nmake", "nmake test" and "nmake install"
- Database creation
We need to create database manually, use the Manager and create a database
You can basically call it anything you like
You will need to set this database name in the dbutil.pm
- Configuration for the dbutil.pm
Open the dbutil.pm file and search for the following lines
my $host = "localhost,1660"; # Need to look up your SQL server and see what port is it using.
my $user = "sa";
my $pwd = "[When installing the MSSQL, you will be asked to input a password for the sa user, use that password]";
my $database = "[Create a database in MSSQL and use it here]";
- $host
Go to [Programs]=>[Microsoft SQL Server 2005]=>[Configuration Tools]=>[SQL Server Configuration Manager]
Under [SQL Server 2005 Network Configuration]=>[Protocols for SQLEXPRESS]
You need to make sure TCP/IP is enabled
Right click on the properties and find the "TCP Dynamic Ports" in the "IP Address" tab - $user and $pwd
When installing the "Microsoft SQL server 2005 Express"
You should be asked to input a password for the "sa" user. - $database
Set it to whatever database you have created.
Uncomment the following lines to enable DBD:ADO
use DBI;
use DBD::ADO;
Win32::OLE->Option(CP => Win32::OLE::CP_UTF8);
- $host
- collect.cfg configuration
Open your collection's collect.cfg file and add (or set) "infodbtype mssql" - Additional information
Once the index is created, you will find the mssql connection information for the runtime code in index/text/[collection].mssdbinfo
Runtime setup
- Modified files
- win32.mak
- runtime-src/win32.mak
- runtime-src/src/colservr/win32.mak
- runtime-src/src/colservr/collectset.cpp
- common-src/win32.mak
- common-src/src/lib/win32.mak
- common-src/src/lib/mssqldbclass.cpp
- common-src/src/lib/mssqldbclass.h
- msado
Make sure you have C:\Program Files\Common Files\System\ado\msado27.tlb
If not, edit the mssqldbclass.h to use C:\Program Files\Common Files\System\ADO\msado15.dll instead - Build the system
In GSDLHOME, do nmake /f win32.mak USE_MSSQL=1
