|
Creating DB2 Database for Settings Persistency
The following steps must be done on the machine <database_hostname>
where the DB2 database server is installed. You must:
- create a database
- determine the value of the DB2 instance port
- determine the path of the directory containing the DB2 Universal JDBC
driver files.
These steps are required as input when running the WASSetupUI
command.
Note: The DB2 database for settings (and favorites) persistency must be
configured to use "server authentication" mode. Other modes, like "client
authentication" mode for DB2, are not supported and will fail. The DB2
server installation, or instance, used to create the DB must have
(AUTHENTICATION) = SERVER specified in the DBM configuration parameters as
follows:
$ db2 get dbm cfg |grep -i auth
Database manager authentication (AUTHENTICATION) = SERVER
Cataloging allowed without authority (CATALOG_NOAUTH) = NO
Trusted client authentication (TRUST_CLNTAUTH) = CLIENT
Bypass federated authentication (FED_NOAUTH) = NO
If it is currently (AUTHENTICATION) = CLIENT, then it would need to be
changed by issuing:
db2 update dbm cfg using AUTHENTICATION SERVER
db2stop
db2start
Furthermore, unlike for the ENOVIA database, the database for settings
(and favorites) must not be created with the COLLATE USING IDENTITY
option. If the database is created with this option, the deployed
application will randomly fail.
On Windows
Creating the database
- Logon as the database administrator, using user
<db2admin_username> and password <db2admin_password> .
- On the Windows Taskbar, select Start ->Programs ->
IBM DB2 -> General Administration Tools ->Control Center.
- Select All Cataloged
Systems-><db2servername>->Instance->DB2 -> Databases.
- Right-click Databases and in the contextual
menu select Create->Database Using Wizard.
- Enter the database name
<database_name> .
- Click Next for each display until you reach
the final display.
- Click Finish.
Determining the value of the DB2 instance port
- On Windows Taskbar, select Start->Programs->IBM
DB2->Command Line Tools->Command Window.
- Run the command:
db2 get dbm cfg | %SYSTEMROOT%\system32\find "SVCENAME"
this command gives the name of the DB2 service, for example the
output will be:
TCP/IP Service name (SVCENAME) = db2c_DB2
where db2c_DB2 is the name of the DB2 service, which is referred to as
<svcename>
in the next step.
- Run the command:
%SYSTEMROOT%\system32\find "<svcename>" %SYSTEMROOT%\system32\drivers\etc\services
Example:
%SYSTEMROOT%\system32\find "db2c_DB2" %SYSTEMROOT%\system32\drivers\etc\services
This command gives the port of the current DB2 instance. For
example, the output will be:
---------- C:\WINDOWS\SYSTEM32\DRIVERS\ETC\SERVICES db2c_DB2 50000/tcp The value of
<db2_instance_port> is 50000 in this case.
- To exit the DB2 command window, type:
exit
Determining the path of the directory containing the DB2 Universal JDBC
driver files
- On the Windows Taskbar, select Start->Programs->IBM
DB2->Command Line Tools->Command Window.
- Run the command:
echo %CD%
This command gives the path of DB2 commands, in the form of <db2 install path> \bin.
Example:
c:\SQLLIB\BIN
To find where the DB2 Universal JDBC driver files are installed on the
DB2 server machine, replace trailing '\BIN' by '\JAVA'.
Example: the path of the directory containing the DB2 Universal driver
files is:
c:\SQLLIB\JAVA
- Depending on the installation architecture:
If the DB2 server and the WebSphere Application Server
are installed on the same machine: The value of <db2_jdbc_driver_path> is the path of the directory found
in step 2.
If the DB2 server machine and the WebSphere Application
Server machine are different, copy the following files:
db2jcc.jar db2jcc_license_cu.jar db2jcc_license_cisuz.jar
from the directory found in step 2. to
<db2_jdbc_driver_path> , to a
directory on the machine <server_name> . Choose the
<db2_jdbc_driver_path> carefully, as this directory will be permanently
used by WebSphere in order to connect to the DB2 server (do not use a
temporary directory which could get accidentally cleaned up).
- To exit the DB2 command window, type:
exit
On UNIX
Creating the database
- Logon as the database administrator, using user <db2admin_username> and password
<db2admin_password>.
- Run the command:
db2 create database <database_name> Example:
db2 create database JSYSD EnvNameSuffix
Determining the value of the database instance port
- Run the command:
db2 get dbm cfg | grep SVCENAME This command gives the name of the DB2 service, for example the
output will be:
TCP/IP Service name (SVCENAME) = db2admdevc
where db2admdevc is the name of the DB2 service, which is
referred to as <svcename> in the next step.
- Run the command:
grep <svcename> /etc/services
Example:
grep db2admdevc /etc/services
This command gives the port of the current DB2 instance. For
example, the output will be:
db2admdevc 3704/tcp The value of
<database_port> is 3704 in this case.
Determining the path of the directory containing the DB2 Universal JDBC
driver files
- Run the command:
echo $PWD
This command specifies the path of DB2 commands, in the form of
<db2 instance path> .
Example:
/home/data/db2adm8/sqllib/bin
- To find where the DB2 Universal JDBC driver files are
installed on the DB2 server machine, replace trailing
\bin by
\java .
Example: the path of the directory containing the DB2 Universal driver
files is:
/home/data/db2adm8/sqllib/java
- Depending on the installation architecture:
If the DB2 server and the WebSphere Application Server
are installed on the same machine: The value of <db2_jdbc_driver_path> is the path of the directory found
in step 2.
If the DB2 server machine and the WebSphere Application
Server machine are different, copy the following files:
db2jcc.jar db2jcc_license_cu.jar db2jcc_license_cisuz.jar
from the directory found in step 2. to <db2_jdbc_driver_path> , to a
directory on the machine <server_name> . Choose the
<db2_jdbc_driver_path> carefully, as this directory will be permanently
used by WebSphere in order to connect to the DB2 server (do not use a
temporary directory which could get accidentally cleaned up).
You will be prompted for the the path of the directory containing the
DB2 Universal JDBC driver files later as explained
Creating the Enterprise Archive File. |