We are having trouble getting AOLServer 4.5 with nsoracle 2.7 to resolve the TNS name of its datasource. The setup works when AOLServer and Oracle are on the same physical machine, but not when they are on separate servers.
Both the web and database servers are running Solaris 10 x86 (SunOS 5.10 Generic_127112-11 i86pc i386 i86pc).
The database server has Oracle 10g Standard Edition (Oracle Database 10g Release 10.2.0.1.0 - Production).
The web server has the Admin install of Oracle Client (10.2.0)
I can connect to Oracle from the web server machine via the command-line with sqlplus and with tnsping, which implies that TNS resolution is working in general. It is only inside AOLServer/nsoracle that we see the problem. The nsdb and nsoracle drivers load with no errors:
[02/May/2008:14:36:07][936.1][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nssock.so'
[02/May/2008:14:36:07][936.1][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nslog.so'
[02/May/2008:14:36:07][936.1][-main-] Notice: nslog: opened '/usr/local/aolserver/servers/server1/modules/nslog/access.log'
[02/May/2008:14:36:07][936.1][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nsdb.so'
[02/May/2008:14:36:07][936.1][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nsoracle.so'
[02/May/2008:14:36:07][936.1][-main-] Notice: ora10 driver LobBufferSize = 16384
[02/May/2008:14:36:07][936.1][-main-] Notice: ora10 driver PrefetchRows = 0
[02/May/2008:14:36:07][936.1][-main-] Notice: ora10 driver PrefetchMemory = 0
[02/May/2008:14:36:07][936.1][-main-] Notice: nsoracle.c:897:Ns_DbDriverInit: entry (hdriver 808e008, config_path ns/db/driver/ora10)
[02/May/2008:14:36:07][936.1][-main-] Notice: Loaded ArsDigita Oracle Driver version 2.7, built on 14:17:07/May 2 2008
[02/May/2008:14:36:07][936.1][-main-] Notice: nsoracle.c:918:Ns_DbDriverInit: driver `Oracle8' loaded.
[02/May/2008:14:36:07][936.1][-main-] Notice: nsoracle.c:4015:ora_server_init: entry (server1, db, ora10)
However, when I try to allocate a handle from the pool I see the following error in the web server log:
Error: nsoracle.c:1037:ora_open_db: error in `OCIServerAttach ()': ORA-12154: TNS:could not resolve the connect identifier specifiedSQL: [nil]
[02/May/2008:14:39:15][936.5][-conn:0-] Error: dbdrv: failed to open database 'ora10:DS02'
[02/May/2008:14:39:15][936.5][-conn:0-] Error: Tcl exception:
could not allocate 1 handle(s) from pool "p1"
while executing
"ns_db gethandle"
invoked from within
"set myhandle [ns_db gethandle]"
(file "/usr/local/aolserver/servers/server1/pages/sk_dbtest.tcl" line 6)
invoked from within
"source $file"
invoked from within
"ns_sourceproc cns0 {}"
Any help with this issue would be greatly appreciated.
Best regards,
-SK
**************** CONFIGURATION INFO *******************
Here is the nsoracle section of our server config:
ns_section ns/db/drivers
ns_param ora10 nsoracle.sons_section ns/db/driver/ora10
ns_param maxStringLogLength -1
ns_param CharExpansion 2
ns_param debug on
ns_section ns/db/pools
ns_param p1 p1
ns_section ns/db/pool/p1
ns_param MaxIdle 1000000000
ns_param MaxOpen 1000000000
ns_param Driver ora10
ns_param Connections 3
ns_param datasource DS02
ns_param User xxx
ns_param Password yyy
ns_param Verbose on
ns_param logsqlerrors on
ns_param ExtendedTableInfo on
ns_section ns/server/server1/db
ns_param Pools *
ns_param DefaultPool p1
Here is the tnsnames.ora:
DS02 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Dev02)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = GCDEV.Dev02)
)
)
And here are the Oracle environment variables for the web server user:
ORACLE_SID=GCDEV
ORACLE_BASE=/opt/app/oracle
TNS_ADMIN=/opt/app/oracle/product/10.2.0/client_1/network/admin
ORACLE_HOME=/opt/app/oracle/product/10.2.0/client_1