Set up the DB2 databases manually
We can set up the database manually, instead of using Ant tasks.
Set up the DB2 database by creating the database schema. The following procedure creates the schemas for WRKLGHT and WLREPORT in different databases, but it is possible to group them in the same database. In this case, skip step 5.
- Create a system user, worklight, in a DB2 admin group such as DB2USERS. Give it the password password. See DB2 documentation and the documentation for the operating system.
Important: We can name the user differently, or set a different password, but ensure that you enter the appropriate user name and password correctly across the DB2 database setup. DB2 has a user name and password length limit of 8 characters for UNIX and Linux systems, and 30 characters for Windows.
If we want multiple instances of MPF Server to connect to the same database, use a different user name for each connection. Each database user has a separate default schema.
- Open a DB2 command line processor, with a user with SYSADM or SYSCTRL permissions:
- On Windows systems, click Start > IBM DB2 > Command Line Processor.
- On Linux or UNIX systems, go to ~/sqllib/bin and enter ./db2.
- Enter the following database manager and SQL statements to create a database called WRKLGHT:
CREATE DATABASE WRKLGHT COLLATE USING SYSTEM PAGESIZE 32768 CONNECT TO WRKLGHT GRANT CONNECT ON DATABASE TO USER worklight QUITWhere worklight is the name of the system created previously. If we defined a different user name, replace worklight with the user name.
- Run DB2 with the following commands to create the WRKLGHT tables:
db2 CONNECT TO WRKLGHT USER worklight USING password db2 SET CURRENT SCHEMA = 'WRKSCHM' db2 -vf MF_HOME/WorklightServer/databases/create-worklight-db2.sql -tWhere worklight after USER is the name of the system user with "CONNECT" access to the WRKLGHT database that you previously created, and password after USING is this user's password. If we defined either a different user name, or a different password, or both, replace worklight, or password, or both.
DB2 has a user name and password length limit of 8 characters for UNIX and Linux systems, and 30 characters for Windows.
Important: If we do not specify the user name and password, DB2 assumes that the user is the current user, and creates the tables using this current user's schema. If the current user differs from the settings in Worklight, then the current user is denied access to the tables in the database.
- Enter the following database manager and SQL statements to create a database called WLREPORT:
CREATE DATABASE WLREPORT COLLATE USING SYSTEM PAGESIZE 32768 CONNECT TO WLREPORT GRANT CONNECT ON DATABASE TO USER worklight QUIT
- Run DB2 with the following commands to create the WLREPORT tables:
db2 CONNECT TO WLREPORT USER worklight USING password db2 SET CURRENT SCHEMA = 'WLRESCHM' db2 -vf MF_HOME/WorklightServer/databases/create-worklightreports-db2.sql -t
Parent topic: Configure the DB2 databases manually