Saturday, September 5, 2015

DB2 INSTALLATION AND UNINSTALLATION WITH RESPONSE FILES

DB2 INSTALLATION AND UNINSTALLATION WITH RESPONSE FILES

Environment:

OS: Redhat 6.6
DB2 : V10.1 

Response file:

Response files contain values that are used to answer questions during the installation process that you would normally answer.

Response files can install,add functionality, uninstall DB2 products.

You can use response file created only for the version it is created not with other versions.

On Linux or UNIX platforms, a response file created for a root installation might not be usable for a non-root installation.

You can use a response file to install an identical configuration across every workstation on your network or to install multiple configurations of a DB2 database product. You can then distribute this file to every workstation where you want this product to be installed.

How to create a response file:

Three ways:

1. Using db2setup wizard.
2. Using sample response files provided in db2/<platform>/samples from where you extracted the db2 installation files. Example: If DB2 is extracted in /root/ then go to server/db2/linuxadm64/samples here you will find lots of response files.
3. Manually creating a response files by using response file keywords provided in the information center.

A response file is an English-only text file that contains setup and configuration information.

A response file installation can also be referred to as a silent installation or an unattended installation.

You can use a response file to uninstall one or more DB2® database products, features, or languages. A response file uninstall can also be referred to as a silent uninstall or an unattended uninstall.

On Linux and UNIX operating systems, you can also use a response file to uninstall the DB2 Information Center.

A sample uninstall response file, db2un.rsp, is provided.

When the DB2 database product was installed, as part of the installation the sample uninstall response file is copied to DB2DIR/install.

If multiple DB2 database products exist within the same DB2 copy, a response file uninstallation of one DB2 database product does not affect the components shared by other DB2 database products in that copy.

NOTE:

If a DB2 feature is installed by multiple products in the same DB2 copy, a response file uninstallation of the feature removes the feature from all of the products in the DB2 copy.

Checking after uninstalling:

After a response file uninstall, check the log file. This file captures all DB2 uninstallation information, including errors.

On Linux and UNIX operating systems, the log file is located in /tmp/db2_deinstall-nnnnn.log where nnnnn are generated numbers. The log file name displays on the screen after running the db2_deinstall command. You can also verify the product, feature, or language was removed using the db2ls command.

On Windows operating systems, the log file is located in My Documents\DB2LOG\db2un-TimeStamp.log. You can verify the product, feature, or language was removed by opening the Add/Remove Programs dialog in the control panel.

Considerations before uninstalling:

Remove HADR or any other cluster before issuing uninstall using response file.

You have to check the log files after install or uninstall using response file to ensure its successful.

STEPS:

1. Copy the sample file to your  home directory or any other place

[root@redhat_1 samples]# pwd
/root/server/db2/linuxamd64/samples
[root@redhat_1 samples]# ls -lrt
total 324
-r--r--r--. 1 bin bin 54606 Dec  5  2012 db2ese.rsp
-r--r--r--. 1 bin bin 43383 Dec  5  2012 db2consv.rsp
-r--r--r--. 1 bin bin 27816 Dec  5  2012 db2client.rsp
-r--r--r--. 1 bin bin 54497 Dec  5  2012 db2wse.rsp
-r--r--r--. 1 bin bin 54897 Dec  5  2012 db2aese.rsp
-r--r--r--. 1 bin bin  9391 Dec  5  2012 db2un.rsp
-r--r--r--. 1 bin bin 43699 Dec  5  2012 db2exp.rsp
-r--r--r--. 1 bin bin 26371 Dec  5  2012 db2rtcl.rsp
[root@redhat_1 samples]# cp db2aese.rsp ~/db2aese.rsp 

I have saved it as custom_db2_install.rsp in my root home directory since i'm using root login.



2. Edit the file db2aese.rsp and add the below lines to it:

**PRODUCT TO INSTALL
PROD = ADVANCED_ENTERPRISE_SERVER_EDITION

**Base installation path
FILE = /opt/ibm/db2/V10.1

**LICENSE_AGREEMENT
LIC_AGREEMENT = ACCEPT

**PROGRESS BAR
INTERACTIVE = YES

**INSTALL TYPE
INSTALL_TYPE = TYPICAL


3. Save the file and exit.
4. Run the below command to verify content of response file.

./db2setup -l /tmp/custom_db2_install.out -r /root/custom_db2_install.rsp -c

