Forum OpenACS Q&A: Multiple Data Source OpenACS installation

Hi there,

Can someone help me out? I'm trying to configure an extra Oracle pool in my Postgres OpenACS startup file. I'm getting the following error: 'Database pool "my_pool" is of type "oracle". The first database pool available to OpenACS was of type "postgresql". All database pools must be configured to use the same RDMBS engine, user and database.'

Is is possible to have access to both a postgres and oracle datasource from aolserver or am I just being really stupid? I've included my db configuration below...thanks for your help.

ns_section "ns/db/drivers"

if { $database == "oracle" } {

ns_param ora8 ${bindir}/ora8.so

} else {

ns_param ora8 ${bindir}/ora8.so

ns_param postgres ${bindir}/postgres.so ;# Load PostgreSQL driver

}

ns_section ns/db/pools

ns_param my_pool my_pool

ns_param pool1 "Pool 1"

ns_param pool2 "Pool 2"

ns_param pool3 "Pool 3"

ns_section ns/db/pool/pool1

ns_param maxidle 1000000000

ns_param maxopen 1000000000

ns_param connections 5

ns_param verbose $debug

ns_param extendedtableinfo true

ns_param logsqlerrors $debug

if { $database == "oracle" } {

ns_param driver ora8

ns_param datasource {}

ns_param user $db_name

ns_param password $db_password

} else {

ns_param driver postgres

ns_param datasource localhost::${db_name}

ns_param user nsadmin

ns_param password ""

}

ns_section ns/db/pool/pool2

ns_param maxidle 1000000000

ns_param maxopen 1000000000

ns_param connections 5

ns_param verbose $debug

ns_param extendedtableinfo true

ns_param logsqlerrors $debug

if { $database == "oracle" } {

ns_param driver ora8

ns_param datasource {}

ns_param user $db_name

ns_param password $db_password

} else {

ns_param driver postgres

ns_param datasource localhost::${db_name}

ns_param user nsadmin

ns_param password ""

}

ns_section ns/db/pool/pool3

ns_param maxidle 1000000000

ns_param maxopen 1000000000

ns_param connections 5

ns_param verbose $debug

ns_param extendedtableinfo true

ns_param logsqlerrors $debug

if { $database == "oracle" } {

ns_param driver ora8

ns_param datasource {}

ns_param user $db_name

ns_param password $db_password

} else {

ns_param driver postgres

ns_param datasource localhost::${db_name}

ns_param user nsadmin

ns_param password ""

}

ns_section ns/db/pool/my_pool

ns_param MaxIdle 1000000000

ns_param MaxOpen 1000000000

ns_param Driver ora8

ns_param Connections 4

ns_param DataSource {Athlon_SID}

ns_param User wibble

ns_param Password wibble

ns_param Verbose On

ns_param ExtendedTableInfo On

ns_section ns/server/${server}/db

ns_param pools "*"

ns_param defaultpool pool1

Collapse
Posted by Don Baccus on
By default OpenACS 4.5 will make use of all database pools defined in your AOLserver startup script. It will demand that they all be either Oracle or PG.

However, if you add a section like this:

ns_section "ns/server/${servername}/acs/database"
ns_param   availablepool   pool1
ns_param   availablepool   pool2
ns_param   availablepool   pool3
OpenACS 4.5 will only use those pools and ignore others. You can then access your Oracle pool explicitly using the old "ns_db" interface, i.e. "set db [ns_db gethandle oracle_pool]".

I've done this when migrating data from openacs.org to our test OpenACS 4 website's forums, from openacs.org (which is an OpenACS 3.2, i.e. PG, site) to OpenACS 4.5/PG and OpenACS 4.5/Oracle alike.