Upgrading Db2 (Linux)
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
-
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.
db2
connect or db2rbind, do not use quotation marks around passwords.Procedure
-
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.
-
Mount the IBM
Db2 installation media or extract the
downloaded installation package onto your file system.
- Log in as the instance owner.
- Create a directory. Do not create it under /sqllib.
- Extract the Db2 installation package to the directory that you created.
- Check that your system meets the installation prerequisites. For more information, see db2prereqcheck - Check installation prerequisites.
- Go to the directory where you extracted the Db2 installation package.
- As the root or
sudouser, 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.0If successful, you see the messageDBT3533I The db2prereqcheck utility has confirmed that all installation prerequisites were met. - Review the log file.
- As the OpenPages instance owner
(for example, db2inst1), run the pre-upgrade checks:
./db2ckupgrade OPX -l /tmp/db2ckupgrade.log -u db2inst1 -p password
-
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.ASCII1function, you can ignore them. -
Check the value of the application heap size for the Cognos database.
-
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 -
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
-
Run the following command as the database instance owner. Replace
<cognosdb> with the name of your Cognos database.
-
Drop the Db2 Text Search index and disable Db2 Text Search.
For more information, see Dropping the search index and disabling Db2 Text Search.
- Back up the OpenPages database and the Cognos database.
- Run the Db2 installation program to
upgrade IBM
Db2 For more information, see Upgrading a Db2 server (Linux® and UNIX).
- Log on to the database server as the root user. Go to the directory that you created
in step 2. Run the
db2setupcommand../db2setup - Click Install a Product and New Install.
- For the Product, choose DB2 Version 12.1 Server Editions.
- Select the Custom option.
- 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.
- Expand Server Support and select Db2 Text Search for installation.
- If you do not use Tivoli® SA MP, clear the Tivoli SA MP check box.
- Accept the default settings on the remaining pages of the wizard.
- When the installation process completes, review the log files.
- Click Finish.
- Log on to the database server as the root user. Go to the directory that you created
in step 2. Run the
- 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.
- Stop all Db2 databases.
- 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. - Upgrade the OpenPages database
instance. Run the
db2iupgradecommand. For example:cd /opt/ibm/db2/V12.1/instance ./db2iupgrade -u db2fenc1 -j "TEXT_SEARCH,db2j_db2inst1,55000" db2inst1 - 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. - Verify the upgrade.
cd /opt/ibm/db2/V12.1/bin/ ./db2val - Check the installation level of the OpenPages database instance. For more information, see db2level - Show Db2 service level command.
db2levelLook for a return value that matches the version that you are installing. For example, look for a return value ofDB2 v12.1.0.0.
- Upgrade your Cognos database
instance. Perform this step as the root userFor more information, see the Db2 documentation.Note: Do this step after the OpenPages database instance upgrade completes successfully.
- Upgrade the Cognos database instance.
Run the
db2iupgradecommand. For example:cd /opt/ibm/db2/V12.1/instance ./db2iupgrade -u db2fenc1 db2inst2 - 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. - Verify the upgrade.
cd /opt/ibm/db2/V12.1/bin/ ./db2val - Check the installation level of the Cognos
database instance. For more information, see db2level - Show Db2 service level command.
db2levelLook for a return value that matches the version that you are installing. For example, look for a return value ofDB2 v12.1.0.0.
- Upgrade the Cognos database instance.
- If you are using Db2 Administration
Server (DAS), upgrade the service. For more information, see Upgrading the Db2 Administration Server (DAS).For example:
cd /opt/ibm/db2/V12.1/instance ./dasmigrThe valueDBI1070I Program dasmigr completed successfullyindicates success. - 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 -
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 -
Configure and enable Db2 Text
Search, create the index, and schedule a job to synchronize the index.
-
Start Db2 Text Search.
db2ts START FOR TEXT - 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' OPENPAGEA 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" -
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 -
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 -
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.
-
Start Db2 Text Search.
- 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.- Copy the /OP_<version>_Main/OP_<version>_Configuration/Database/DB2/INSTALL_SCRIPTS directory to the database server.
- 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 - Rebind the packages. For example:
db2rbind opx -l opbind.log all -u db2inst1 -p password -r any
- Revalidate objects and rebind packages in the Cognos database. Do these steps as the instance owner for the Cognos database.
- Revalidate the database objects. For example:
db2 connect to cognosdb user db2inst2 using password db2 "call sysproc.admin_revalidate_db_objects()" - Rebind packages in the Cognos
database. For example:
db2rbind cognosdb -l cogbind.log -u db2inst2 -p password
- Revalidate the database objects.
- 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 .
- For the OpenPages database,
run the following commands as the instance owner for the OpenPages database:
-
Apply the IBM
Db2 license.
For more information, see db2licm - License management tool command.
- Get a license for IBM Db2.
-
Run the
db2licmcommand.For example:db2licm -a <license_file>Where <license_file> is the full path and file name of the IBM Db2 license.
-
Verify the license by running the
db2licm -lcommand.
- Start all IBM OpenPages services.