The db2setup is available in /root/server/ directory, where I extracted my DB2 binaries.

[root@redhat_1 server]# ls -lrt
total 64
-r-xr-xr-x.  1 bin bin 5154 Dec  5  2012 db2prereqcheck
-r-xr-xr-x.  1 bin bin 5154 Dec  5  2012 db2setup
-r-xr-xr-x.  1 bin bin 5172 Dec  5  2012 db2_install
-r-xr-xr-x.  1 bin bin 5136 Dec  5  2012 db2ls
-r-xr-xr-x.  1 bin bin 5302 Dec  5  2012 db2_deinstall
-r-xr-xr-x.  1 bin bin 5190 Dec  5  2012 installFixPack
-r-xr-xr-x.  1 bin bin 5349 Dec  5  2012 db2ckupgrade
drwxr-xr-x. 28 bin bin 4096 Dec  5  2012 doc
drwxr-xr-x.  6 bin bin 4096 Dec  5  2012 db2
[root@redhat_1 server]#



5. After the verification completes successfully run the below command to install:

./db2setup -l /tmp/custom_db2_install.out -r /root/custom_db2_install.rsp

where,

-l = is the location of the installation log file, default will be under /tmp/db2*.log
-r = is the response file it should be given with the full path.

Response file key words explained:

**PRODUCT TO INSTALL
PROD = ADVANCED_ENTERPRISE_SERVER_EDITION

PROD is to choose which type of DB2 product needed, I installed Advanced server edition.

**Base installation path
FILE = /opt/ibm/db2/V10.1

FILE is the installation directory I have used the default installation path.

**LICENSE_AGREEMENT
LIC_AGREEMENT = ACCEPT

LIC_AGREEMENT is the license agreement.

**PROGRESS BAR
INTERACTIVE = YES

INTERACTIVE if you need to have progress information about installation then use it, when set to YES it will display progress to the screen just like doing a manual installation using db2_install script.

If you set that to NO there will be no output to the screen except the starting message of installation.

**INSTALL TYPE
INSTALL_TYPE = TYPICAL

INSTALL_TYPE is the installation type whether its TYPICAL or COMPACT or CUSTOM installation.

To find more details about response file installation search for response file keywords in information center or google.

_________________________________________________________________________________


DB2 UNINSTALLATION USING RESPONSE FILE:


Finding the DB2 products and features installed:

You can find the DB2 products and features installed using db2ls as follows:

The db2ls command is located under the /opt/ibm/db2/V10.1/install and /root/server/ run this from any path.

Use -p option to find the products installed.

Run ./db2ls -p -q -b /opt/ibm/db2/V10.1

[root@redhat_2 server]# ./db2ls -p -q -b /opt/ibm/db2/V10.1

Install Path : /opt/ibm/db2/V10.1

Product Response File ID                  Level   Fix Pack   Product Description
---------------------------------------------------------------------------------------------------------------------
ADVANCED_ENTERPRISE_SERVER_EDITION      10.1.0.2          2   DB2 Advanced Enterprise Server Edition




To list features and hidden components installed:

[root@redhat_2 server]# ./db2ls  -q -a -b /opt/ibm/db2/V10.1

Install Path : /opt/ibm/db2/V10.1

