Procedure to install ZOracleDA and Python on a Cobalt RaQ3

Environment: Cobalt RaQ3, apache 1.3.6 with mod_so, Zope, Oracle8
Installation includes: ZOracleDA and Python 1.5.2

  1. First, in order to get ZOracleDA to work with Zope on a Cobalt RaQ3, we need to compile a new version of python that includes the DCOracle code. Retrieve the following packages and we'll get started:
  2. compile python:
    cd /usr/local/src/
    tar xzvf <location of the tar.gz file>
    cd Python-1.5.2
    ./configure
    make
    
  3. Make the config directory and save the appropriate files:
    mkdir /usr/lib/python1.5/config
    cp Makefile /usr/lib/python1.5/config
    cp Modules/Setup /usr/lib/python1.5/config
    cp Modules/config.c* /usr/lib/python1.5/config
    cp Modules/makesetup /usr/lib/python1.5/config
    cp config.h Include
    
  4. Next we'll get ready to compile DCOracle:
    cd /usr/local/src
    tar xzvf 
    cd DCOracle-1.3.1b1/src
    cp Setup-8.1.5 Setup
    cp Makefile.pre.in-1.5 Makefile.pre.in
    make -f Makefile.pre.in boot
    export ORACLE_HOME=
    
  5. Edit your Setup file to reflect the correct library names and include locations for python. For instance:
    *shared*
    
    ORACLE_INCLUDES=$(ORACLE_HOME)/rdbms/demo -I$(ORACLE_HOME)/network/public \
    	-I$(ORACLE_HOME)/plsql/public -I/usr/local/src/Python-1.5.2/Include
    
    ORACLE_L=-lclntsh
    
    ORACLE_LIBS=$(ORACLE_HOME)/lib/ $(ORACLE_L)
    
    oci_ oci_.c -I$(ORACLE_INCLUDES) -L$(ORACLE_LIBS) -DDCORACLE8
    
    Buffer -I/usr/local/src/Python-1.5.2/Include Buffer.c
    
  6. Set the appropriate environment variables and make
    export ORACLE_SID=oracle
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=$PATH:$ORACLE_HOME/bin
    make
    
  7. Verify that make created the Buffer.so and oci_.so files:
    file *.so
    
    which should return:
    Buffer.so: ELF 32-bit LSB shared object, Intel 80386, version 1, not stripped
    oci_.so:   ELF 32-bit LSB shared object, Intel 80386, version 1, not stripped
    
  8. Test the module by:
    python DCOracle_test.py scott/tiger@oracle
    
    which should return:
    Import succeeded
    Connect succeeded
    
    if it was able to connect properly.
  9. Next we need to add ZOracleDA to your Zope installation. Go to where you installed Zope, and untar the ZOracle tgz file, e.g.
    cd /usr/local/zope/Zope-2.2.1b1-linux2-x86/
    tar xzvf /tmp/ZOracleDA-2.2.0b1-src.tgz
    
    which installs the ZOracleDA files under lib/python/Products/ZOracleDA
  10. Go to that directory (lib/python/Products/ZOracleDA) and copy the .so files you created:
    cd lib/python/Products/ZOracleDA/DCOracle
    cp /usr/local/src/DCOracle-1.3.1b1/src/*.so .
    
  11. go back to your Zope home directory, and modify the start script to set the appropriate variables for ORACLE, i.e. the ORACLE_HOME, ORACLE_SID and LD_LIBRARY_PATH variables.
  12. restart Zope either through the administrative interface or by running the stop, and then the start scripts.
  13. ZOracle Connection should be functional now.