ODBC DB connect fails after switching to Oracle

ODBC DB connect fails after switching to Oracle

am 24.03.2009 14:22:52 von extern.Lars.Oeschey

Hi,

I have to switch databases for some applications, before we had MSSQL, and =
now it's oracle. I used DBI::ODBC for this, so I only changed the ODBC conn=
ection to be an Oracle one, and it *should* work. However I get this error:

Tue Mar 24 14:08:35 2009 Datatransfer started *********************
!!!!!!!!!!!!!!!!!!!!!!!!!!Tue Mar 24 14:08:35 2009 [Oracle][ODBC][Ora]ORA-1=
2154: TNS: Angegebener Connect Identifier konnte nicht aufgelöst werden
(SQL-08004)(DBD: db_login/SQLConnect err=3D-1)

(it means it can't resolve TNS)
I have seen that error before, when making the ODBC connection in Windows a=
nd I didn't use a "fqdn" Name for the database. But I have done that now, a=
nd I can successfully test the ODBC connection from it's setup window.

Just using it from my script won't work...

the code itself is simple:

$msdbh =3D DBI->connect("dbi:ODBC:BTETRANSFER", "user", "pass", { RaiseErro=
r =3D> 0, PrintError =3D> 1, AutoCommit =3D> 1 } ) or do {print LOG "!!!!!!=
!!!!!!!!!!!!!!!!!!!!$now $DBI::errstr\n" ; $seconds=3D300 ; next MAINLOOP};

any ideas where to check what?

Lars
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: ODBC DB connect fails after switching to Oracle

am 24.03.2009 15:38:49 von Jenda Krynicky

From: "Oeschey, Lars (I/ET-83, extern)"
> I have to switch databases for some applications, before we had MSSQL,
> and now it's oracle. I used DBI::ODBC for this, so I only changed the
> ODBC connection to be an Oracle one, and it *should* work. However I
> get this error: =

> =

> Tue Mar 24 14:08:35 2009 Datatransfer started *********************
> !!!!!!!!!!!!!!!!!!!!!!!!!!Tue Mar 24 14:08:35 2009 [Oracle][ODBC][Ora]
> ORA-12154: TNS: Angegebener Connect Identifier konnte nicht =

> aufgelöst werden
> (SQL-08004)(DBD: db_login/SQLConnect err=3D-1)
> =

> (it means it can't resolve TNS)
> I have seen that error before, when making the ODBC connection in
> Windows and I didn't use a "fqdn" Name for the database. But I have
> done that now, and I can successfully test the ODBC connection from
> it's setup window. =

> =

> Just using it from my script won't work...

Is the script running under the same account under which you tested =

the ODBC connection? It might be a permissions issue or the DSN was =

by accident created as a "User DSN", not "System DSN".

Jenda
=====3D Jenda@Krynicky.cz ===3D http://Jenda.Krynicky.cz ===
===3D
When it comes to wine, women and song, wizards are allowed =

to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: ODBC DB connect fails after switching to Oracle

am 24.03.2009 15:47:47 von extern.Lars.Oeschey

> Is the script running under the same account under which you tested
> the ODBC connection? It might be a permissions issue or the DSN was
> by accident created as a "User DSN", not "System DSN".

yeah, found it... it's running as a service, and therefor under the
"system" account. We have our oracle TNS based on LDAP, and the
TNS_ADMIN environment variable pointed to a network path containing the
TNS LDAP configuration. Obviously a local "system" user can't access
network paths... I run the service under a domain account now, and now
it works fine.

thanks for helping,

Lars
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs