Forum OpenACS Q&A: database and aolserver on different machines - how to configure nsd.tcl

How do I configure nsd.tcl so it works with a database running on different machine?

Hello Jay,

Depends on what database you are using ... With Oracle you just have to put the SID of the database you want to connect to in the parameter ns_param datasource {} or if you are using PostgreSQL, the same parameter looks like ns_param datasource ${db_host}:${db_port}:${db_name} which should be self-explanatory.

Hope this helps.

Thanks Bruno,

Im using Oracle8i but I'm not convinced that specifying only SID will be enough since only SID is what I enter for a local db. Shouldn't there be also an entry for the remote host name and port where this SID is located?

The driver gets the info it needs from the tnsnames.ora file

Like Barry said, your instance should be configured to know what SID goes where ... For more information on tnsnames.ora have a look at the oracle documentation.

Hi Jay,
AOLserver will use Oracle Networking to connect to the database in the exact same way as SQL*Plus. If, from the AOLserver machine, you can do a tnsping SID or sqlplus user/pass@SID, then you can be confident that AOLserver will connect to the database. All you need then do is enter the SID for the datasource parameter.

If you can't do a tnsping or SQL*Plus won't connect, then you've got an Oracle networking problem.

best wishes
Brian

Thanks guys, so I understand now that this is done as any other oracle client/server connectivity via Net8.

I see my process of moving oracle database from one server to another as:
- recreate oracle on second machine
- shutdown oracle on webserver machine
- setup SID entries in tnsnames.ora on webserver machine pointing to second machine
- change entries for SID in nsd.tcl

For the oracle to be moved from RH7.3 to RH8 is this necessary to go thru the installation process or is it enough to clone it from the old machine?

note to myself,
Cloning ora8 from RH7.3 to RH8 works fine,
however nsd database_source does not accept tnsnames aliases but SID only. Its enough to point your existing entry in tnsnames to the remote host IP.