Wednesday, October 22, 2008

Multiple installations of DB2 9 with SAP on Linux and UNIX

Introduction to multiple DB2 copies on one system

Advantages of coexistence of multiple DB2 9 copies

With DB2 9, customers can install the DB2 software several times on the host machine and assign a SAP DB2 instance to different DB2 installations. Each installed DB2 software instance is fully functional on its own. In addition, every fix pak is provided as a full install image, so that you have the option to install it on top of a previous image or separately as a new image.

With this enhancement, customers can have different SAP applications running on different DB2 levels on the same host. For example, you can deploy and test an SAP application with a new fix pack and later roll over the production system to the new installation. It also provides an easy way to move back to previous fix levels. Every instance can be updated individually. You do not need to apply a fix pack to the earlier version and apply it to all the instances, although the old fashioned way is still supported.

For example, a customer has instances I1, I2, and I3. He installs the original version of DB2 9 and updates all instances accordingly. He then installs DB2 9 Fix Pack 1; he may choose to install it on top of the original version already installed or on a different path. He then updates instance I1 and I2 by pointing to the new path. Later, he installs DB2 9 Fix Pack 2 on a new path. At this point, he is also able to update all instances including I3 to Fix Pack 2 by pointing to the new path.

You can have both Version 8 and Version 9 installed on the same physical box as well as multiple fix pack levels of Version 9.

Changes from previous versions of DB2

There are a number of changes with this new feature:

  • DB2 products cannot be queried with operating system utilities such as paged, rpm, smit, or sisal. Instead, a new command db2ls is used to keep track of DB2 software installed on the machine. It provides information about the location of DB2 products installed, including the version and the time it was installed.

    Example:
    %/opt/ibm/db2/V9.1_01/install/db2ls
    Install Path Level FixPack Special Install Number Install Date
    -----------------------------------------------------------------------------------------
    |--10--------20--------30--------40--------50--------60--------70--------80--------9|
    |-------- XML error: The previous line is longer than the max of 90 characters ---------|
    /opt/ibm/db2/V9.1_01 9.1.0.0 0 Tue Jul 11 14:28:33 2006 EDT
    |--10--------20--------30--------40--------50--------60--------70--------80--------9|
    |-------- XML error: The previous line is longer than the max of 90 characters ---------|
    /opt/ibm/db2/V9.1_02 9.1.0.1 1 Thu Sep 7 16:52:14 2006 EDT
    |--10--------20--------30--------40--------50--------60--------70--------80--------9|
    |-------- XML error: The previous line is longer than the max of 90 characters ---------

  • Users cannot uninstall DB2 software using native operating system utilities such as ramp or smit. To uninstall a DB2 product, run the db2_deinstall command, which is located under the install directory.

    Example:
                          
    %/opt/ibm/db2/V9.1_01/install/db2_deinstall -a

    The command above removes the DB2 product from the /opt/ibm/db2/V9.1_01 directory.
  • Each DB2 system can have as many DB2 instances as required. However, the instance name must be unique across the system. The command db2ilist only lists the instances created under the same installation path where the command is running. Similarly, db2ilist db2icrt and db2idrop commands create or drop instances associated with the DB2 path that the command is running from.
  • DB2 9 fix pack images are full installation images. You can use an image to run a fresh database installation, or apply a fix pack on top of an existing installation. The installation procedures described below applies to the original version of DB2 9 image as well as fix pack images. The only exception is that if the user uses the fix pack image to run a new installation, a try-and-buy license is installed. The user then needs to run db2licm a filename to add the license manually.




Installation

Before starting the installation, you should make sure that your operating system fulfills all prerequisites for the installation of DB2 9. For the most current list, see the System Requirements page.

If you require more detailed information on how to install DB2 software, refer to IBM documentation on the IBM Web site.

Notes:
  • If you are running a DB2 partitioned database system on multiple physical nodes, you must install the database software on each database host in identical paths. For example, if instance1 is installed on server1 in the directory /opt/V9install, then it should also be in the directory /opt/V9install on server2, server3, and so on.
  • If the SAP central instance or dialog instance is not running on the database server, you will need to install the DB2 Client software on the central or dialog instance machine. The procedure is the same, but you should make sure that you select only DB2 Client as the product to be installed. It is considered best practice to keep the central and dialog instances on the same DB2 level.

