Creating a DB2 Database for Settings Persistency

Settings for the ENOVIA Web Application must be stored in a database. You will now create an empty database for Settings Persistency which will be populated by the WASSetupUI command in Creating the Enterprise Archive File.

Note: This means that you must create the database BEFORE running the WASSetupUI command.

If you wish to use a database that is not on the same machine as your installation WebSphere, then you must copy the DB2 Universal JDBC Driver files from the database machine to the machine where WebSphere is installed. This process is documented as an optional step in this section.
For this task, you will need the following inputs:

  

Input placeholder  used in this Doc task

Signification

Source

<db2admin_username> user name of the DB2 administrator account DB2 administrator
<db2admin_password> password of the DB2 administrator account DB2 administrator
<database_hostname> name of the database server DB2 administrator
<database_name> name of the database for Settings persistency Suggested value: JSYSDB18 (not more than 8 characters)
<server_name> machine name of the WebSphere Application Server WebSphere administrator

 

Output placeholder used in later Doc task

Signification

Task used in

<database_name> name of the database for Settings persistency Creating the Enterprise Archive File
<database_hostname> name of the machine hosting the database Creating the Enterprise Archive File
<database_port> port number used by the database instance Creating the Enterprise Archive File
<db2_jdbc_driver_path> path of the directory containing DB2 Universal JDBC driver files Creating the Enterprise Archive File
 
The <database_name> variable is limited to 8 characters.
 

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

  1. Logon as the database administrator, using user <db2admin_username> and password <db2admin_password>.
  2. On the Windows Taskbar, select Start ->Programs -> IBM DB2 -> General Administration Tools ->Control Center.
  3. Select All Cataloged Systems-><db2servername>->Instance->DB2 -> Databases.
  4. Right-click Databases and in the contextual menu select Create->Database Using Wizard.
  5. Enter the database name <database_name>.
  6. Click Next for each display until you reach the final display.
  7. Click Finish.

Determining the value of the DB2 instance port

  1. On Windows Taskbar, select Start->Programs->IBM DB2->Command Line Tools->Command Window.
  2. 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.
  3. 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.
  4. To exit the DB2 command window, type:

    exit

Determining the path of the directory containing the DB2 Universal JDBC driver files

  1. On the Windows Taskbar, select Start->Programs->IBM DB2->Command Line Tools->Command Window.
  2. 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
     
  3. 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).
     
  4. To exit the DB2 command window, type:

    exit

On UNIX

Creating the database

  1. Logon as the database administrator, using user <db2admin_username> and password <db2admin_password>.
  2. Run the command:

    db2 create database <database_name>
     
    Example:

    db2 create database JSYSD
    B18

Determining the value of the database instance port

  1. 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.
  2. 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

  1. 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
  2. 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
  3. 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.