Error on DBI::dbConnect - can't find driver

Hi,

I am trying to connect to an Oracle database with the odbc and DBI packages on Mac. I recently started to get the following error (might related to updating OS to Catelina or updating the xcode on my machine) when trying to connect:

DBI::dbConnect(odbc::odbc(), dsn = "my_dsn",
               UID = "my_uid",
               PWD = "my_password")

Error: nanodbc/nanodbc.cpp:950: 01000: [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libsqora.dylib.18.1' : file not found 

Since this file do exist on this folder I assume that the error-related to a path setting. Here is the current setting:

> odbcinst -j
unixODBC 2.3.7
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
USER DATA SOURCES..: /Users/ramikrispin/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

Here is how the odbcinst.ini file is set

[Oracle 18 ODBC driver]
Description     = Oracle ODBC driver for Oracle 18
Driver          = /usr/local/lib/libsqora.dylib.18.1

Which can be seen also with odbc::odbcListDrivers()

odbc::odbcListDrivers()
                   name   attribute                              value
1 Oracle 18 ODBC driver Description   Oracle ODBC driver for Oracle 18
2 Oracle 18 ODBC driver      Driver /usr/local/lib/libsqora.dylib.18.1

odbc::odbcListDataSources()
           name           description
1 OracleODBC-18 Oracle 18 ODBC driver

Here is how the Oracle paths are set on the .zshrc file:

# Oracle DB
export ORACLE_HOME=$HOME/Library/Caches/Homebrew/instantclient_18_1
export PATH=$PATH:$ORACLE_HOME
export TNS_ADMIN=$ORACLE_HOME/network/admin

I was trying to follow the steps on this topic to set the path correctly, and it did not work. Here is what I am getting when running otool -l libsqora.dylib.18.1 :

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: error: 'libsqora.dylib.18.1': No such file or directory

Any suggestions?

Thanks,
Rami

Issue solve... the new Mac OS (Catalina) is more aggressive in the security setting. Once trying to run some application that is not downloaded from App store or other known source it will automatically block it. Therefore, you need to go to System Preferences -> Security & Privacy -> General tab and then run the command. Once executing the command you will see option on the tab to allow it to run.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.