Feature Response File ID             Level   Fix Pack   Feature Description
---------------------------------------------------------------------------------------------------------------------
BASE_CLIENT_R                      10.1.0.2          2   Base Client Support for installation with root privileges
DB2_PRODUCT_MESSAGES_EN            10.1.0.2          2   Product Messages - English
BASE_CLIENT                        10.1.0.2          2   Base client support
JAVA_RUNTIME_SUPPORT               10.1.0.2          2   Java Runtime Support
DB2_JAVA_HELP_EN                   10.1.0.2          2   Java Help (HTML) - English
BASE_DB2_ENGINE_R                  10.1.0.2          2   Base server support for installation with root privileges
GSK                                10.1.0.2          2   Global Secure ToolKit
JAVA_SUPPORT                       10.1.0.2          2   Java support
SQL_PROCEDURES                     10.1.0.2          2   SQL procedures
ICU_SUP                            10.1.0.2          2   ICU Utilities
JAVA_COMMON_FILES                  10.1.0.2          2   Java Common files
BASE_DB2_ENGINE                    10.1.0.2          2   Base server support
DB2_CONTROL_CENTER_HELP_EN         10.1.0.2          2   Control Center Help (HTML) - English
CONNECT_SUPPORT                    10.1.0.2          2   Connect support
DB2_DATA_SOURCE_SUPPORT            10.1.0.2          2   DB2 data source support
JDK                                10.1.0.2          2   IBM Software Development Kit (SDK) for Java(TM)
LDAP_EXPLOITATION                  10.1.0.2          2   DB2 LDAP support
INSTANCE_SETUP_SUPPORT             10.1.0.2          2   DB2 Instance Setup wizard
ACS                                10.1.0.2          2   Integrated Flash Copy Support
COMMUNICATION_SUPPORT_TCPIP        10.1.0.2          2   Communication support - TCP/IP
DB2_UPDATE_SERVICE                 10.1.0.2          2   DB2 Update Service
DATABASE_PARTITIONING_SUPPORT      10.1.0.2          2   Parallel Extension
EDB                                10.1.0.2          2   EnterpriseDB code
REPL_CLIENT                        10.1.0.2          2   Replication tools
DB2_SAMPLE_DATABASE                10.1.0.2          2   Sample database source
ITLM                               10.1.0.2          2   itlm
CLPPLUS                            10.1.0.2          2   Command Line Processor Plus
AESE_PRODUCT_SIGNATURE             10.1.0.2          2   Product Signature for DB2 Advanced Enterprise Server Edition
FIRST_STEPS                        10.1.0.2          2   First Steps



There response file for uninstall can also be found under /opt/ibm/db2/V10.1/install.



1. Copy the db2un.rsp file to your location

[root@redhat_1 install]# pwd
/opt/ibm/db2/V10.1/install
[root@redhat_1 install]# ls -lrt
total 192
-r-xr-xr-x 1 bin  bin   9391 Dec  4  2012 db2un.rsp
-r-xr-xr-x 1 bin  bin  10688 Dec  4  2012 db2ls
-r-xr--r-- 1 bin  bin  16003 Dec  4  2012 db2_deinstall_exec
-r-xr--r-- 1 bin  bin  37857 Dec  4  2012 db2_deinstall
-r-xr-xr-x 1 bin  bin  20061 Dec  4  2012 db2chgpath
drwxr-xr-x 2 bin  bin   4096 Dec  4  2012 tsamp
-r-xr-xr-x 1 bin  bin  86009 Aug 18 04:43 db2ls_exec
drwxr-xr-x 2 root root  4096 Aug 18 04:44 logs
[root@redhat_1 install]# cp db2un.rsp ~/custom_db2_uninstall.rsp

2. Edit the custom_db2_uninstall.rsp and add the below lines:

**SELECT PRODUCT TO UNINSTALL:
REMOVE_PROD = ADVANCED_ENTERPRISE_SERVER_EDITION

**REMOVE ACS
REMOVE_COMP = ACS

**Application development tools
REMOVE_COMP              = APPLICATION_DEVELOPMENT_TOOLS


**Custom data source support
REMOVE_COMP              = CUSTOM_DATA_SOURCE_SUPPORT


** DB2 data source support
REMOVE_COMP              = DB2_DATA_SOURCE_SUPPORT

** Sample database source
REMOVE_COMP              = DB2_SAMPLE_DATABASE                 

** DB2 Update Service
REMOVE_COMP              = DB2_UPDATE_SERVICE                  

** First Steps
REMOVE_COMP              = FIRST_STEPS

** JDBC data source support
REMOVE_COMP              = JDBC_DATA_SOURCE_SUPPORT            

** IBM Software Development Kit (SDK) for Java(TM)
REMOVE_COMP              = JDK                                 

REMOVE_COMP              = LDAP_EXPLOITATION                   ** DB2 LDAP support
REMOVE_COMP              = ODBC_DATA_SOURCE_SUPPORT            ** ODBC data source support
REMOVE_COMP              = REPL_CLIENT                         ** Replication tools
REMOVE_TSAMP             = YES





Refer to the information center for uninstall response file keywords.

3. Run the uninstallation by using db2_deinstall command from the DB2 extract path:

For example:

I extracted DB2 at /root so I changed to the path /root/server/ and then issued the below command.

./db2_deinstall -r /root/custom_db2_uninstall.rsp -l /tmp/custom_db2_uninstall.out -b /opt/ibm/db2/V10.1



4. Check the log /tmp/custom_db2_uninstall.out for uninstallation details.


That's the end, Happy learning.

_________________________________________________________________________________