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 ability to run applications that require different Db2 versions on the same host at the same time.
- The ability to run independent copies of Db2 products for different functions.
- The ability to test on the same computer before moving the production database to a later version of the Db2 product.
- For independent software vendors, the ability to embed a Db2 server product into your product and hide the Db2 database from your users.
A Db2 copy is a group of Db2 products that are installed at the same location.
Differences when only one Db2 copy is installed
- During installation, a unique default Db2 copy name is generated. You can change the name of the default Db2 copy as you go through the Db2 Setup wizard. You cannot change the Db2 copy name after the installation is completed.
- Applications use the default Db2 copy in an environment similar to the Db2 version 11.1 environment.
Differences when multiple Db2 copies are installed on the same computer
copies can coexist with copies of Db2
version 10.1 or
earlier releases with the following restrictions.
- You must define a default copy. After Db2 version 11.1 is installed, you can use the Global Switcher to set the version 11.1 copy as the default copy.
- Only the IBM® Data Server Provider for .NET from the default IBM database client interface copy is registered in the Global Assembly Cache.
- Each Db2
copy must have unique instance names. For a silent installation with the
NO_CONFIG flag set to YES, the default instance is not
created. However, when you create the instance after the installation, it must be unique. The
default name of the instance is
DB2®. If an instance of the
DB2name exists, a unique name for the instance is generated. The unique name is generated by using the
DB2name and adding an underscore and generating the last two characters in numeric sequence. The subsequent instance names generated are
DB2_02, and so on.
- For Microsoft COM+ applications, use and distribute the IBM Data Server Driver Package (installer) or IBM Data Server Driver for ODBC and CLI (compressed file) with your application instead of the IBM Data Server Runtime Client. Only one Data Server Runtime Client can be used for COM+ applications at a time. The IBM Data Server Driver Package (installer) or IBM Data Server Driver for ODBC and CLI (compressed file) does not have this restriction. Microsoft COM+ applications accessing Db2 data sources are only supported with the default Db2 copy. Concurrent support of COM+ applications accessing different copies is not supported. You can change the default copy with the Default Db2 Copy Selection Wizard.
Choosing a default when installing a new 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.
No, then DB2COPY1 remains the default copy and the default IBM database client interface copy as shown in the following figure:
Yeswhen 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:
Applications that run as a service
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 can be registered for only one Db2 copy at a time and they can monitor only the instances in the copy in which they are registered. When you switch the default 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.
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.
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.
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
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.