I am facing an error while connecting to database using unixODBC on IBM AIX 64bit
DB2 client V9.7 is installed on the machine.
Found on net that it can be due to library file:' libdb2o.so ' missing and in that case update to DB2 V9.7 Fix Pack3.
Updated DB2 client to DB2 V9.7 Fix Pack 4 but still no success.
On trying to connect to database using: isql -v it gives following error:
[01000][unixODBC][Driver Manager]Can't open lib '/opt/IBM/db2/V9.7_01/lib64/db2o.o' : file not found
[ISQL]ERROR: Could not SQLConnect
Details of .odbc.ini :
[db2_odbc_source]
Description = IBM DB2 ODBC data source
Driver = db2_odbc_driver
Trace = Yes
DMEnvAttr = SQL_ATTR_UNIXODBC_ENVATTR={DB2_CLI_DRIVER_INSTALL_PATH=/home/UserName}
Details of .odbcinst.ini :
[db2_odbc_driver]
Description = IBM DB2 ODBC driver
Driver = /opt/IBM/db2/V9.7_01/lib64/db2o.o
FileUsage = 1
DontDlClose = 1
Environment variables DBINSTANCE and ODBCINI are set.
Your help will be greatly appreciated.
Thanks.
libdb2o.o is used for connectivity via unixodbc for db2 database on 64 bit OS except nt64.on nt64,we use probably db2clio.o
Related
I have a dedicated Synapse SQL pool, within which I want to Connect to a database. I want to connect to the database using Python running on a pySpark Notebook inside the same Synapse Instance.
I am using the Microsoft documentation here to go about this and my code is the following:
import pyodbc
cnxn = pyodbc.connect('Driver={ODBC Driver 17 for SQL Server};Server=tcp:SYNAPSENAME.sql.azuresynapse.net,1433;Database=DBNAME;Uid=XXXX-XXXXX-XXXXX-XXXX;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;Authentication=ActiveDirectoryIntegrated')
cursor = cnxn.cursor()
#Sample select query
cursor.execute("SELECT ##version;")
row = cursor.fetchone()
while row:
print(row[0])
row = cursor.fetchone()
I obtained The connection string from the Dedicated SQL pool page in Azure Under Connection Strings/ODBC/ODBC (Includes Node.js) (Azure Active Directory integrated authentication)
However, when I run it I'm getting the following error:
OperationalError: ('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')
Traceback (most recent call last):
I have Tried running the same code with an earlier version of the Driver (13), but get the following error:
Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL
Server' : file not found (0) (SQLDriverConnect)")
Traceback (most recent call last): pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL Server' : file not found (0) (SQLDriverConnect)")
I believe this at least indicates the driver for v17 is properly installed. I have also changed the UID to be my username jjesus#XXXX.XXX but get the same error code as the first one.
I'm wondering what could be the issue?
Do I need Password Auth? Surely Synapse should handle all the authentication alread?
Is this Connection not possible for SQL pools?
Any help would be great,
Joao
Please check your ODBC driver version.
If your version of the ODBC driver is 17.1 or later, you can use the
Azure Active Directory interactive mode of the ODBC driver through
pyODBC.
If the version is fine, try to use the Password in the given connection string:
Driver={SQL Server Native Client 11.0};Server=tcp:{your_server}.sql.azuresynapse.net,1433;Database={your_database};Uid={your_user_name};Pwd={your_password_here};Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;
Refer below helpful links:
ODBC connection string example
Microsoft ODBC Driver for SQL Server on Windows
I need to connect my db2 database to node-red. when i try to install node red contrib db2 for i, I get error that the platform is not compatible with windows. do I need to install aix? I could install node red contrib db2 fixed on my node-red on win7-x64. may i connect db2 with this node?
Thank you
The node-red-contrib-db2-for-i is specifically for working with DB2 on iSeries systems.
If you want to connect to a "normal" DB2 database then you can use either:
node-red-contrib-db2
node-red-contrib-db2-fixed
After successfully installing IBM DB2 Express V10.5_01 on an Ubuntu 14.04 LTS machine I tried to follow the next step and start
db2fs
in an X-Windows session. I am asked to create a profile for firefox and a browser window comes up with an error message dialog showing
exception TypeError: netscape.security.PrivilegeManager is undefined
When pressing ok for a few times the "create sample database" button disappears and instead a warning appears:
First Steps was unable to connect to the online DB2 Information Center and could not find an instance of a locally installed DB2 Information Center for this version of the product. To access product information, one of the following types of connections to a DB2 Information Center is required:
Internet access to the online DB2 Information Center
A locally installed version of the DB2 Information Center
Access to a remotely configured DB2 Information Center
As a workaround I tried to use
db2sampl
after adding my user to the groups dasadm1 db2iadm1 and db2fadm1 that had been created by the installation procedure.
db2sampl -force
Creating database "SAMPLE"...
Existing "SAMPLE" database found...
Dropping and recreating database "SAMPLE"...
Attempt to drop existing database "SAMPLE" failed.
Attempt to create the database "SAMPLE" failed.
SQL1013N The database alias name or database name "SAMPLE " could not be
found. SQLSTATE=42705
db2 list db directory
shows:
Database alias = SAMPLE
Database name = SAMPLE
Local database directory = <path>/db2inst1
Database release level = 10.00
Comment =
Directory entry type = Indirect
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =
unfortunately
db2cc
is not available anymore as an admin tool in V10.5 see DB2 Express V10.1 and db2cc binary and before downloading
IBM Data Studio I'd first like to check the basic integrity of my installation.
db2help
e.g. gives the errormessage
/bin/sh: 0: Illegal option -p
In all I have the feeling that Ubuntu 14.04 LTS is not a properyly supported platform for IBM DB2 Express V10.5_01.
How feasible is it to get IBM DB2 Express V10.5_01 running in this environment?
I am trying to connect to oracle database using os authentication through jdbc.
I have oracle 10g installed on solaris sparc 32 bit.
Following is the code for jdbc connection :-
String url = "jdbc:oracle:thin:#oracleserver.mydomain.com:5521:dbja"
Driver driver = new oracle.jdbc.OracleDriver();
DriverManager.registerDriver(driver);
Properties props = new Properties();
props.setProperty(OracleConnection.CONNECTION_PROPERTY_THIN_VSESSION_OSUSER,"oracle");
Connection conn = DriverManager.getConnection( url, props);
when i run the above code using thin driver, it gives error as "invalid username/password ; logon denied'
using oci driver error is :: "no ocijdbc11 in java.library.path" but i am using oracle 10g and in LD_LIBRARAY_PATH libocijdbc10.so is present. but still looking for libocijdbc11.so.
Please help me to resolve the issue.
Thanks
For using os authentication, please check the oracle documentation
How is the os_authent_prefix?
Does the user oracle exist?
Is REMOTE_OS_AUTHENT = TRUE?
For OCI access, the relevant thing here is the JDBC driver, which must match the oracle client version. To achieve this, add the 10g jdbc driver from your oracle client installation to the class path.
I am using Perl 5.14.2 on Ubuntu wheezy 64 bit.
I am trying to connect to a Pervasive SQL server v9.5 that is installed on a windows 2008 machine.
I tested the connection with isql and it works properly, I tested with the following command:
isql -v <db_name>
I use the DBD:ODBC v1.39 (latest version) perl module installed from cpan.
I am using the following command to connect to sql server:
use DBI;
my $db = DBI->connect('dbi:ODBC:Moked');
Moked is the connection name that was defined in the unixodbc v2.2.14 in odbc.ini.
/etc/odbc.ini
[Moked]
Driver=PERVASIVE_ODBC
Description=Pervasive ODBC Interface: Moked
ServerName=<ip>:<port>
DBQ=MIDA
UID=
PWD=
OpenMode=0
PvTranslate=
when I try to connect with the command i showed above I get error SQL-HY001 that by googling I understood that it relates to memory allocation, usually people get these while querying and not while trying to connect/
it seems that DBI does recognize the connection because if I type a different name, for example 'Moked2', i get the error SQL-IM002 instead.
any ideas?
how can I debug this issue further?
any information regarding the issue would be greatly appreciated.
thanks!
You are getting the memory allocation error because the PSQL v11 client cannot reliably connect to a PSQL v9.5 server. If you want to use the v11 client, you need the v11 server too. You might be able to get away with the v11 client at a Btrieve level but there were significant changes between v9 and v11 on the ODBC side.