Hello,
I have an issue with my python code, where after a few days the ibm_db client can no longer connect to the database. Interestingly, this error disappears once I restart the Informix Dynamic Server and then reoccurs after a few days (restart Friday evening, error on Monday morning).
My setup is a one month old install of Ubuntu 18.04 with anaconda 3.7 64bit. I installed ibm_db via pip into a virtual environment and I'm connecting to an IDS 11.70 instance over LAN. I believe I set everything up correctly, as the connection works properly on a fresh restart. Anyways, this is my current code:
import ibm_db
import ibm_db_dbi
import pandas as pd
# ----------------- Connection String
driver = 'IBM DB2 ODBC DRIVER'
database = 'bop'
hostname = '-------------'
port = '49502'
protocol = 'tcpip'
uid = '-----------------'
pwd = '--------------'
authentication = 'server'
conn_str = f"DRIVER={{{driver}}};DATABASE={database};HOSTNAME={hostname};PORT={port};" + \
f"PROTOCOL={protocol};UID={uid};PWD={pwd};authentication={authentication}"
ibm_db_conn = ibm_db.connect(conn_str,'','')
conn = ibm_db_dbi.Connection(ibm_db_conn)
print(f'Connected to {conn.dbms_name} running on version {conn.dbms_ver}.')
Running this results in the error:
Exception Traceback (most recent call last)
<ipython-input-4-6c8c8c33c46f> in <module>
----> 1 ibm_db_conn = ibm_db.connect(conn_str,'','')
2 conn = ibm_db_dbi.Connection(ibm_db_conn)
3
4 print(f'Connected to {conn.dbms_name} running on version {conn.dbms_ver}.')
Exception: [IBM][CLI Driver] SQL30061N The database alias or database name "BOP " was not found at the remote node. SQLSTATE=08004 SQLCODE=-30061
I tried my best on finding the cause for this but I'm kind of a the end of my knowledge here. Also I'm a fairly new user of IDS and unfortunately there is no other employee around who knows anything about this DBMS.
Thanks for any help and best regards
Julian