On Wednesday 10 January 2007 16:51, Andy Todd wrote: > Sean Davis wrote: > > On Wednesday 10 January 2007 02:31, Andy Todd wrote: > >> Sean Davis wrote: > >>> I am new to the list, so if I am in the wrong place, feel free to > >>> direct me elsewhere. > >>> > >>> I am trying to connect to an Oracle installation on a remote machine. > >>> I have installed the oracle instant client on my machine (linux x84_64) > >>> and can connect via Oracle's sqlplus client to the remote machine. > >>> > >>> So, my question is what are the working options for connecting from > >>> python when I do not have an entire installation in place but only > >>> instantclient? > >>> > >>> Thanks, > >>> Sean > >>> _______________________________________________ > >>> DB-SIG maillist - [email protected] > >>> http://mail.python.org/mailman/listinfo/db-sig > >> > >> Sean, > >> > >> If you can connect using SQL*Plus then you can connect with a Python > >> DB-API 2.0 module such as cx_Oracle [1] because they use the same > >> connection mechanism. Just use the same connection string. > >> > >> e.g. if you use > >> > >> $ sqlplus scott/[EMAIL PROTECTED] > >> > >> at the command line then in Python you can just do something like; > >> > >> >>> import cx_Oracle > >> >>> remote_db = cx_Oracle.connect('scott/[EMAIL PROTECTED]') > >> > >> I'd have a look at the documentation of whichever module you choose to > >> find out how to get the best out of it though. > >> > >> [1] http://www.python.net/crew/atuining/cx_Oracle/ > > > > Thanks, Andy. This is indeed the route I have gone and it works like a > > charm. Just an aside, I learned that one must install the SDK from > > oracle, a requirement above-and-beyond the standard SQL*Plus, which will > > work fine without the SDK. A minor point, but it was cause for a bit of > > confusion for me. > > > > Sean > > _______________________________________________ > > DB-SIG maillist - [email protected] > > http://mail.python.org/mailman/listinfo/db-sig > > Sean, > > Is there a documented source for the information about installing the > SDK? And which components does it contain? > > As far as I'm aware, although I haven't tested this myself yet so I > stand ready to be corrected, you should only need the instant client and > a Python/Oracle DB-API 2.0 module to connect to a database.
The information that I know is available at the following link (for the linux version that I downloaded). I appears to me that in order to build the python/oracle module, one probably needs the SDK to link to, but I could be incorrect. I do know that before I installed the SDK, I was unable to build cx_Oracle. After, it worked fine. http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxx86_64soft.html Sean _______________________________________________ DB-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/db-sig
