Monday, April 28, 2014

Installing DB2 fixpack

Install DB2 Fix packs – Below steps are intended for Linux, Unix operating systems.


1) Perform the necessary tasks before installing a fix pack.
2) Choose a fix pack installation method and install the fix pack.
3) Perform the necessary tasks after installing the fix pack.
4) Apply the appropriate DB2 database product license.

1) Perform the necessary tasks before installing a fix pack

a) If you already have DB2 database product installed, the space required to install the fix pack is slightly greater than the space consumed by the existing DB2 database products. This space is only required temporarily during the fix pack installation process.

To determine the space used by the existing DB2 database products, perform the command:

du -h -s DB2DIR

where DB2DIR represents the location where the DB2 copy is installed.

b) Download the fix pack

c) Uncompress the fixpacks, use the below command

gunzip -c filename.tar.gz | tar -xvf - 

d) Before installing a fix pack, if there are DB2 database products installed in the selected installation path, you must stop all of the DB2 processes. If you have multiple DB2 copies, stop only the DB2 processes that are associated with the copy that you are updating.
Determine which instances are associated with the DB2 copy.

Issue the command: DB2DIR/instance/db2ilist

where DB2DIR represents the location where the DB2 copy is installed.

su - iname
db2 force application all
db2 terminate
db2stop
exit

If the DB2 Administration Server (DAS) belongs to the DB2 copy that you are updating, stop the DAS:
su - aname
db2admin stop
exit

where aname represents the DAS owner name.

e) Optional: On AIX, run slibclean to unload unused shared libraries from memory before installation:

/usr/sbin/slibclean

f) Disable the fault monitor processes. To stop the Fault Monitor Daemon, issue the command:

DB2DIR/bin/db2fm -i iname -D

where DB2DIR is the location where the DB2 copy is installed and iname represents the instance owner name. The command must be performed once for each instance in the DB2 copy.

g) Ensure all DB2 interprocess communications are cleaned for the instance to be updated. As the instance owner, run the following command at each physical partition:

$HOME/sqllib/bin/ipclean

2) Choose a fix pack installation method and install the fix pack.

There are 2 ways that you use the fixpack and installation methods that match the purpose.

1) Follow these instructions to install new DB2 database products at a particular fix pack level. The db2setup command is used to perform the installation.

Change to the directory that contains the fix pack image.

Launch the installation by issuing the command: ./db2setup

2) Follow these instructions if a DB2 database product is already installed and you want to apply a new fix pack level. The installFixPack command is used to install the fix pack.

You have two choices when it comes to fix pack installation; using a universal fix pack (all products) or a product-specific fix pack.

Why would I use the universal fix pack?
If I want to upgrade multiple products in place.
If I do not remember what I have installed to be able to install the fix pack in a new location without losing my current set of features or products.

Why would I use the product-specific fix pack?
If I have a single product and want to save the time to download the fix pack.
If system downtime is costly.
If I need to test the new fix pack without impacting my production databases.
If I need the ability to go back to the previous version quickly (system downtime in case of failure).
If I already have a fix pack installed and need to add new features or products to the fix pack.
Note: Many of these advantages can be achieved by installing from your original media to a new location and using the universal fix pack to upgrade features or products, however, there is a cost of extra installation time.

Launch the installation by issuing the installFixPack command. For example,

./installFixPack -b DB2DIR

where DB2DIR is the location of the DB2 database products that you want to update.

Note: I had seen below error in Linux environment.

Stopping DB2 Fault Monitor :.......Success
ERROR: The installFixPack command detected some DB2 libraries are still loaded
in memory and some applications might still be running in the current
installation copy.  All applications must be stopped. See the fix pack readme
for pre-installation instructions, and re-run the installFixPack command.
Alternatively, to override automatic checking, you can re-issue the
installFixPack command with the '-f db2lib' parameter. Note: If you re-issue
the installFixPack command with the '-f db2lib' parameter, after the DB2
instances are updated, some applications might not work properly and might need
to be restarted to function properly against the updated DB2 instance.

Preparing the system :.......Failure
Change to the directory that contains the fix pack image.

If you get error as above use the below command, and complete the install.

./installFixPack -b DB2DIR –f db2lib

3) Perform the necessary tasks after installing the fix pack.

a) For each instance, issue the command:

DB2DIR/instance/db2iupdt iname

where iname represents the instance name and DB2DIR represents the location where the DB2 copy is installed.

b) If the DB2 Administration Server (DAS) belongs to the DB2 copy where you installed the fix pack, issue the command:

DB2DIR/instance/dasupdt

where DB2DIR is the location where the DB2 copy is installed. If this DB2 copy is now running at a more recent fix pack level than all of the other DB2 copies, consider updating the DAS to belong to this DB2 copy.

c) Update the system catalog objects in your databases to support the fix pack.

db2updv97 -d dbname
where dbname represents the name of the database.

Note: Backup your database before running db2updv97. Some system objects might become unusable after moving back to an earlier fix pack, and your database will need to be restored.

d) Restart the instance , DAS admin

su - iname
db2start

su - dasuser
db2admin start

e) As part of a fix pack installation on the server, binding of the database utilities (IMPORT, EXPORT, REORG, the Command Line Processor) and the CLI bind files occurs automatically. However, if you install a fix pack on the client or an error occurs, you can manually bind the database utilities and the CLI bind files.

If you installed the fix pack on DB2 database products that have existing databases, perform the following commands once for each database:

db2 terminate
db2 CONNECT TO dbname user USERID using PASSWORD
db2 BIND path\db2schema.bnd BLOCKING ALL GRANT PUBLIC SQLERROR CONTINUE 
db2 BIND path\@db2ubind.lst BLOCKING ALL GRANT PUBLIC ACTION ADD 
db2 BIND path\@db2cli.lst BLOCKING ALL GRANT PUBLIC ACTION ADD 
db2 terminate

If you installed the fix pack on DB2 database products that have existing databases, rebind the packages by running the REBIND or db2rbind command.

db2rbind dbname -l  fullpath/logfile all 
fullpath refers to a valid path given with a name to log the rebind output

4) Apply the appropriate DB2 database product license.

INSTHOME/sqllib/adm/db2licm -a filename

Where INSTHOME represents the home directory of the instance owner and filename is the full path name and file name for the license file
Check the license information once after applying the license.

db2licm -l

All the commands used in the post are highlighted as Italic

No comments:

Post a Comment