Linux clustered server: Configure WebSphere Portal to use DB2

View the steps to manually transfer data to the DB2database you have installed and set up. Follow these steps to transfer WebSphere Portal, and Java™ Content Repository databases to DB2. As an alternative to the manual database transfer procedure that this topic describes, you can use the configuration wizard to complete the database transfer task. However, you cannot specify all settings through the configuration wizard. For example, regardless of the method used to transfer data, run a configuration task to create JMS resources as described in this topic. For this reason, specify the required settings in the appropriate property files before transferring the database with the configuration wizard.

Before you begin:

Ensure that the following prerequisites are met:


Prerequisites


Linux clustered server: Install DB2
Linux clustered server: Modify DB2 database properties
Linux clustered server: Create groups and assigning users
Linux clustered server: Create DB2 databases
Linux clustered server: Set up DB2 automatically or manually
Tips:

  1. If you are running a type 2 connection, edit the db2cli.ini file that resides on the local system, where WebSphere Portal is installed, before you transfer data.

    The database transfer becomes unresponsive at task action-process-constraints if you do not complete these steps.

    1. Locate the file /home/db2inst1/sqllib/cfg/db2cli.ini.

    2. Add the following lines to the end of the file:

        Edit db2cli.ini:

          If a section named [COMMON] already exists in the file, extend 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
        
        
        

  2. Open a command prompt and

      cd WP_PROFILE/ConfigEngine

  3. Use a JDBC Type 2 driver only, export the DB2 user profile that you created when installing DB2 onto the administrative user using the following command. 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 database instance You must complete this step before running database tasks and before enabling security.

  4. Enter the ./ConfigEngine.sh validate-database -DWasPassword=foo command to validate configuration properties.

      Add -DTransferDomainList to specify the domains to validate; for example: -DTransferDomainList=jcr.

  5. From the same command prompt as the previous steps, cd WP_PROFILE/bin.

  6. Stop both the server1 and WebSphere_Portal servers:

    • ./stopServer.sh server1 -username admin_userid -password foo

    • ./stopServer.sh WebSphere_Portal -username admin_userid -password foo

  7. Transfer the database:

      Do not execute the database-transfer task as a background process. This might cause the task to stall.

      1. Change to the directory WP_PROFILE/ConfigEngine.

      2. Enter the following command:

          ./ConfigEngine.sh database-transfer -DWasPassword=foo 

          • To select specific database domains to transfer, set -DTransferDomainList to include only the domains that you want 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. If database transfer fails, add the following property to the command in this step: ConfigEngine.bat database-transfer -DDbtJavaMaxMemory=1536M -DWasPassword=foo

      3. After running the task, a message is added to the following log file for you to verify the task ran successfully:

          WP_PROFILE/ConfigEngine/log/ConfigTrace.log

          If the configuration fails, verify the values in wkplc.properties, wkplc_dbdomain.properties, and wkplc_dbtype.properties and then repeat this step.

  8. Optional. If you specified a runtime database user for the dbdomain.DbRuntimeUser parameter, that user must have sufficient database user privileges. To grant the database user privileges, choose either the manual steps or the command line steps:

    1. Complete these steps to manually grant database user privileges:

      1. Copy the appropriate template files to a work directory. Choose one of the following template files:

        • 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.

          JCR database domain: For the JCR database domain, also copy grantExtendedPermissionsToRuntimeRole.sql.

      2. Locate these files in the following directories, where dbms is database management system, and domain represents the database domains you are configuring. Substitute domain with release, customization, community, jcr, feedback, and likeminds as appropriate:

        • $PORTAL_HOME/base/wp.db.impl/config/templates/setupdb/dbms/domain
        • $PORTAL_HOME/pzn/prereq.pzn/config/templates/setupdb/dbms/domain

      3. Replace all placeholder values with the values as defined in wkplc_dbdomain.properties. Placeholder values are surrounded by the character @.

      4. Run these statements.

    2. Complete these steps to grant database user privileges with the ConfigEngine task:

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

      2. Run the following task: ./ConfigEngine.sh grant-runtime-db-user-privileges -DTransferDomainList=comma_separated_list_of_domains

          You only need to add -DTransferDomainList=comma_separated_list_of_domains to this task when granting privileges across specific domains.

  9. After transferring the database tables, perform a reorg check to improve performance. Perform this step for each database in the property file.

    1. Connect to a database with the following command:

        db2 connect to dbName user db2admin_userid
        
        
        

        using password

        Additional options might be required if additional security has been installed. Refer to DB2 Universal Database™ commands by example for links to the command reference.

    2. After it is connected, run the following commands from the DB2 prompt:

        db2 reorgchk update statistics on table all > xyz.out

    3. Look in the reorg column for entries marked with a star or asterisk * in the file xyz.out.

      1. For each line with *, note the tablename and run the following command for each tablename:

          db2 reorg table tablename

      2. After you have run the reorg command for each tablename, run the following commands:

          db2 terminate

          db2rbind database_name -l db2rbind.out -u db2_admin

          -p password

    4. The output file db2rbind.out is only created when there is an error for the db2rbind command.

  10. Run the ./ConfigEngine.sh create-jcr-jms-resources-post-dbxfer -DWasPassword=foo command to create JMS resources in the new database.

      Regardless of the method used to transfer data (configuration wizard or the steps in this topic), run this task to create JMS resources.

  11. Change to the directory WP_PROFILE/bin.

  12. Start the WebSphere Portal server.

      See Start and stopping servers, dmgrs, and node agents for instructions.

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:

If the files are not identical, copy icm.properties from the primary node on which you ran the database-transfer task to the node.

  1. Stop the portal server on the secondary node.

  2. Copy

      WP_PROFILE/PortalServer/jcr/lib/com/ibm/icm/icm.properties

    from the primary node and replace icm.properties on the secondary node.

  3. Start the portal server on the secondary node.


Parent

Linux clustered server: Set up a remote DB2 database


Previous

Linux clustered server: Collecting JCR collation support


Next topic

Linux clustered server: Configure DB2 for large file handling in WCM

  removed incorrect reference to wkplc_comp.properties.


+

Search Tips   |   Advanced Search