Installation path

If you do not provide a specific path during the installation, DB2 will be installed on the default path as follows (the directory will be created):

  • /opt/IBM/db2/V9.1 for AIX, HP-UX, Solaris operating systems
  • /opt/ibm/db2/V9.1 for Linux operating system

If the default installation path is already in use, the path has _xx added to it, where _xx are digits, starting at 01 and increasing depending on how many DB2 copies you have installed.

For example, the first copy of DB2 is installed on /opt/IBM/db2/V9.1, the second copy is installed on /opt/IBM/db2/V9.1_01.

Alternatively, you can choose a path during DB2 installation, and DB2 will be installed to any valid path you provide. There are some restrictions about the installation path:

  • The path has to be absolutely empty. If the path doesn't exist, DB2 installer creates it during installation. If the path already exists, you need to make sure that it doesn't contain any files or subdirectories.
  • The path name cannot contain any space. For example, /opt/IBM/db2/db2 v9 is not allowed.
  • The maximum length of the installation path supported is 108 bytes on AIX and 105 bytes on HPPA. For all the other platforms, the name of the installation path cannot be more than 128 characters. If the path is a link, the real path it links to should also follow this length limit.

Install DB2 using the DB2 Setup wizard

To install DB2 using DB2 Setup, follow these instructions:

  1. Log on as a user with root authority and make sure the DISPLAY variable is set correctly.

  2. Mount the database DVD and issue the command.

                          
    % //ESE/disk1/db2setup.

    The following welcome page is displayed.



    Figure 1. Welcome screen
    Welcome screen

  3. Click Installation Prerequisites, and review your setting to confirm all requirements are met.

  4. Choose Install a Product from the left panel, and click Install New under DB2 Enterprise Server Edition.

    If you are installing the client only, choose Install New under the DB2 Client menu.



    Figure 2. Launchpad screen
    Launchpad screen

  5. Follow the installation wizard by clicking Next and accepting the license agreement.

  6. It is recommended to choose Typical for the installation type, unless there are specific actions the user needs to perform. More details about each installation type are displayed on the same screen.



    Figure 3. Installation type
    Installation type

  7. You can choose to save your action in a response file for future use or just run the installation or both on the following screen.



    Figure 4. Installation options
    Installation options

  8. At this point, you will be asked for the installation directory. Enter your preferred installation directory, or leave it to the default.



    Figure 5. Installation directory screen
    Installation directory screen

  9. On the following screen, choose Do not create a DB2 instance.



    Figure 6. DB2 instance screen
    DB2 instance screen

  10. The following screen displays a summary page, review the contents and click Finish to start the DB2 installation.



    Figure 7. Summary screen
    Summary screen

  11. During the installation, a task bar is displayed showing the progress of the installation.



    Figure 8. Installation progress screen
    Installation progress screen

  12. Once the setup has completed, choose Finish to exit the installation panel. You may also review the log file for more details on the installation steps.



    Figure 9. Setup complete
    Setup complete

Install DB2 using the db2_install script

The db2_install script installs all components for the DB2 product you specify with the English interface support. It does not perform user and group creation, instance creation, or configuration. To start an installation using db2_install, follow these steps:
  1. Log on as a user with root authority.

  2. Insert and mount the appropriate DVD or access the file system where the installation image was stored.

  3. Change directory to /ese/disk1.

  4. Run the following command:

                              
    %./db2_install -b DB2DIR -p productName


    Where DB2DIR is the path where you want to install the DB2 product and productName is the name of the product you would like to install. You may choose ESE for the full Enterprise Server Edition or choose the client or runtime client edition.
  5. You may choose not to provide any parameters with the db2_install command, in which case you are prompted for the product name and the installation path. You can run the command db2_install -h for detailed usage information. The installation log file is found in the /tmp directory, if you do not specify the log path using the -l option.



    Example 1
                          
    /db2install/V9/ese/disk1 #./db2_install
    Default directory for installation of products - /opt/ibm/db2/V9.1
    ***********************************************************
    Do you want to choose a different directory to install [yes/no]
    yes
    Enter full path name for the install directory -
    ------------------------------------------------
    /opt/ibm/db2/V9.1_01
    Specify one or more of the following keywords,
    separated by spaces, to install DB2 products.
    CLIENT
    RTCL
    ESE
    Enter "help" to redisplay product names.
    Enter "quit" to exit.
    ***********************************************************
    ESE
    DB2 installation is being initialized.

    Total number of tasks to be performed: 39
    Total estimated time for all tasks to be performed: 853

