Database transfer: Set up JCR collation

Manual steps from the Configuration Wizard are included in IBM Knowledge Center for reference and for advanced users. The procedure includes variables and steps for different databases. When you use the wizard to configure your deployment, it replaces the variable with information that you provided in the wizard. It also shows only the steps that are specific to your environment. The instructions that the wizard generates are specific to your environment.

About this task

Attention: All steps for all database environments are included without consideration for your environment. Use the Configuration Wizard to generate custom instructions for your environment.
JCR collation is recommended when the language locales of your users do not natively collate correctly in the DB2® database and when language locale correct ordering is important.

Procedure

  1. Stop the WebSphere® Portal server.
  2. Copy files from the WebSphere Portal server to a temporary directory on the DB2 server.
    • ${WpsInstallLocation}/jcr/wp.content.repository.install/lib/wp.content.repository.install.jar
    • ${WasUserHome}/PortalServer/jcr/config/registerCollationUDFTemplate.sql

Set up collation on the database where the JCR domain is located.

  1. Change to this directory:

    db2_instance_owner_home/sqllib/function

  2. Enter this command:

    db2home/sqllib/java/jdk/bin/jar -xvf ${wf.ejp.collationTempDir}/wp.content.repository.install.jar icm/CollationUDF.class

  3. Change to the temporary directory where you copied the files in a previous step. For example, you can use this temporary directory on the DB2 server:

    ${wf.ejp.collationTempDir}

  4. Open the file registerCollationUDFTemplate.sql, and change the multiple <SCHEMA> references to the JCR schema; for example, JCR. The value set for <SCHEMA> should match the value set for the jcr.DbSchema property. You specify jcr.DbSchema in the configuration file wkplc_dbdomain.properties when you modify database properties.
  5. Connect to the JCR database.

    db2 connect to ${jcr.DbName} user ${jcr.DBA.DbUser} using ${jcr.DBA.DbPassword}

  6. Enter this command to run the script:

    db2 -tvf ${wf.ejp.collationTempDir}/registerCollationUDFTemplate.sql

  7. Disconnect from the JCR database.
  8. Restart the DB2 instance.

Verify that the UDF is registered properly.

  1. Log in as ${jcr.DbUser}.
  2. Open a DB2 terminal window.
  3. Connect to the database that contains JCR domain:

    db2 connect to ${jcr.DbName} user ${jcr.DbUser} using ${jcr.DbPassword}

  4. When you have connected to the JCR database, verify that the UDF is registered properly. To verify the UDF registration, run this command:

    db2 values ${jcr.DbSchema}.sortkeyj('abc','en')

  5. Disconnect from DB2 terminal window:
    db2 disconnect all
    db2 terminate
  6. Start the WebSphere Portal server.

Update the collation configuration options.

  1. Log in to WebSphere Integrated Solutions Console.
  2. Go to Resources > Resource Environment > Resource Environment Providers > JCR ConfigService PortalContent > Custom properties.
  3. Add or update the following properties as necessary:
    Enable/Disable collation support for all DB2 platforms(LUW, Z, I), this is disabled (false) by default
    Name: jcr.query.collation.db2.enabled
    Value: true
    Type: java.lang.String
    Name: jcr.query.collation.en
    Value: en
    Type: java.lang.String
  4. To apply your settings, stop WebSphere Portal, and then restart WebSphere Portal.