Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Follow the instructions below to set up the IBM DB2.

...

Table of Contents
maxLevel3
minLevel3

...

styleborder:1
locationtop
typeflat
separatorpipe

...

Preparing DB2 Database

Download the latest version of DB2 Express-C and install it on your computer.

...

1. Run DB2 console. Run db2start in command line to open the DB2

Code Block

db2=> db2start

2. Create the database.

Code Block

db2=> create database DB_NAME

...

3. Before you can issue an SQL statement, you have to connect to a database. Establish the connection:

Code Block

db2=> connect to DB_NAME user USER_NAME using PASSWORD

...

4. Grant required permissions for users.

Code Block

db2=> connect to DB_NAME
db2=> grant AUTHORITY on database to user USER_NAME

(AUTHORITY : SYSADM,SYSCTRL,SYSMAINT,SYSMON,DBADM or LOAD)

...

Setup Configuration Files

1. Edit the registrydefault database configuration defined in the master-datasources.xml file  file located in the at $GREG_HOME/repository/conf directory /datasources directory of the deployed Governance Registry registry instance as below. Both the database configurations in registry.Image Removedxml and user-mgt.xml refer this data source.

Image Added

Info
titleNote

You have to replace these settings with your custom values.

Code Block

<currentDBConfig>db2-db</currentDBConfig>    <datasources>
       <datasource>
            <name>WSO2_CARBON_DB</name>
            <description>The datasource used for registry and user manager</description>
            <jndiConfig>
                <name>jdbc/WSO2CarbonDB</name>
            </jndiConfig>
            <dbConfig<definition nametype="db2-dbRDBMS">
                <configuration>
                    <url>jdbc:db2://SERVER_NAME:PORT/DB_NAME</url>
             <userName>USER_NAME</userName>       <userName>regadmin</userName>
                 <password>PASSWORD<   <password>regadmin</password>
           <driverName>com         <driverClassName>com.ibm.db2.jcc.DB2Driver</driverName>driverClassName>
                    <maxActive>50<<maxActive>80</maxActive>
                    <maxWait>360000</maxWait>
                    <minIdle>5</minIdle>
       </dbConfig>             <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                </configuration>
            </definition>
        </datasource>

The database configuration options

  • url - The URL of the database.
  • userName - The name of the database user.
  • password - The password of the database user.
  • driverName driverClassName - The class name of the database driver.
  • maxActive - The maximum number of active connections that can be allocated from this pool at the same time or negative for no limit.
  • maxWait - The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or <= 0 to wait indefinitely.
  • minIdle - The minimum number of active connections that can remain idle in the pool without extra ones being created or 0 to create none.

2. Edit the user-mgt.xml file located in the $GREG_HOME/repository/conf directory of the deployed Governance Registry instance as below.

Image Removed

Info
titleNote

You have to replace these settings with your custom values.

...

  • .

...

Info
titleTip

Default port for db2 instance is 50000.

...

Database tables can be created manually by executing the following script in DB2 Express C command editor.

Code Block

$GREG_HOME/dbscripts/db2.sql

...

Database tables can be created when starting WSO2 Governance Registry for the first time using the startup parameters as follows.

  • For Windows:

    Code Block
    $GREG_HOME/bin/wso2server.bat -Dsetup
    
  • For Linux:

    Code Block
    
    $GREG_HOME/bin/wso2server.sh -Dsetup
    

...


  • Image Added

Excerpt
hiddentrue

Instructions on how to set up Governance Registry with IBM DB2.