Troubleshooting databases


Content:

  1. Unable to connect to database
  2. When using multi-rows in a database, you cannot have application data objects referencing each other.
  3. Changing WebSphere Portal schema in the database
  4. Configuration task to drop database fails on DB2
  5. Database transfer import task fails due to % in password
  6. Databases fail to deploy when configuring with IBM Web Administration for iSeries
  7. Database configuration tasks appear to hang

See Also:

  1. Troubleshoot DB2 Universal Database for iSeries


 

Unable to connect to database

When attempting to connect to a database using a password that is about to expire, you might receive connection errors.

If you are trying to connect to a database using a valid username and password but are receiving a connection error, it might be that you are using a password that is about to expire. When WebSphere Portal tries to make a connection to the database, a warning message is returned. This is not what WebSphere Portal was expecting and will, therefore, give a connection error.

You can solve this by manually resetting the password for your database user from within the database management system. This will stop the warning messages and allow WebSphere Portal to connect to the database without a problem.


 

When using multi-rows in a database, you cannot have application data objects referencing each other.

When using multi-rows in a database, you cannot have application data objects referencing each other which causes circular references. The solution is to not use multi-row schema for a session database.


 

Changing WebSphere Portal schema in the database

After you have configured WebSphere Portal, you may want to switch a schema or username of the database where the portal server database objects were created. For example, the portal server tables are created under a schema or username in the database named wpsadmin but you want to change the schema or username to portaladmin.

Solution: To make this change, perform the following steps:

  1. Create a user in the database. For example, portaladmin.

  2. Move the objects and data owned by wpsadmin to portaladmin.

  3. Change the J2C Authentication Data Entries for the desired datasource through the administrative console by navigating to

    Resources | JDBC Providers | jdbc provider name | Data Sources | datasource name | J2C Authentication Data Entries | <j2c entry name

  4. Change the username to portaladmin and supply the password.

  5. Restart the portal server. Each datasource has a J2C Authentication Data Entry defined under Component Managed Authentication Alias.

When the portal code uses this datasource to access the database, it logs in under the new username or schema and performs portal server database operations. As long as the database objects and data exist under this schema, the portal server code can perform its database operations.


 

Configuration task to drop database fails on DB2

Problem: Configuration task to drop database fails on DB2
If the database already exists it will be removed (or dropped) as part of the install process. This error can occur if the existing database is in use or locked by another process. You might see the following error:

[exec] DROP DATABASE wpcp50
[exec] SQL1137W The database manager was unable to remove the database path or some
[exec] of the containers when dropping database "WPCP50". Cleanup is required.
[exec] Result: 4

Solution: This problem can be solved using one of the following options:


 

Database transfer import task fails due to % in password

Problem: When transferring database information from Cloudscape to DB2, the configuration task WPSConfig database-transfer-import fails with the following error:

  action-wmm-populate-db2:
  [java] Connected to jdbc:db2:wps50
  [java] Reading file C:\Program
  Files\WebSphere\PortalServer\config\DBTransfer\wps\wmmdb2insert.
  sql 
  [java] ALTER TABLE DB2ADMIN.WMMDBACMPV DROP CONSTRAINT 
  WMMF_39 
  [java] 
  [java] Not required 
  [java] INSERT INTO DB2ADMIN.WMMDBKEYS 
  (WMMDBKEYS_ID,TABLENAME,COLUMNNAME,COUNTER,PREFETCHSIZE,LOWERBOU 
  ND,UPPER 
  BOUND) VALUES 
  (-1,'WMMDBMBR','WMMDBMBR_ID',52,50,0,6999999999999999999)
  [java] 
  [java] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI 
  Driver][DB2/NT] 
  SQL0204N "DB2ADMIN.WMMDBKEYS" is an undefined name.
  SQLSTATE=42704 
  [java] 

  BUILD FAILED 

This task fails because the character "%" was used in the WMMDbPassword field of the wpconfig.properties file.

Solution

Option 1: Do not use a "%" in the database password for Member Manager during database transfer. You can change the password once database transfer is complete.

Option 2: Modify wp_root/config/templates/wmm/bin/setenv.bat by changing:

set DB_PASSWORD=@WmmDbPassword@

to

set DB_PASSWORD=pass%%word (assuming your WMMDbPassword field in the wpconfig.properties = "pass%word")

This modification should be done prior to running the import task for the database transfer.

More Information: In the batch file, the percent sign (%) needs to be escaped by using an extra percent sign (%%). That way, a single percent sign can be used within the command line. During Member Manager installation preparation, two parameters in teh Member Manager setenv.batfile need to be handled for special character '%'. They are DB_USER and DB_PASSWORD. For example, if the real password is "user1%pwd", the value set in setenv.bat should be "user1%%pwd".


 

Databases fail to deploy when configuring with IBM Web Administration for iSeries

If databases fail to deploy when configuring WebSphere Portal with IBM Web Administration for iSeries, check...

/QIBM/UserData/Webas5/Base/<instance>/logs/<instance>/WPSWIZARD_<timestamp>_create-all-db.log

...for the following error...

[java] java.lang.RuntimeException: error when creating statement [CPF0006] Errors occurred in command. 

[java] java/lang/Throwable.(Ljava/lang/String;)V+4 (Throwable.java:85)
[java] java/lang/Exception.(Ljava/lang/String;)V+1 (Exception.java:33) [java] java/lang/RuntimeException.(Ljava/lang/String;)V+1 (RuntimeException.java:38)
[java] com/ibm/wps/config/SqlProcessor.process([Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I+0 (SqlProcessor.java:78)
[java] com/ibm/wps/config/SqlProcessor.main([Ljava/lang/String;)V+0 (SqlProcessor.java:478)

This error occurs when the user ID selected as the WebSphere Portal database owner does not have authority to the CHGJOB command. The configuration wizard requires this authority to autoreply when the system would otherwise require a response from the user. Without this authority, the create-all-db configuration task fails, and databases are not deployed.

Solution: Ensure the user ID selected as the WebSphere Portal database owner has authority to the CHGJOB command.


 

Database configuration tasks appear to hang

If a database configuration task appears to hang, check the QSYSOPR queue on your iSeries system for messages. The system might require a response from you in order to complete the task. To check the QSYSOPR queue, enter the following command on an OS/400 command line:

DSPMSG QSYSOPR

See also