Install DB2 using a response file

A response file is a text file that contains setup and configuration values. The file is read by the DB2 setup program and the installation is performed according to the values that have been specified. You can create the response file using the db2setup wizard or modifying the sample response file. The following is an example of a response file. A new keyword FILE is used to specify the installation directory.


Example 2
              
**************
PROD=ENTERPRISE_SERVER_EDITION
FILE=/opt/ibm/db2/v9.1_01
LIC_AGREEMENT=ACCEPT
INSTALL_TYPE=TYPICAL
LANG=EN
CONFIG_ONLY=NO
********************

Once the response file is ready, you can run the db2setup command with the -u option, as follows:

  1. Log on as a user with root authority.

  2. Change directory to //ese/disk1.

  3. Run the following command:

                              

    % ./db2setup -u /ese.rsp -l /install.log

    You will see the following output:

                              
    DBI1191I db2setup is installing and configuring DB2 according to
    the response file provided. Please wait.
    The execution completed successfully.
    For more information see the DB2 installation log at
    "/install.log".

Apply fix packs

To apply a fix pack on an existing DB2 installation, you should run InstallFixPak -b command and provide the base installation path. Note that the installFixPak command can only update one DB2 copy at a time.

To apply a fix pack, use the following steps:

  1. Log on as a user with root authority.

  2. Make sure that all DB2 instances associated with the DB2 copy are stopped. Otherwise, the installFixPak command will fail. The commands db2ilist and db2stop can be used to verify that.

  3. Change the directory to //ese/disk.

  4. Run the command:

                              
    %./installFixPack -b

  5. Update the instances by running the command db2iupdt for all the instances under the installation directory.

  6. As instance owner (db2), bind packages as described in the SAP documentation.

    Example 3
                              

    /db2install/V9/ese/disk1#./installFixPack -b /opt/ibm/db2/V9.1_01
    DBI1017I installFixPack is updating the DB2 product(s) installed
    in location /opt/ibm/db2/V9.1_01.

    /db2install/V9/ese/disk1# cd /opt/ibm/db2/V9.1_01/instance

    /opt/ibm/db2/V9.1/instance # ./db2ilist
    db2lp1

    /opt/ibm/db2/V9.1/instance #./db2iupdt db2lp1
    DBI1070I Program db2iupdt completed successfully.






SAP installation with DB2 9

1. Get the latest installation DVDs

Before installing any SAP application, make sure that you have the latest SAP installation DVDs that support DB2 9 installation.

  • If you are installing on basis SAP NetWeaver 7.0, use the installation package for Service Release 1 (SR1) or later.
  • For older releases, you can use the "6.20/6.40 Installation Master (Edition Sept. 2006)" DVD. There is also a backport for R3SETUP to support V8 or V9 installations. You can find more information from SAP OSS Note 969660 and Note 928727 .

2. Install SAP applications

Follow the installation document for your SAP release to start the SAP installation. During the installation, you will have the option to specify the path where you have installed the DB2 software image. You can use the new Browse button to search for the path.


Figure 10. Browse option
Browse option

In the above example, the SAP installer creates the database instance with the DB2 image installed at /opt/ibm/db2/v9.1.






Update a SAP database instance

With support for multiple DB2 software installations, you can choose one of the following two ways to update their SAP database instance:

  1. Applying a fix pack to the existing DB2 software, and updating all instances under the installation path.

  2. Installing DB2 to a new location, and moving the DB2 instance from the old install path to the new install path. The DB2 level at the new location can be of different fix pack levels or the same level.

1. Update the instance by applying fix packs to the current installation path

