This article mainly explains how to install the ibm_db method of the python module of db2 offline, which has some reference value. If you are interested, refer to centos6.5-64-bit for linux, suse 11-64 bit success
1. Why offline installation?
No network, working in a bank, configuring the server environment, and completely offline (I had to spend a day doing what I did in five minutes. My server !!)
2. required attachments and operation steps
1. Download ibm_db module and https://pypi.python.org/pypi/ibm_db.
2. Download two db2 driver modules. One can find the download link in setup. py of the ibm_db module and download the specified driver according to the system version. Example https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz
Depends on the situation.
3. A download db2 client package, the official site to download http://www-01.ibm.com/support/docview.wss? Rs = 4020 & uid = swg000085217 the English language is better, you can see at a glance, the first full driver file. Download it. The driver is ibm_data_server_driver_package_linuxx64_v11.1.tar.gz. The directory after decompression is dsdriver. Then execute the executable file installDSDriver,
./installDSDriver
Soon the installation will be successful, and some files will be generated in the directory, such as db2profile, and then add the following content to/etc/profile to remember source.
./Installation directory/dsdriver/db2profile
Sometimes in the production environment, you cannot use the root permission to call ibm_db. Therefore, you need to re-execute the preceding installation command in the user's home directory to modify it. /bashrc or. bash_profile file (the system is different, it only takes effect for the current user), add
./Installation directory/dsdriver/db2profile
Source/etc/profile or. bashrc or. bash_profile
3. Install the ibm_db Module
1. decompress the ibm_db module. Assume that ibm_db2 is in the decompressed directory.
2. decompress the db2 driver module and copy it to the ibm_db2 directory.
3. Go to the ibm_db2 directory and run python setup. py install to install the tool. If a gcc error is prompted, run the yum or apt-get gcc and other Linux system library files.
4. Go to the python compiler and import: the import ibm_db command does not return an error. It is successful. If the import fails, the db2 client driver is incorrect.
* ***** Online installation is too easy for tm. You can directly install pip ibm_db *******
The above is a detailed description of the ibm_db method of the python module for offline installation of db2. For more information, see other related articles in the first PHP community!