个人工具

UbuntuHelp:DCOracle2

来自Ubuntu中文

跳转至: 导航, 搜索

DCOracle2 is an Oracle database connector for Python and Zope. This page describes how to install it. This procedure has been tested on Dapper 6.06 LTS.

Prerequisites

1. DCOracle2 requires libclntsh.so to be present in your LD_LIBRARY_PATH. This is part of an Oracle database install and may be present in a client-only install such as the Oracle Instant Client. 2. Some things from the Ubuntu repositories:

sudo apt-get install build-essential python-dev zope2.9

(zope2.9 is required because DCOracle2 uses some zope libraries) 3. In order for Python to be able to find the Zope libraries we need to modify the python path. To do this create (or edit) the file /usr/local/lib/python2.4/site-packages/sitecustomize.py to have these contents:

import sys
sys.path.append( '/usr/lib/zope2.9/lib/python2.4/site-packages' )

Procedure

1. Obtain DCOracle2 from http://www.zope.org/Members/matt/dco2 . 2. Read the README on how to build it (usually just typing make in the (uncompressed) folder. 3. After compiling DCOracle2 move the directory to /usr/local/lib:

sudo mv DCOracle2 /usr/local/lib

4. Make DCOracle2 available for python import:

sudo ln -s /usr/local/lib/DCOracle2/DCOracle2 /usr/local/lib/python2.4/site-packages/DCOracle2

To get DCOracle working (as ZOracleDA) in Zope2.9

1. Create a symbolic link in the Zope2.9 Packages directory:

sudo ln -s /usr/local/lib/DCOracle2 /usr/lib/zope2.9/lib/python2.4/site-packages/Products/ZOracleDA

2. Edit the environment section in the zope.conf file for each zope instance (usually in the /var/lib/zope2.9/<instance>/etc directory) to ensure that ORACLE_HOME is set. For example:

<environment>
  ORACLE_HOME /opt/oracle/product/9.2.0.4.0
</environment>