This is the traditional way to update database instances, and the procedure for this is the same as DB2 V8:

  1. As adm, stop all SAP processes by running the stopsap command.

  2. As instance owner, run the following to stop all DB2 processes.

    1. db2 force applications all

    2. db2 terminate

    3. db2stop

    4. db2licd end

  3. Repeat steps 1 and 2 for all DB2 instances.

  4. Log on as a user with root authority, and install the fix pack choosing the methods described in the Installation section.

  5. Update all instances using the db2iupdt command.

  6. As the DB2 instance owner, perform the post instance update steps as described in the SAP documentation.

2. Update the instance by moving the instance to a different DB2 copy

You can move a DB2 instance associated with one DB2 copy to another by running the db2iupdt command. This provides a fast way to update an instance to a different fix pack level without affecting other instances. The target DB2 copy can be of the same fix pack level or different level of the original DB2 copy.

The following is the procedures to move a DB2 9 instance between different DB2 software copies.

  1. Login as user adm, stop your SAP system and the DB2 instance. Make sure there is no process running for this instance.

  2. As a user with root authority, run the db2iupdt command from the directory where you want to move your instance to. The db2iupdt command is located under /instance.

    Example 4
                              
    # db2ls
    Install Path Level Fix Pack Special Install Number Install Date
    --------------------------------------------------------------------------------
    /opt/ibm/db2/V9.1_01 9.1.0.0 0 Tue Jul 11 14:28:33 2006 EDT
    /opt/ibm/db2/V9.1_02 9.1.0.1 1 on Sep 25 21:26:42 2006 EDT
    --This shows that there are two copies installed on the system.

    # /opt/ibm/db2/V9.1_01/instance/db2ilist
    db2lp1
    db2lp2
    --Two instances are associated with DB2 under path /opt/ibm/db2/V9.1_01.

    # /opt/ibm/db2/V9.1_02/instance/db2iupdt db2lp1
    DBI1070I Program db2iupdt completed successfully.
    --This command updates instance db2lp1 from install path /opt/ibm/db2/V9.1_01
    to /opt/ibm/db2/V9.1_02.

    # /opt/ibm/db2/V9.1_01/instance/db2ilist
    db2lp2

    # /opt/ibm/db2/V9.1_02/instance/db2ilist
    db2lp1
    --db2ilist now shows instance db2lp1 is now switched to the DB2 copy at path
    /opt/ibm/db2/V9.1_02.

  3. It is recommended to update the application server instance to be at the same level as the database server instance if your application server is on a different host.

  4. As instance owner (db2), bind packages as described in the SAP documentation.

  5. Login as adm, and start your SAP application.

Notes:

  • If the target DB2 copy is at a lower level than the original DB2 copy, run the db2iupdt code with the -D option.
  • The db2iupdt command only applies to DB2 instances of the same version. If you want to migrate a DB2 Version 8 instance to a DB2 9 instance, follow the instructions in the "SAP DB2 Migration Guide." This guide is available in an attachment to OSS Note 930487 as well as on the DB2 9 DVD.





Uninstall

After dropping or moving all the instances to different DB2 copies, you can issue the db2_deinstall command to uninstall DB2. It is not allowed to uninstall DB2 when you still have instances defined with this copy.

The db2_deinstall command is located under DB2DIR/install, and it uninstalls DB2 products that are in the same installation path as the db2_deinstall tool.


Example 5
              

%/opt/ibm/db2_v91/install # ./db2_deinstall -a
DBI1016I Program db2_deinstall is performing uninstallation.
Please wait.
The execution completed successfully.
For more information see the DB2 installation log
"/tmp/db2_deinstall.log.24556".






Appendix: Important SAP OSS notes

Please check the following OSS notes for the latest updates on installation:

  • 969660 -- 6.20/6.40 Patch Collection Installation : Unix
  • 928727 -- DB6: SAP System Inst. with EXT Kernel on UNIX
  • 930487 -- DB6: Using DB2 9 with SAP Software
  • 8999322 -- DB6: DB2 9 Standard Parameter Settings
  • 101809 -- DB6: Supported Fix Packs for DB2 UDB for UNIX and Windows




Conclusion

In this article, you have learned how to install multiple copies of a version of DB2 on a single machine, a new capability in DB2 9. In addition, you've seen how to update the SAP database instance, and how to uninstall, should that become necessary.


This article taken from http://www.ibm.com/developerworks/db2/library/techarticle/dm-0704nesiem/index.html

No comments: