Forum OpenACS Development: Using Oracle 10g with OpenACS
However, I was having a great deal of difficulty getting the connection to the database to work. I finally tracked down what the issue was.
I applied this patch to the Oracle driver to get it to work with our ACS installation:
Index: Makefile
===================================================================
RCS file: /cvsroot/aolserver/nsoracle/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- Makefile 8 Feb 2004 18:43:18 -0000 1.11
+++ Makefile 16 Feb 2005 19:54:44 -0000
@@ -47,11 +47,7 @@
ORA_VERSION=$(shell grep OCI_LOGON2 $(ORACLE_HOME)/rdbms/demo/oci.h)
NS_VERSION=$(shell grep NS_VERSION $(NSHOME)/include/ns.h)
-ifeq (,$(findstring OCI_LOGON2,$(ORA_VERSION)))
-MODLIBS = -L$(ORACLE_HOME)/lib -lclntsh -lcore8 -lcommon8 -lgeneric8 -lclient8
-else
-MODLIBS = -L$(ORACLE_HOME)/lib -lclntsh -lcore9 -lcommon9 -lgeneric9 -lclient9
-endif
+MODLIBS = -L$(ORACLE_HOME)/lib -lclntsh -lcore10 -lcommon10 -lgeneric10 -lclient10
ifneq (,$(findstring NS_VERSION,$(NS_VERSION)))
MODLIBS += -lnsdb
Index: nsoracle.c
===================================================================
RCS file: /cvsroot/aolserver/nsoracle/nsoracle.c,v
retrieving revision 1.1
diff -u -r1.1 nsoracle.c
--- nsoracle.c 8 Feb 2004 17:35:27 -0000 1.1
+++ nsoracle.c 16 Feb 2005 19:54:44 -0000
@@ -16,7 +16,7 @@
#include "version.h"
static char *ora_driver_version = "ArsDigita Oracle Driver version " NSORACLE_VERSION;
-static char *ora_driver_name = "Oracle8";
+static char *ora_driver_name = "Oracle10";
/* other tweakable parameters */
This works fine for our ACS installation. However, when I attempted to get OpenACS running on the same laptop, OpenACS wasn't able to connect to Oracle.
After a little bit of poking around, I found that OpenACS assumes that the Oracle driver will call itself Oracle8. So my above patch seems to conflict.
So one approach is to recompile my driver as Oracle8.
The other is to fix OpenACS to be smarter. However, trying that approach has not been fruitful for me:
Index: packages/acs-tcl/tcl/00-database-procs.tcl
===================================================================
--- packages/acs-tcl/tcl/00-database-procs.tcl (revision 3)
+++ packages/acs-tcl/tcl/00-database-procs.tcl (working copy)
@@ -188,7 +188,7 @@
# These are the default driverkey values, if they are not set
# in the config file:
- if { [string equal $driver {Oracle8}] } {
+ if { [string match Oracle* $driver] } {
set driverkey {oracle}
} elseif { [string equal $driver {PostgreSQL}] } {
set driverkey {postgresql}
Changing this, for example, does not actually solve the problem, because earlier:
Index: packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl
===================================================================
--- packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl (revision 3)
+++ packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl (working copy)
@@ -103,7 +103,7 @@
# in all cases...
nsv_set ad_known_database_types . \
- [list [list "oracle" "Oracle8" "Oracle8"] [list "postgresql" "PostgreSQL" "PostgreSQL"]]
+ [list [list "oracle" "Oracle8" "Oracle8"] [list "oracle" "Oracle9" "Oracle9"] [list "oracle" "Oracle10" "Oracle10"] [list "postgresql" "PostgreSQL" "PostgreSQL"]]
#
# Initialize the list of available pools
this is where the list of known database types are. If I change it here, however, it seems that things work. Everything loads up, and I'm able to get partway through the installation.
However, as I feared, the database queries seem to be using only the generic forms of the database queries, never the Oracle ones. So I've confused OpenACS somehow.
Can someone point me in the right direction here?