Upgrading Db2 (Linux)

Applies to: On premises

You can upgrade to IBM® Db2® 12.1.

Do this task, for example, if you're using 11.5.5 and you want to upgrade to 12.1.

This task provides the basic steps for upgrading IBM Db2. For more information about this process, see the IBM Db2 documentation.

About this task

This task uses the following conventions:
  • db2inst1: The OpenPages® database instance owner
  • openpage: The OpenPages database user
  • opx: The name of the OpenPages database
  • db2inst2: The Cognos® database instance owner
  • cognosdb: The name of the Cognos content store
  • <db_server>: The hostname of the Db2 database server

The steps that you need to do depend on whether you are using your existing database server for OpenPages or using a new database server. If you are using a new database server, you skip the steps about upgrading the database instances and upgrading the databases. Later in the OpenPages migration process, you restore the databases and then upgrade them to the new Db2 version.

Note: When you run Db2 utilities, such as db2 connect or db2rbind, do not use quotation marks around passwords.

Procedure

  1. Stop the following servers:
    • Stop all OpenPages application servers.
    • Stop the global search services.
    • Stop all IBM Cognos services.
    • If you're upgrading from 9.1.x, stop the OpenPages Cognos Integration service.
  2. Mount the IBM Db2 installation media or extract the downloaded installation package onto your file system.
    1. Log in as the instance owner.
    2. Create a directory. Do not create it under /sqllib.
    3. Extract the Db2 installation package to the directory that you created.
  3. Check that your system meets the installation prerequisites.
    1. Go to the directory where you extracted the Db2 installation package.
    2. As the root or sudo user, check the installation requirements.
      ./db2prereqcheck –i -v <version>

      Where <version> is the Db2 version that you want to install.

      For example:
      ./db2prereqcheck –i -v 12.1.0.0
      If successful, you see the message DBT3533I The db2prereqcheck utility has confirmed that all installation prerequisites were met.
    3. Review the log file.
    4. As the OpenPages instance owner (for example, db2inst1), run the pre-upgrade checks:
      ./db2ckupgrade OPX -l /tmp/db2ckupgrade.log -u db2inst1 -p password
  4. Complete the Db2 pre-upgrade tasks for both the OpenPages database and the Cognos database. For more information, see Pre-upgrade tasks for Db2 servers.

    If you get warnings about the discontinued SYSFUN.ASCII1 function, you can ignore them.

  5. Check the value of the application heap size for the Cognos database.
    1. Run the following command as the database instance owner. Replace <cognosdb> with the name of your Cognos database.
      db2 get db cfg for <cognosdb> | grep -i APPLHEAPSZ
    2. If the value is less than 4096, increase it to a minimum of 4096.

      Run the following command as the database instance owner. Replace <cognosdb> with the name of your Cognos database.

      db2 update db cfg for <cognosdb> using applheapsz 4096
  6. Drop the Db2 Text Search index and disable Db2 Text Search.
  7. Back up the OpenPages database and the Cognos database.
  8. Run the Db2 installation program to upgrade IBM Db2
    1. Log on to the database server as the root user. Go to the directory that you created in step 2. Run the db2setup command.
      ./db2setup
    2. Click Install a Product and New Install.
    3. For the Product, choose DB2 Version 12.1 Server Editions.
    4. Select the Custom option.
    5. Do one of the following steps:
      If you are moving to a new database server
      Check the Create an instance checkbox.

      For example, if you are migrating to a new version of OpenPages and you want to use a new database server, enable the Create an instance option.

      If you are using your existing database server
      Clear the Create an instance checkbox.

      For example, if you are upgrading or if you are migrating and you are using your existing database server, clear the checkbox.

    6. Expand Server Support and select Db2 Text Search for installation.
    7. If you do not use Tivoli® SA MP, clear the Tivoli SA MP check box.
    8. Accept the default settings on the remaining pages of the wizard.
    9. When the installation process completes, review the log files.
    10. Click Finish.
  9. If you are upgrading Db2 on your existing database server, upgrade your OpenPages database instance.
    Perform this step as the root user. For more information, see the Db2 documentation.

    If you are using a new database server, go to step 14.

    1. Stop all Db2 databases.
    2. Edit the /etc/services file and remove any existing entry for the Db2 text service.
      For example, remove db2j_db2inst1 55000/tcp, which is the default entry.
    3. Upgrade the OpenPages database instance.
      Run the db2iupgrade command. For example:
      cd /opt/ibm/db2/V12.1/instance
      ./db2iupgrade -u db2fenc1 -j "TEXT_SEARCH,db2j_db2inst1,55000" db2inst1
    4. View the log file, for example /tmp/db2iupgrade.log.20620. Verify that the upgrade was successful. Look for the message DBI1070I Program db2iupgrade completed successfully.
    5. Verify the upgrade.
      cd /opt/ibm/db2/V12.1/bin/
      ./db2val
    6. Check the installation level of the OpenPages database instance.
      For more information, see db2level - Show Db2 service level command.
      db2level
      Look for a return value that matches the version that you are installing. For example, look for a return value of DB2 v12.1.0.0.
  10. Upgrade your Cognos database instance.
    Perform this step as the root user
    For more information, see the Db2 documentation.
    Note: Do this step after the OpenPages database instance upgrade completes successfully.
    1. Upgrade the Cognos database instance.
      Run the db2iupgrade command. For example:
      cd /opt/ibm/db2/V12.1/instance
      ./db2iupgrade -u db2fenc1 db2inst2
    2. View the log file, for example /tmp/db2iupgrade.log.18463. Verify that the upgrade was successful. Look for the message DBI1070I Program db2iupgrade completed successfully.
    3. Verify the upgrade.
      cd /opt/ibm/db2/V12.1/bin/
      ./db2val
    4. Check the installation level of the Cognos database instance.
      For more information, see db2level - Show Db2 service level command.
      db2level
      Look for a return value that matches the version that you are installing. For example, look for a return value of DB2 v12.1.0.0.
  11. If you are using Db2 Administration Server (DAS), upgrade the service.
    For example:
    cd /opt/ibm/db2/V12.1/instance
    ./dasmigr
    The value DBI1070I Program dasmigr completed successfully indicates success.
  12. Upgrade your OpenPages database.
    Do this step as a user with SYSADM authority.
    For more information, see Upgrading databases in the Db2 documentation.
    For example:
    db2start 
    db2 upgrade database opx user db2inst1 using password
  13. Upgrade your Cognos database.
    Do this step as a user with SYSADM authority.
    For more information, see Upgrading databases in the Db2 documentation.
    For example:
    db2start 
    db2 upgrade database cognosdb user db2inst2 using password
  14. Configure and enable Db2 Text Search, create the index, and schedule a job to synchronize the index.
    1. Start Db2 Text Search.
      db2ts START FOR TEXT
    2. Create the index.
      Go to the directory that you created in step 2, go to the TEXT_INDEXING subdirectory, and then run the following command:
      clpplus -nw @sql-wrapper CustomIndexing_Step1_AddTextIndexing_to_DB.sql CustomIndexing_Step1_AddTextIndexing_to_DB.log <db_server>:50000/opx db2inst1 'password' OPENPAGE
      A warning like the following message is expected and you can ignore it:
      MESSAGE = <CIE99>CIE0212W Incomplete enablement of the Text Search server.
       Reason code = "01"
    3. Update the configuration of the text server in the database.
      cd /home/db2inst1/sqllib/db2tss/bin
      TS_AUTH_TOKEN=`configTool printToken | awk 'NR == 2 {print}'`
      TS_ENCRYPT_KEY=`configTool printToken | awk 'NR == 4 {print}'`
      db2 connect to OPX
      db2 select "*" from sysibmts.tsservers | grep $TS_AUTH_TOKEN
      if [ $? != 0 ]; then
          echo "*** Registering text search server manually! ***"
          db2 "insert into SYSIBMTS.TSSERVERS (HOST, PORT, TOKEN, key, SERVERTYPE, SERVERSTATUS) 
          values ('<db_server>', 55000, '$TS_AUTH_TOKEN', '$TS_ENCRYPT_KEY', 1, 0)"
      fi
    4. Re-create the text indexes and set up a schedule for refreshing them.
      Go to the directory that you created in step 2, go to the TEXT_INDEXING subdirectory, and then run the following command:
      clpplus -nw @sql-wrapper CustomIndexing_Step2_IndexCreate.sql CustomIndexing_Step2_IndexCreate.log <db_server>:50000/OPX openpage passw0rd "'*'" "'*'" "0,5,10,15,20,25,30,35,40,45,50,55" 1 && \
      clpplus -nw @sql-wrapper CustomIndexing_Step3_IndexRefresh.sql CustomIndexing_Step3_IndexRefresh.log <db_server>:50000/OPX openpage passw0rd "'*'" "'*'" "0,5,10,15,20,25,30,35,40,45,50,55" 1
    5. Verify that Db2 Text Search is running.
      db2 "select count(*) from <openpages_database_user>.propertyvals_clob 
        where contains(CLOB_VALUE, 'RPS') = 1"
      The expected result is:
      1
      -----------
                0
      
        1 record(s) selected.
  15. Revalidate objects and rebind packages in the OpenPages database.
    Do these steps as the OpenPages database user. In the following examples, the database user is openpage.
    1. Copy the /OP_<version>_Main/OP_<version>_Configuration/Database/DB2/INSTALL_SCRIPTS directory to the database server.
    2. Go to the directory where you copied the INSTALL_SCRIPTS directory, and then revalidate the database objects.
      Run the following commands:
      db2 connect to OPX user openpage using password
      db2 -td@ -f pks_OP_CURRENCY_MGR.sql
      db2 -td@ -f pkb_OP_CURRENCY_MGR.sql
      clpplus -nw openpage/password@<db_server>:50000/opx @sql-wrapper revalidate.sql revalidate.log openpage
    3. Rebind the packages.
      For example:
      db2rbind opx -l opbind.log all -u db2inst1 -p password -r any
  16. Revalidate objects and rebind packages in the Cognos database.
    Do these steps as the instance owner for the Cognos database.
    1. Revalidate the database objects.
      For example:
      db2 connect to cognosdb user db2inst2 using password
      db2 "call sysproc.admin_revalidate_db_objects()"
    2. Rebind packages in the Cognos database.
      For example:
      db2rbind cognosdb -l cogbind.log -u db2inst2 -p password
  17. Optional: Back up the databases.
    • For the OpenPages database, run the following commands as the instance owner for the OpenPages database:
      mkdir db2v12bu
      cd db2v12bu
      db2 backup database opx to .
    • For the Cognos database, run the following commands as the instance owner for the Cognos database:
      mkdir db2v12bu
      cd db2v12bu
      db2 backup database cognosdb to .
  18. Apply the IBM Db2 license.
    1. Get a license for IBM Db2.
    2. Run the db2licm command.
      For example:
      db2licm -a <license_file>

      Where <license_file> is the full path and file name of the IBM Db2 license.

    3. Verify the license by running the db2licm -l command.
  19. Start all IBM OpenPages services.