Most of us know or call IBM Data Server Driver Configuration file as db2dsdriver.cfg. It contains database directory information and client configuration keywords and is based on the db2dsdriver.xsd schema definition file. IBM data server driver configuration file can be used with embedded SQL applications, ODBC, CLI, .NET, OLE DB, PHP, or Ruby drivers.
Details on the location of file can be found at
Coming back to the topic,
DB2 V9.7 introduced a new environment variable named DB2DSDRIVER_CFG_PATH which can be used to specify an alternate path for IBM Data Server Driver Configuration file. In DB2 V10.1, DB2DSDRIVER_CFG_PATH started supporting multiple paths and in DB2 V10.5, support for custom file name got added.
What this means is,
- IBM Data Server Driver Configuration file can have any name rather than default db2dsdriver.cfg. Of course, one needs to specify that name in DB2DSDRIVER_CFG_PATH.
- One can have multiple versions of IBM Data Server Driver Configuration file at same or different locations and use whichever is needed via DB2DSDRIVER_CFG_PATH.
- This takes off the limitation of a single location and provides some kind of high availability as multiple file paths can be specified via DB2DSDRIVER_CFG_PATH.
Let us consider an example,
On Windows platforms:
Assuming user has set DB2DSDRIVER_CFG_PATH as shown above, and first available file is located at c:\program files\sqllib\b.config, then “db2cli validate” will get displayed similar to below:
Let us also talk about the high availability of IBM Data Server Driver Configuration file via DB2DSDRIVER_CFG_PATH.
Considering that an organization has multiple workstations with a DB2 copy installed on each machine. These DB2 copies are required to work with an IBM Data Server Driver Configuration file kept at a centralized location and it's path is specified using DB2DSDRIVER_CFG_PATH. Now think about a situation when this file location is not reachable due to some downtime. What happens when someone runs an application with DB2 datasource pointed within that IBM Data Server Driver Configuration file. How about keeping a local copy of the file which gets replicated at some interval from the centralized location and adding it's path in DB2DSDRIVER_CFG_PATH ?