如何在Ubuntu上安装Snowflake的ODBC驱动程序?

时间:2019-09-06 03:39:46

标签: linux odbc ubuntu-18.04 snowflake-data-warehouse

我正在尝试在运行Ubuntu的AWS EC2实例上安装Snowflake的ODBC驱动程序,但操作时遇到麻烦。

计算机的配置为Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-1045-aws x86_64)

我正在按照他们的文档中的说明进行操作-https://docs.snowflake.net/manuals/user-guide/odbc-linux.html,我所采取的步骤如下

先决条件-我正在使用unixODBC,并且已经确认已安装它。

which odbcinst返回/usr/bin/odbcinst,而which isql返回/usr/bin/isql

第1步-我跳过了验证软件包签名的步骤,因为它是可选的,但我有理由确定这不是无法成功安装的原因

第2步-我首先通过在sudo wget https://sfc-repo.snowflakecomputing.com/odbc/linux/latest/index.html的主目录中运行/home/ubuntuhttps://sfc-repo.snowflakecomputing.com/odbc/linux/latest/index.html下载正确的驱动程序来尝试DEB安装程序

此后,我按照说明运行了sudo dpkg -i snowflake-odbc-2.19.13.x86_64.deb。这将失败,并显示以下错误/控制台日志。

(Reading database ... 198004 files and directories currently installed.)
Preparing to unpack snowflake-odbc-2.19.13.x86_64.deb ...
SnowflakeDSIIDriver has been deleted (if it existed at all) because its usage count became zero
odbcinst: DSN removed (if it existed at all). ODBC_SYSTEM_DSN was used as the search path.
Unpacking snowflake-odbc (2.19.13) over (2.19.13) ...
Setting up snowflake-odbc (2.19.13) ...
[WARN] SF_ACCOUNT is not set, please manually update the odbc.ini file after installation
Adding driver info to odbcinst.ini...
odbcinst: Driver installed. Usage count increased to 1.
    Target directory is /etc
Adding connect info to odbc.ini...
odbcinst: Sections and Entries from stdin have been added to ODBC.INI
Adding Simba Snowflake ini...
/var/lib/dpkg/info/snowflake-odbc.postinst: line 46: /usr/lib/snowflake/odbc/lib/simba.snowflake.ini: No such file or directory
grep: /usr/lib/snowflake/odbc/lib/simba.snowflake.ini: No such file or directory
/var/lib/dpkg/info/snowflake-odbc.postinst: line 70: /usr/lib/snowflake/odbc/lib/simba.snowflake.ini: No such file or directory
dpkg: error processing package snowflake-odbc (--install):
 installed snowflake-odbc package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 snowflake-odbc

下一步,我想我会尝试TGZ方法。首先,我清理了添加了Snowflake详细信息的/etc/odbcinst.ini/etc/odbc.ini文件,并将其恢复为原始版本。

第2步(尝试2)-我现在再次使用sudo wget https://sfc-repo.snowflakecomputing.com/odbc/linux/latest/snowflake_linux_x8664_odbc-2.19.13.tgz在我的/home/ubuntu主目录中下载了TGZ文件,并选择将其安装在同一目录中,因为我需要我的用户能够写入日志目录。

运行gunzip snowflake_linux_x8664_odbc-2.19.13.tgztar -xvf snowflake_linux_x8664_odbc-2.19.13.tar之后,我解压缩了现在位于/home/ubuntu/snowflake_odbc下的文件夹。

第3步-继续进行环境配置步骤。我选择unixODBC方法并按照说明执行sudo ./unixodbc_setup.sh。似乎使用以下控制台日志成功安装了

Prerequisites:
- install unixODBC
    - RedHat:  sudo yum install unixODBC
        - this package contains isql which can connect to Snowflake DB.
- adjust parameters in this file if needed
- make sure you are running this file from its local directory
- run this script as './unixodbc_setup.sh'

unset ODBCINI and ODBCINSTINI
Adding driver info to /etc/odbcinst.ini...
Adding connect info to /etc/odbc.ini...
- Setup sucessfully!
- Steps to do after running this script
  1. Replace SF_ACCOUNT with the account name in /etc/odbc.ini
  2. (optional) Specify username and password in /etc/odbc.ini
  3. Make sure current users have write permission to the log
     directory.

第4步-继续配置ODBC驱动程序的步骤,我检查文档中概述的3个步骤是否正确完成

步骤4.1-simba.snowflake.ini文件中的内容看起来不正确。指定驱动程序管理器的最后一部分如下所示。

#   unixODBC
ODBCInstLib=/usr/lib64/libodbcinst.so
CABundleFile=/home/ubuntu/snowflake_odbc/lib/cacert.pem

我不认为有/usr/lib64/libodbcinst.so,所以我继续确认它不存在。不幸的是,我认为我对Linux的了解(或缺乏知识)到此为止,并且我不知道该如何更改。

步骤4.2和4.3非常简单,我更改了/etc/odbc.ini中的必要详细信息以反映正确的服务器名称和帐户

我可以肯定这没有正确设置,但是我还是尝试下一步。

第5步-使用isql -v snowflake my_username my_password测试ODBC驱动程序显然会因以下控制台日志而出错

[S1000][unixODBC][Snowflake][ODBC] (11560) Unable to locate SQLGetPrivateProfileString function.
[ISQL]ERROR: Could not SQLConnect

您能指导我如何进行吗?如果我没有指定调试所需的任何详细信息,请告诉我我还能添加什么。

非常感谢!

0 个答案:

没有答案