[Zope] ZOracleDA

Marcin Kasperski Marcin.Kasperski@softax.com.pl
Thu, 27 Jul 2000 10:08:13 +0200


Aaron Bostick wrote:
> 
> Zope list members,
> 
> I have been developing a zope site with oracle on linux as a backend.
> Currently, I run both zope and oracle on the same machine using the
> ZOracleDA for connectivity.  However, for production, I plan to seperate the
> tiers and run zope and and oracle on different servers.  From looking at the
> build instructions for the DCOracle, it seems as though it will only work
> when the web server and database server are on the same filesystem/in the
> same memory space.
> 
> Is there a way to have my zope server talk to a remote (across the network
> somewhere) database server?  Do I have to move to something like ODBC for
> this?

You do not need ODBC. SQL*Net sufficies.

I have not done it with Zope but used it succesfully with Perl/DBI and
C++ programs.

It is enough to copy libclntsh.so and define tnsnames.ora file (and of
course your language - in this case Python/Zope - modules for Oracle) to
client machine and run TNS listner on server machine.

Sample configuration below.

* On the server (where database runs)

You should have /opt/oracle/8.0.5/network/admin/listener.ora with sth.
like (ORA is my SID, gauss is the server TCP name).

LISTENER =
  (ADDRESS_LIST =
	(ADDRESS= (PROTOCOL= IPC)(KEY= ORA))
        (ADDRESS= (PROTOCOL= IPC)(KEY= PNPKEY))
        (ADDRESS= (PROTOCOL= TCP)(Host= gauss)(Port= 1521))
  )
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME= /opt/oracle/8.0.5)
      (SID_NAME = ORA)
    )
  )
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = OFF

Start tns listener with 

lsnrctl start

(from oracle account)

* On the client (where application runs)

Define /etc/tnsnames.ora with sth. like (you can place multiple entries
if you like)

GAUSS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL= TCP)(Host= gauss)(Port= 1521))
    (CONNECT_DATA = (SID = ORA))
  )

(sid and host must match settings on server)

Define TNS_ADMIN to point to directory the file above lies

export TNS_ADMIN=/etc

Define TWO_TASK to tnsnames.ora variable

export TWO_TASK=GAUSS

You can run your application. You can also copy tools like sqlplus and
run them.

--
Marcin.Kasperski | Working overtime sucks the spirit and motivation out 
  @softax.com.pl | of a team. Projects that require overtime to be      
Marcin.Kasperski | finished on time will be late no matter what you do. 
    @bigfoot.com | (Wells)