简体   繁体   English

在64位Linux机器上以32位运行Python脚本以使用32位客户端连接到Oracle DB

[英]Running a Python Script in 32 Bit on 64 linux machine to connect to oracle DB with 32 bit client

I am trying to set up a cronjob that executes a python (3.6) script every day at a given time that connects to an oracle 12g database with a 32 bit client (utilizing the cx_Oracle and sqlalchemy libs). 我试图设置一个cronjob,该cronjob在给定的时间每天执行python(3.6)脚本,该脚本使用32位客户端连接到oracle 12g数据库(利用cx_Oracle和sqlalchemy库)。 The code itself was developed on a win64 bit machine. 代码本身是在win64位计算机上开发的。

However, when trying to deploy the script onto an Ubuntu 16.04 server, I run into a dilemma when it comes to 32 vs 64 bit architectures. 但是,当尝试将脚本部署到Ubuntu 16.04服务器上时,当遇到32位和64位体系结构时,我遇到了一个难题。

  • The server is based on a 64 bit architecture 该服务器基于64位架构
  • The oracle db is accessible via a 32 bit client 可通过32位客户端访问oracle db
  • my current python version on ubuntu is based on 64 bit and I spent about an hour of how to get a 32 bit version running on a 64 bit linux machine without much success. 我当前在ubuntu上使用的python版本是基于64位的,我花了大约一个小时的时间来了解如何在64位linux机器上运行32位版本,但没有取得太大的成功。

The error I receive at this moment when trying to run the python script refers to the absence of an oracle client (DPI-1047). 我此时尝试运行python脚本时收到的错误是指缺少oracle客户端(DPI-1047)。 However, I already encountered a similar problem in windows when it was necessary to switch the python version to the 32 bit version and to install a 32 bit oracle client. 但是,当需要将python版本切换到32位版本并安装32位oracle客户端时,我已经在Windows中遇到了类似的问题。

Is this also necessary in the ubuntu case or are there similar measurements needed to be taken? 在ubuntu案中这是否也是必要的,还是需要进行类似的测量? and if so, how do I get ubuntu to install and run python3.6 in 32 bit as well as the oracle client in 32 bit? 如果是这样,我如何让ubuntu在32位以及32位的oracle客户端上安装和运行python3.6?

I am a bit confused about your question but this should give some clarification: 对于您的问题,我有点困惑,但这应该给您一些澄清:

  • A 32-bit client can connect to a 64-bit Oracle database server - and vice versa 32位客户端可以连接到64位Oracle数据库服务器-反之亦然
  • You can install and run 32-bit applications on a 64-bit machine - this is at least valid for Windows, I don't know how it works on Linux. 您可以在64位计算机上安装和运行32位应用程序-这至少对Windows有效,我不知道它在Linux上如何工作。
  • Your application (the python in your case) must have the same "bitness" as installed Oracle Client. 您的应用程序(在您的情况下为python) 必须具有与已安装的Oracle Client相同的“位数”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM