Follow the instructions below to set up the MS SQL database for the Governance Registry.
Setup Database and User
Enable TCP/IP
1. Open "SQL Server Configuration Manager" from Start Programs Microsoft SQL Server 2005 Configuration Tools SQL Server Configuration Manager.
2. Enable "TCP/IP" and disable "Named Pipes" from protocols of your MSSQL server.
3. Open TCP/IP Properties by double clicking "TCP/IP." Set "Listen All" to "Yes" in the "Protocol" tab.
4. From the "IP Address" tab, disable "TCP Dynamic Ports" by leaving it blank and give a valid "TCP Port" so that MSSQL server will listen in that port.
Tip
You can use port 1433 in order processor services, so it is better to use that port.
5. Similarly, enable TCP/IP from "SQL Native Client Configuration" and disable "Named Pipes." Also, check whether the port is set correctly. Port should be 1433.
6. Restart MSSQL Server.
Create Database and User
1. Open "MSSQL Management Studio" to create a database and user.
2. Go to Database New Database and specify all the options to create a new database.
3. Go to Logins New Login and specify all the necessary options.
Grant Permission
Give required grants/permission to newly created user. Grant should allow newly created user to login, create tables, insert data to tables in newly created database.
Setup Configuration File
1. Edit $GREG_HOME/repository/conf/registry.xml
and give the following:
<currentDBConfig>mssql-db</currentDBConfig> <dbConfig name="mssql-db"> <url>jdbc:jtds:sqlserver://SERVER_NAME:PORT/DB_NAME</url> <userName>USER_NAME</userName> <password>PASSWORD</password> <driverName>net.sourceforge.jtds.jdbc.Driver</driverName> <maxActive>80</maxActive> <maxWait>60000</maxWait> <minIdle>5</minIdle> </dbConfig>
2. Edit $GREG_HOME/repository/conf/user-mgt.xml
and give the following:
<Configuration> ... <Property name="url">jdbc:jtds:sqlserver://SERVER_NAME:PORT/DB_NAME</Property> <Property name="userName">USER_NAME</Property> <Property name="password">PASSWORD</Property> <Property name="driverName">net.sourceforge.jtds.jdbc.Driver</Property> <Property name="maxActive">50</Property> <Property name="maxWait">60000</Property> <Property name="minIdle">5</Property> </Configuration>
Tip
Default port for MSSQL is 1433.
Copy JDBC Driver
Copy MSSQL JDBC driver jtds-1.2.2.jar
to $GREG_HOME/repository/components/lib
.
Tip
JDBC driver can be downloaded from http://jtds.sourceforge.net/
Create Database Tables
Database tables can be created either manually by running scripts or automatically by using start-up parameters.
- Using Scripts
Database tables can be created manually by logging in to created database and running $GREG_HOME/dbscripts/mssql.sql
.
- Using start-up Parameters
Windows users can run $GREG_HOME/bin/wso2server.bat -Dsetup
to create the database tables when starting WSO2 Governance Registry for the first time.
Linux users should use $GREG_HOME/bin/wso2server.sh -Dsetup
.