Windows clustered server: Configure Type 2 DB2 drivers
This topic contains the instructions for a Type 2 configuration when the instructions differ from the Type 4 instructions. For general prerequisites and notes for each section, see the Type 4 version of topics using the same titles as the section headers. All topics in the DB2 section that are not in the Type 2 driver support section, are for a Type 4 configuration.
- Configure your DB2 client with the following commands. If we are using a remote database, complete this step separately from the WebSphere Portal installation.
db2 update dbm cfg using tp_mon_name WAS
db2 update dbm cfg using spm_name hostname, where hostname is the host name of WebSphere Portal.
Because the default for spm_name is the hostname itself, specifying the hostname parameter is optional. If the hostname is more than eight characters, use empty double quotes (" ").
For example, db2 update dbm cfg using spm_name " ".
- Before installing DB2, log in with a user ID that has administrative authority. This user should have the following specifications:
- Belong to the local Administrator group
- Act as part of the operating system
- Have permissions to create a token object
- Windows 2003 only: Have permissions to adjust memory quotas for a process
- Have permissions to replace a process level token
To edit user rights:
- For the first two specifications: Click Start > Programs > Administrative Tools > Computer Management > Local Users and Groups.
- For the last four specifications: Click Start > Programs > Administrative Tools > Local Security Policy. Then, click Local Policies > User Rights Assignment.
- Install DB2 or DB2 client.
- If DB2 is installed on another system than WebSphere Portal, ensure the appropriate DB2 client is installed on the same system as WebSphere Portal and have the same name as the server profile name.
Create a remote or local DB2 database manually
- Log in as a DB2 instance system authority.
For example, we can log in as db2inst1 as the DB2 instance owner.
- Ensure that the database user has been created, granted appropriate privileges, and has a password assigned to it. If the user has not been created, refer to the Creating users topic for information on how to create users.
- Initialize a DB2 command environment by opening a command prompt and typing db2cmd.
In this mode, you must type db2 at the beginning of each command and use double quotation marks ("")
If we are using the Command Line Processor (CLP), refer to the DB2 documentation for details. The command prompt is db2=>. In this mode, commands can be entered without the db2 prefix or the double quotation marks. However, the following steps assume we are not using the CLP and are entering commands from the $ prompt.
- Run the following commands on the DB2 server system to configure the DB2 database instance:
db2set DB2COMM=TCPIP db2set DB2_EVALUNCOMMITTED=YES db2set DB2_INLIST_TO_NLJN=YES db2 "UPDATE DBM CFG USING query_heap_sz 32768" db2 "UPDATE DBM CFG USING sheapthres 0"
- Create databases:
- Replace dbname with the actual name of the database. Run the commands and each time replace dbname with the actual values for release, community, customization, Java Content Repository, Feedback, and Likeminds. You will need to run the commands once for each database for a total of six times.
DB2 database names cannot exceed eight characters. Therefore, consider using these database names: release, commun, custom, jcrdb, fdbkdb, and lmdb.
db2 "CREATE DB dbname using codeset UTF-8 territory us PAGESIZE 8192" db2 "UPDATE DB CFG FOR dbname USING applheapsz 4096" db2 "UPDATE DB CFG FOR dbname USING app_ctl_heap_sz 1024" db2 "UPDATE DB CFG FOR dbname USING stmtheap 32768" db2 "UPDATE DB CFG FOR dbname USING dbheap 2400" db2 "UPDATE DB CFG FOR dbname USING locklist 1000" db2 "UPDATE DB CFG FOR dbname USING logfilsiz 4000" db2 "UPDATE DB CFG FOR dbname USING logprimary 12" db2 "UPDATE DB CFG FOR dbname USING logsecond 20" db2 "UPDATE DB CFG FOR dbname USING logbufsz 32" db2 "UPDATE DB CFG FOR dbname USING avg_appls 5" db2 "UPDATE DB CFG FOR dbname USING locktimeout 30" db2 "UPDATE DB CFG FOR dbname using AUTO_MAINT off"The following steps are only required for the IBM Java Content Repository database.
- On the DB2 server systems to create bufferpools and table spaces for the IBM Java Content Repository database (jcrdb).
- jcrdb is the name of the database used to store user data and objects
- jcr is the jcr user for jcrdb
This value can be replaced with any Ithat has administrative authority.
- dbpassword is the password for the jcr user for the jcrdb
The commands in this step are different for DB2 and DB2 pureScale. Run the appropriate commands for the environment.
- DB2
db2 "CONNECT TO jcrdb USER jcr USING dbpassword" db2 "CREATE BUFFERPOOL ICMLSFREQBP4 SIZE 1000 PAGESIZE 4 K" db2 "CREATE BUFFERPOOL ICMLSVOLATILEBP4 SIZE 16000 PAGESIZE 4 K" db2 "CREATE BUFFERPOOL ICMLSMAINBP32 SIZE 16000 PAGESIZE 32 K" db2 "CREATE BUFFERPOOL CMBMAIN4 SIZE 1000 PAGESIZE 4 K" db2 "CREATE REGULAR TABLESPACE ICMLFQ32 PAGESIZE 32 K MANAGED BY SYSTEM USING ('ICMLFQ32') BUFFERPOOL ICMLSMAINBP32" db2 "CREATE REGULAR TABLESPACE ICMLNF32 PAGESIZE 32 K MANAGED BY SYSTEM USING ('ICMLNF32') BUFFERPOOL ICMLSMAINBP32" db2 "CREATE REGULAR TABLESPACE ICMVFQ04 PAGESIZE 4 K MANAGED BY SYSTEM USING ('ICMVFQ04') BUFFERPOOL ICMLSVOLATILEBP4" db2 "CREATE REGULAR TABLESPACE ICMSFQ04 PAGESIZE 4 K MANAGED BY SYSTEM USING ('ICMSFQ04') BUFFERPOOL ICMLSFREQBP4" db2 "CREATE REGULAR TABLESPACE CMBINV04 PAGESIZE 4 K MANAGED BY SYSTEM USING ('CMBINV04') BUFFERPOOL CMBMAIN4" db2 "CREATE SYSTEM TEMPORARY TABLESPACE ICMLSSYSTSPACE32 PAGESIZE 32 K MANAGED BY SYSTEM USING ('icmlssystspace32') BUFFERPOOL ICMLSMAINBP32" db2 "CREATE SYSTEM TEMPORARY TABLESPACE ICMLSSYSTSPACE4 PAGESIZE 4 K MANAGED BY SYSTEM USING ('icmlssystspace4') BUFFERPOOL ICMLSVOLATILEBP4" db2 "CREATE USER TEMPORARY TABLESPACE ICMLSUSRTSPACE4 PAGESIZE 4 K MANAGED BY SYSTEM USING ('icmlsusrtspace4') BUFFERPOOL ICMLSVOLATILEBP4" db2 "UPDATE DB CFG FOR jcrdb USING DFT_QUERYOPT 2" db2 "UPDATE DB CFG FOR jcrdb USING PCKCACHESZ 16384" db2 "DISCONNECT jcrdb" db2 "TERMINATE"
- DB2 pureScale
db2 "CONNECT TO jcrdb USER jcr USING dbpassword" db2 "CREATE BUFFERPOOL ICMLSFREQBP4 SIZE 1000 PAGESIZE 4 K" db2 "CREATE BUFFERPOOL ICMLSVOLATILEBP4 SIZE 16000 PAGESIZE 4 K" db2 "CREATE BUFFERPOOL ICMLSMAINBP32 SIZE 16000 PAGESIZE 32 K" db2 "CREATE BUFFERPOOL CMBMAIN4 SIZE 1000 PAGESIZE 4 K" db2 "CREATE REGULAR TABLESPACE ICMLFQ32 PAGESIZE 32 K MANAGED BY SYSTEM USING ('ICMLFQ32') BUFFERPOOL ICMLSMAINBP32" db2 "CREATE REGULAR TABLESPACE ICMLNF32 PAGESIZE 32 K MANAGED BY SYSTEM USING ('ICMLNF32') BUFFERPOOL ICMLSMAINBP32" db2 "CREATE REGULAR TABLESPACE ICMVFQ04 PAGESIZE 4 K MANAGED BY SYSTEM USING ('ICMVFQ04') BUFFERPOOL ICMLSVOLATILEBP4" db2 "CREATE REGULAR TABLESPACE ICMSFQ04 PAGESIZE 4 K MANAGED BY SYSTEM USING ('ICMSFQ04') BUFFERPOOL ICMLSFREQBP4" db2 "CREATE REGULAR TABLESPACE CMBINV04 PAGESIZE 4 K MANAGED BY SYSTEM USING ('CMBINV04') BUFFERPOOL CMBMAIN4" db2 "CREATE SYSTEM TEMPORARY TABLESPACE ICMLSSYSTSPACE32 PAGESIZE 32 K BUFFERPOOL ICMLSMAINBP32" db2 "CREATE SYSTEM TEMPORARY TABLESPACE ICMLSSYSTSPACE4 PAGESIZE 4 K BUFFERPOOL ICMLSVOLATILEBP4" db2 "CREATE USER TEMPORARY TABLESPACE ICMLSUSRTSPACE4 PAGESIZE 4 K BUFFERPOOL ICMLSVOLATILEBP4" db2 "UPDATE DB CFG FOR jcrdb USING DFT_QUERYOPT 2" db2 "UPDATE DB CFG FOR jcrdb USING PCKCACHESZ 16384" db2 "DISCONNECT jcrdb" db2 "TERMINATE"
- On the DB2 client, check the services file. If it does not specify DB2 connection and interrupt service ports, specify the ports for the operating system:
Edit /etc/servicesand add the following text:
db2c_db2inst1 port1/tcp...where db2inst1 is the default instance and port1 is the TCP port DB2 listens on. Replace port1 with the actual port number that assigned to the DB2 connection service in the DB2 server installation
The /etc/services file is located under %systemroot%/system32/drivers/, where %systemroot% is the location of the operating system.
For example C:\Windows\system32\drivers\etc\services.
- On the DB2 client, edit /etc/services file. If it does not specify the DB2 connection service port, add the following text to specify the port for the remote DB2 instance:
DB2_db2inst1 port1/tcp # DB2 connection service port
...where db2inst1 is the name of the DB2 instance on the system, and port1 with the actual port number assigned to the DB2 connection service in the DB2 server installation . The connection service port on the DB2 Client system, WebSphere Portal server, must match the connection service port on the DB2 server. The ports should match by number but not necessarily by name.
- Set up the correct service name by entering the following command on the DB2 server system: db2 "UPDATE DBM CFG USING svcename svce_name" where svce_name is the connection service port namspecified in substep b, such as db2c_db2inst1.
- On the DB2 client, set DB2COMM to TCP/IP using the db2set command db2set DB2COMM=tcpip.
- Catalog the TCP/IP node with the IP address of the remote database server on DB2 Connect: db2 "catalog tcpip node remote_db_node_alias remote database_server_node server connection_service_port" where:
- remote_db_node_alias is the alias name of the database server that we are defining for the WAS node name. The alias name can contain one to eight characters.
- database_server_node is the fully qualified host name of the database server system.
- connection_service_port is the name of the DB2 connection service port configured in the /etc/services file on the database server system.
- Catalog the WebSphere Portal databases on DB2 Connect, where:
- remote_db_name_domain, is the cataloged name of the databases on the server system for each domain.
- domain_alias_name, is the database alias names that we are defining.
- remote_db_node_alias is the name that was used previously when you cataloged the TCP/IP node in the previous step.
The alias for each database must be different from the actual database name and can only contain up to eight characters.
db2 "catalog db remote_db_name_release as release_alias_name at node remote_db_node_alias" db2 "catalog db remote_db_name_community as comm_alias_name at node remote_db_node_alias" db2 "catalog db remote_db_name_customization as cust_alias_name at node remote_db_node_alias" db2 "catalog db remote_db_name_fdbkdb as fdbkdb_alias_name at node remote_db_node_alias" db2 "catalog db remote_db_name_lmdb as lmdb_alias_name at node remote_db_node_alias" db2 "catalog db remote_db_name_jcrdb as jcrdb_alias_name at node remote_db_node_alias"
- Log out of DB2 Connect by entering db2 "terminate".
- On DB2 Connect, test the remote connection by issuing the following command in the DB2 command window: db2 "connect to alias_name user username using password", where alias_name is the alias name definedd previously, username is the database user, and password is the password assigned to the database user.
Configure a portal to use the database
- Edit the db2cli.ini file that resides on the local system, where WebSphere Portal is installed, before you transfer data.
Important: The database transfer becomes unresponsive at task action-process-constraints if you do not complete these steps.
- Locate the file /home/db2inst1/sqllib/cfg/db2cli.ini.
- Add the following lines to the end of the file:
Edit db2cli.ini:
- If a section named [COMMON] already exists in the file, extent that section by adding the following lines. Otherwise, add a [COMMON] section to the file.
- Leave an empty line after ReturnAliases=0.
[COMMON] DYNAMIC=1 ReturnAliases=0
- cd WP_PROFILE/ConfigEngine
- Export the DB2 user profile that createdd when installing DB2 onto the administrative user . This command exports the DB2 user's profile onto the administrative user so that they can access the DB2 utilities.
. /home/db2inst1/sqllib/db2profile...where db2inst1 represents the database instance
Complete this step before running database tasks and before enabling security.
- Validate configuration properties...
./ConfigEngine.sh validate-database -DWasPassword=foo
Add -DTransferDomainList to the validating task to specify the domains to validate; for example...
-DTransferDomainList=jcr
To validate all domains, do not specify this parameter.
- cd WP_PROFILE/bin
- Stop the WebSphere_Portal server:
./stopServer.sh WebSphere_Portal -username wpadmin -password foo
- Transfer the database:
Important: Do not execute the database-transfer task as a background process. This might cause the task to stall.
- cd WP_PROFILE/ConfigEngine
./ConfigEngine.sh database-transfer -DWasPassword=foo
- Set -DTransferDomainList to include only the domains to transfer.
For example, to transfer only the JCR domain...
./ConfigEngine.sh database-transfer -DTransferDomainList=jcr -DWasPassword=foo
- If you have been storing data in Apache Derby for a long time, database transfer could fail with OutOfMemory exceptions. To fix:
ConfigEngine.bat database-transfer -DDbtJavaMaxMemory=1536M -DWasPassword=foo
- Log output is written to:
WP_PROFILE/ConfigEngine/log/ConfigTrace.log
If the configuration fails, verify the values in the wkplc.properties, wkplc_dbdomain.properties, and wkplc_dbtype.properties files and then repeat this step.
- If dbdomain.DbRuntimeUser is set that user must have sufficient database user privileges:
- To manually grant database user privileges:
- Copy the appropriate template files to a work directory:
- createRuntimeRoleForDifferentSchema.sql
If the name of the database user and the schema name are not the same.
- createRuntimeRoleForSameSchema.sql
If the name of the database user and the schema name are the same.
Files are in the following directories, where dbms is the database management system, and domain represents the database domains we are configuring (release, customization, community, jcr, feedback, and likeminds):
- PORTAL_HOME/base/wp.db.impl/config/templates/setupdb/dbms/domain
- PORTAL_HOME/pzn/prereq.pzn/config/templates/setupdb/dbms/domain
JCR database domain: For the JCR database domain, copy grantPermissionsToRuntimeRoleStatic.sql from the following directory:
PORTAL_HOME/jcr/wp.content.repository.install/config/templates/setupdb/dbms/jcr/grantPermissionsToRuntimeRoleStatic.sql .
- Replace all placeholder values with the values as defined in wkplc_dbdomain.properties. Placeholder values are surrounded by the character @.
- Execute the SQL statements.
- Grant database user privileges:
- Ensure the database administrator user ID is specified for domain.DBA.DbUser in...
WP_PROFILE/ConfigEngine/properties/wkplc_dbdomain.properties
For example, domain.DBA.DbUser=dbadmin.
./ConfigEngine.sh grant-runtime-db-user-privileges -DTransferDomainList=release,customization,community,etc...
You only need to add -DTransferDomainList when granting privileges across specific domains.
- Perform a reorg check to improve performance. Perform this step for each database in the property file.
- Connect to a database:
db2 connect to dbName user db2wpadmin using password
Additional options might be required if additional security has been installed. Refer to DB2 Universal Databaseā¢ commands by example .
- Run the following commands from the DB2 prompt:
db2 reorgchk update statistics on table all > xyz.out
- Look in the reorg column for entries marked with a star or asterisk * in the file xyz.out.
- For each line with *, note the tablename and run the following command for each tablename:
db2 reorg table tablename
- After you have run the reorg command for each tablenames:
db2 terminate
db2rbind database_name -l db2rbind.out -u db2_admin -p password
- The file db2rbind.out is created when there is an error.
- cd WP_PROFILE/bin
- Start the WebSphere Portal server.
If you have additional nodes already configured, compare the following file on all nodes with the file from the primary node. Ensure all instances of the file are identical:
WP_PROFILE/PortalServer/jcr/lib/com/ibm/icm/icm.properties
If the files are not identical, copy icm.properties from the primary node on which you ran the database-transfer task to the node.
- Stop the portal server on the secondary nodes.
- Copy
WP_PROFILE/PortalServer/jcr/lib/com/ibm/icm/icm.properties
from the primary node and replace icm.properties on the secondary nodes.
- Start the portal server on the secondary nodes.