DB2 10.5 for Linux, UNIX, and Windows

Multiple DB2 copies on the same computer (Windows)

You can use multiple DB2® copies on the same computer. Each DB2 copy can be at the same or different code levels.

The benefits of this configuration include:

A DB2 copy is a group of DB2 products that are installed at the same location.

Differences when only one DB2 copy is installed

Differences when multiple DB2 copies are installed on the same computer

Choosing a default when installing a new DB2 copy

The following figure illustrates a scenario where you have installed multiple DB2 copies: DB2COPY1, DB2COPY2, and on to DB2COPYn. One of the DB2 copies is selected by you as the default DB2 copy. In this case, DB2COPY1 is selected as the default DB2 copy.

Your system environment includes several DB2 copies where DB2COPY1 is the default DB2 copy.

Now imagine a scenario where you install one DB2 copy and you call it DB2COPY1. DB2COPY1 is the default DB2 copy and the default IBM database client interface copy.

Then you install a DB2 product in a new DB2 copy called DB2COPY2. During the installation of DB2COPY2, you are asked if you want to make the new DB2 copy the default DB2 copy. If you respond "No", then DB2COPY1 remains the default DB2 copy and the default IBM database client interface copy as shown in the following figure:

As you are installing a new DB2 copy, you decide not to make the new DB2 copy the default DB2 copy.

However, consider the same scenario but you respond "Yes" when asked if you want to make the new DB2 copy the default DB2 copy. In this case, DB2COPY2 becomes the new default DB2 copy and the default IBM database client interface copy as shown in the following figure:

As you are installing a new DB2 copy, you decide to make the new DB2 copy the default DB2 copy.

Applications that run as a service

Applications that dynamically bind DB2 DLL files, for example applications that are linked with db2api.lib, find the DB2 DLL files in the PATH. This means that existing applications that were not developed for multipleDB2 versions use the default DB2 copy. To work around this behavior, the application can use the db2SelectDB2Copy API before loading any DB2 libraries.
Note: When linking with db2api.lib, the functions resolve to different DLL files on Windows 32-bit and Windows 64-bit platforms. The runtime DLL files on a 64-bit platform have the same base name as the 32-bit version with the addition of the "64" suffix. For example, db2app.dll on a Windows 32-bit operating system is equivalent to db2app64.dll on a Windows 64-bit operating system.
For more information, see the Call Level Interface Guide and Reference Volume 1.

32-bit and 64-bit versions on Windows x64

DB2 does not support multiple DB2 32-bit and 64-bit versions installed on Windows, because the DB2 32 and 64-bit registries are stored in different locations. If you install the DB2 64-bit version, the 32-bit version is removed from the system.

LDAP and CLI configuration

With DB2 Version 8, if an application needs different LDAP settings, it must authenticate with a different LDAP user. Otherwise, the CLI configuration affects all DB2 copies that the LDAP user might potentially use.

Performance counters

Performance counters can be registered for only one DB2 copy at a time and they can monitor only the instances in the DB2 copy in which they are registered. When you switch the default DB2 copy, the DB2 Selection Wizard de-registers and reregisters the performance counters so that they are active for the default DB2 copy.

Windows Management Instrumentation (WMI)

Only one version of the WMI provider can be registered at any given time.

Client Connectivity

You can use only one DB2 copy in the same process. For more information, see IBM data server client connectivity using multiple copies.

Applications that dynamically link DB2 DLL files

Applications that link to DB2 DLL files directly or that use LoadLibrary instead of LoadLibraryEx with the LOAD_WITH_ALTERED_SEARCH_PATH flag must ensure that the initial dependent library is loaded properly. You can use your own coding technique to check that the library loads, or you can call the db2envar.bat file to set up the environment before running the application, or you can call the db2SelectDB2Copy API, which can be statically linked into the application.

Visual Studio plug-ins

If the default DB2 copy is a copy of Version 10.1 or earlier release, there can be only one version of the plug-ins registered on the same computer at the same time. The version of the plug-ins that is active is the version that is installed with the default DB2 copy.

Licensing

Licenses must be registered for each DB2 copy. They are not system-wide. Copy dependent licensing provides the ability for both restricted versions of DB2 products and full versions of DB2 products on the same host.

Windows services

DB2 services onWindows platforms use the <servicename_installationname> naming convention. For example, DB2NETSECSERVER_MYCOPY1. The display name also contains the Copy Name appended to it in brackets, for example, DB2 Security Server (MYCOPY1). Instances also include the DB2-<DB2 Copy Name>-<Instance Name>-<Node Number> in the display name, which is shown in the services control panel applet. The actual service name remains as is.

API to select the DB2 copy to use

You can use the db2SelectDB2Copy API to select the DB2 copy that you want your application to use. This API does not require any DLL files. It is statically linked into your application. You can delay the loading of DB2 libraries and call this API first before calling any other DB2 APIs.
Note: The db2SelectDB2Copy API cannot be called more than once for any given process; that is, you cannot switch a process from one DB2 copy to another.

The db2SelectDB2Copy API sets the environment required by your application to use the DB2 copy name or the location specified. If your environment is already set up for the copy of DB2 that you want to use, then you do not need to call this API. If, however, you need to use a different DB2 copy, you must call this API before loading any DB2 DLL files within your process. This call can be made only once per process.

Database Partitioning with multiple physical nodes

Each physical partition must use the same DB2 copy name on all computers.

Using MSCS with Multiple DB2 Resources

Each DB2 resource must be configured to run in a separate resource monitor.