- download instant_client basic lite and instant client sdk from oracle
- unzip both into same dir (e.g. /home/jedi/instant_client)
- export ORACLE_HOME=/home/jedi/instant_client
- export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
- cd $ORACLE_HOME
- ln -s libclntsh.so.11.1 libclntsh.so (replace with your version number)
- sudo apt-get install python-dev python-setuptools libaio-dev
- sudo -E easy_install cx_Oracle
This should do it. You can test it with:
$> python
>>> import cx_Oracle
>>> conn = cx_Oracle.connect("username/password@//example.host.com/orasid")
>>> crsr = conn.cursor()
>>> crsr.execute("select * from mytable")
>>> for row in crsr: print repr(row) # hit enter twice
...
>>> crsr.close()
>>> conn.close()
>>> quit()
Credits where credit's due: Catherine's howto for XE
No comments:
Post a Comment