ORA-12154 (DBD ERROR: OCIServerAttach)

ORA-12154 (DBD ERROR: OCIServerAttach)

am 05.09.2005 18:30:26 von cseelig

Greetings.

Context:

Windows XP client

Perl
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
(with 7 registered patches, see perl -V for more detail)
Binary build 813 [148120] provided by ActiveState
http://www.ActiveState.com
Built Jun 6 2005 13:36:37

Note: perl -V output below

DBI
DBI version 1.48
DBD-ODBC version 1.13
DBD-Oracle version 1.16

Installed via (a varient of) this:
ppm install -force -follow
ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBI.ppd
ppm install -force -follow
ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBD-Oracle.ppd
ppm install -force -follow
ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBD-ODBC.ppd

Oracle server (remote)
Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit Production
With the Partitioning option
JServer Release 8.1.7.4.0 - 64bit Production

ORACLE_HOME is set both in the registry (via Oracle client-side
installation process) and also in the system environment variables
(by me, for good measure?).

Symptoms:
SqlPlus connection works fine.

A perl script attempting connection works fine ONLY when the
script is run from \orant\net80\admin.

When the script is run from anywhere else, I get this error:

ORA-12154: TNS:could not resolve the connect identifier specified
(DBD ERROR: OCIServerAttach)

Note that printf("%s\n", $ENV{'ORACLE_HOME'});
displays c:\orant (as expected).

Help!
And Thanks!
- C Seelig
=====================================================
C:\Documents and Settings\SeeligC\Start Menu>perl -V
Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
Platform:
osname=MSWin32, osvers=5.0, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32
-D_CONSOLE
-DNO_STRICT -DHAVE_DES_FCRYPT -DBUILT_BY_ACTIVESTATE -DNO_HASH_SEED
-DUSE_SITECUSTOMIZE
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
-DPERL_MSVCRT_READFIX',
optimize='-MD -Zi -DNDEBUG -O1',
cppflags='-DWIN32'
ccversion='12.00.8804', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf
-libpath:"C:\Perl\lib\CORE" -machine:x86'
libpth=\lib
libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib
ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
msvcrt.lib
perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib
ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
gnulibc_version='undef'
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-opt:ref,icf
-libpath:"C:\Perl\lib\CORE" -machine:x86'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
USE_SITECUSTOMIZE PERL_IMPLICIT_CONTEXT
PERL_IMPLICIT_SYS
Locally applied patches:
ActivePerl Build 813 [148120]
Iin_load_module moved for compatibility with build 806
PerlEx hacks for CGI::Carp
Less verbose ExtUtils::Install and Pod::Find
instmodsh upgraded from ExtUtils-MakeMaker-6.25
24699 ICMP_UNREACHABLE handling in Net::Ping
21540 Fix backward-compatibility issues in if.pm
Built under MSWin32
Compiled at Jun 6 2005 13:36:37
@INC:
C:/Perl/lib
C:/Perl/site/lib
.

RE: ORA-12154 (DBD ERROR: OCIServerAttach)

am 07.09.2005 02:13:43 von jurlwin

>=20
>=20
> Greetings.
>=20
> Context:
>=20
> Windows XP client
>=20
> Perl
> This is perl, v5.8.7 built for MSWin32-x86-multi-thread
> (with 7 registered patches, see perl -V for more detail)
> Binary build 813 [148120] provided by ActiveState=20
> http://www.ActiveState.com
> Built Jun 6 2005 13:36:37
>=20
> Note: perl -V output below
>=20
> DBI
> DBI version 1.48
> DBD-ODBC version 1.13
> DBD-Oracle version 1.16
>=20
> Installed via (a varient of) this:
> ppm install -force -follow=20
> ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBI.ppd
> ppm install -force -follow=20
> ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBD-Oracle.ppd
> ppm install -force -follow=20
> ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBD-ODBC.ppd
>=20
> Oracle server (remote)
> Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit=20
> Production
> With the Partitioning option
> JServer Release 8.1.7.4.0 - 64bit Production
>=20
> ORACLE_HOME is set both in the registry (via Oracle client-side
> installation process) and also in the system environment variables
> (by me, for good measure?).

Chances are something is wrong in the registry or environment. Is there
a TNS_ADMIN set anywhere? Are you running under a web server when it's
not working?

Jeff

>=20
> Symptoms:
> SqlPlus connection works fine.
>=20
> A perl script attempting connection works fine ONLY when the
> script is run from \orant\net80\admin.
>=20
> When the script is run from anywhere else, I get this error:
>=20
> ORA-12154: TNS:could not resolve the connect identifier specified
> (DBD ERROR: OCIServerAttach)
>=20
> Note that printf("%s\n", $ENV{'ORACLE_HOME'});
> displays c:\orant (as expected).
>=20
> Help!
> And Thanks!
> - C Seelig =
==================== =====3D=
==================== =====3D=
===3D
> C:\Documents and Settings\SeeligC\Start Menu>perl -V
> Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
> Platform:
> osname=3DMSWin32, osvers=3D5.0, archname=3DMSWin32-x86-multi-thread
> uname=3D''
> config_args=3D'undef'
> hint=3Drecommended, useposix=3Dtrue, d_sigaction=3Dundef
> usethreads=3Ddefine use5005threads=3Dundef useithreads=3Ddefine=20
> usemultiplicity=3Ddefine
> useperlio=3Ddefine d_sfio=3Dundef uselargefiles=3Ddefine =
usesocks=3Dundef
> use64bitint=3Dundef use64bitall=3Dundef uselongdouble=3Dundef
> usemymalloc=3Dn, bincompat5005=3Dundef
> Compiler:
> cc=3D'cl', ccflags =3D'-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 =

> -D_CONSOLE
> -DNO_STRICT -DHAVE_DES_FCRYPT -DBUILT_BY_ACTIVESTATE=20
> -DNO_HASH_SEED=20
> -DUSE_SITECUSTOMIZE
> -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO=20
> -DPERL_MSVCRT_READFIX',
> optimize=3D'-MD -Zi -DNDEBUG -O1',
> cppflags=3D'-DWIN32'
> ccversion=3D'12.00.8804', gccversion=3D'', gccosandvers=3D''
> intsize=3D4, longsize=3D4, ptrsize=3D4, doublesize=3D8, =
byteorder=3D1234
> d_longlong=3Dundef, longlongsize=3D8, d_longdbl=3Ddefine, =
longdblsize=3D10
> ivtype=3D'long', ivsize=3D4, nvtype=3D'double', nvsize=3D8,=20
> Off_t=3D'__int64',=20
> lseeksize=3D8
> alignbytes=3D8, prototype=3Ddefine
> Linker and Libraries:
> ld=3D'link', ldflags =3D'-nologo -nodefaultlib -debug -opt:ref,icf
> -libpath:"C:\Perl\lib\CORE" -machine:x86'
> libpth=3D\lib
> libs=3D oldnames.lib kernel32.lib user32.lib gdi32.lib =
winspool.lib
> comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib =20
> netapi32.lib uuid.lib
> ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib=20
> msvcrt.lib
> perllibs=3D oldnames.lib kernel32.lib user32.lib gdi32.lib=20
> winspool.lib
> comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib =20
> netapi32.lib uuid.lib
> ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib=20
> msvcrt.lib
> libc=3Dmsvcrt.lib, so=3Ddll, useshrplib=3Dyes, libperl=3Dperl58.lib
> gnulibc_version=3D'undef'
> Dynamic Linking:
> dlsrc=3Ddl_win32.xs, dlext=3Ddll, d_dlsymun=3Dundef, ccdlflags=3D' =
'
> cccdlflags=3D' ', lddlflags=3D'-dll -nologo -nodefaultlib -debug=20
> -opt:ref,icf
> -libpath:"C:\Perl\lib\CORE" -machine:x86'
>=20
>=20
> Characteristics of this binary (from libperl):
> Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
> USE_SITECUSTOMIZE PERL_IMPLICIT_CONTEXT
> PERL_IMPLICIT_SYS
> Locally applied patches:
> ActivePerl Build 813 [148120]
> Iin_load_module moved for compatibility with build 806
> PerlEx hacks for CGI::Carp
> Less verbose ExtUtils::Install and Pod::Find
> instmodsh upgraded from ExtUtils-MakeMaker-6.25
> 24699 ICMP_UNREACHABLE handling in Net::Ping
> 21540 Fix backward-compatibility issues in if.pm
> Built under MSWin32
> Compiled at Jun 6 2005 13:36:37
> @INC:
> C:/Perl/lib
> C:/Perl/site/lib
> .
>=20
>=20

Re: ORA-12154 (DBD ERROR: OCIServerAttach)

am 07.09.2005 13:50:18 von cseelig

- TNS_ADMIN is not set in either the registry or environment.
- Not run by web server; only from the command line.

CS

Jeff Urlwin wrote:

Chances are something is wrong in the registry or environment. Is there
a TNS_ADMIN set anywhere? Are you running under a web server when it's
not working?

Jeff


>>Greetings.
>>
>>Context:
>>
>> Windows XP client
>>
>> Perl
>> This is perl, v5.8.7 built for MSWin32-x86-multi-thread
>> (with 7 registered patches, see perl -V for more detail)
>> Binary build 813 [148120] provided by ActiveState
>>http://www.ActiveState.com
>> Built Jun 6 2005 13:36:37
>>
>> Note: perl -V output below
>>
>> DBI
>> DBI version 1.48
>> DBD-ODBC version 1.13
>> DBD-Oracle version 1.16
>>
>> Installed via (a varient of) this:
>> ppm install -force -follow
>>ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBI.ppd
>> ppm install -force -follow
>>ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBD-Oracle.ppd
>> ppm install -force -follow
>>ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBD-ODBC.ppd
>>
>> Oracle server (remote)
>> Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit
>>Production
>> With the Partitioning option
>> JServer Release 8.1.7.4.0 - 64bit Production
>>
>> ORACLE_HOME is set both in the registry (via Oracle client-side
>> installation process) and also in the system environment variables
>> (by me, for good measure?).
>>

>>Symptoms:
>> SqlPlus connection works fine.
>>
>> A perl script attempting connection works fine ONLY when the
>> script is run from \orant\net80\admin.
>>
>> When the script is run from anywhere else, I get this error:
>>
>> ORA-12154: TNS:could not resolve the connect identifier specified
>> (DBD ERROR: OCIServerAttach)
>>
>> Note that printf("%s\n", $ENV{'ORACLE_HOME'});
>> displays c:\orant (as expected).
>>
>>Help!
>>And Thanks!
>>- C Seelig =====================================================
>>C:\Documents and Settings\SeeligC\Start Menu>perl -V
>>Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
>> Platform:
>> osname=MSWin32, osvers=5.0, archname=MSWin32-x86-multi-thread
>> uname=''
>> config_args='undef'
>> hint=recommended, useposix=true, d_sigaction=undef
>> usethreads=define use5005threads=undef useithreads=define
>>usemultiplicity=define
>> useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
>> use64bitint=undef use64bitall=undef uselongdouble=undef
>> usemymalloc=n, bincompat5005=undef
>> Compiler:
>> cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32
>>-D_CONSOLE
>> -DNO_STRICT -DHAVE_DES_FCRYPT -DBUILT_BY_ACTIVESTATE
>>-DNO_HASH_SEED
>>-DUSE_SITECUSTOMIZE
>> -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
>>-DPERL_MSVCRT_READFIX',
>> optimize='-MD -Zi -DNDEBUG -O1',
>> cppflags='-DWIN32'
>> ccversion='12.00.8804', gccversion='', gccosandvers=''
>> intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
>> d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
>> ivtype='long', ivsize=4, nvtype='double', nvsize=8,
>>Off_t='__int64',
>>lseeksize=8
>> alignbytes=8, prototype=define
>> Linker and Libraries:
>> ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf
>> -libpath:"C:\Perl\lib\CORE" -machine:x86'
>> libpth=\lib
>> libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
>> comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
>>netapi32.lib uuid.lib
>> ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
>>msvcrt.lib
>> perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib
>>winspool.lib
>> comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
>>netapi32.lib uuid.lib
>> ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
>>msvcrt.lib
>> libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
>> gnulibc_version='undef'
>> Dynamic Linking:
>> dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
>> cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
>>-opt:ref,icf
>> -libpath:"C:\Perl\lib\CORE" -machine:x86'
>>
>>
>>Characteristics of this binary (from libperl):
>> Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
>> USE_SITECUSTOMIZE PERL_IMPLICIT_CONTEXT
>> PERL_IMPLICIT_SYS
>> Locally applied patches:
>> ActivePerl Build 813 [148120]
>> Iin_load_module moved for compatibility with build 806
>> PerlEx hacks for CGI::Carp
>> Less verbose ExtUtils::Install and Pod::Find
>> instmodsh upgraded from ExtUtils-MakeMaker-6.25
>> 24699 ICMP_UNREACHABLE handling in Net::Ping
>> 21540 Fix backward-compatibility issues in if.pm
>> Built under MSWin32
>> Compiled at Jun 6 2005 13:36:37
>> @INC:
>> C:/Perl/lib
>> C:/Perl/site/lib
>> .
>>
>>
>>
>>
>
>
>

Re: ORA-12154 (DBD ERROR: OCIServerAttach)

am 07.09.2005 15:57:09 von me

Charles Seelig wrote:
> - TNS_ADMIN is not set in either the registry or environment.
> - Not run by web server; only from the command line.
>
> CS

ora-12154 (tns-12154) means it can't find the service name you
requested. So that means:

1) the service name you requested doesn't exist in your tnsnames.ora file
2) It can't find your tnsnames.ora file
3) your sqlnet.ora has a default domain that is different then your
tnsnames entries

I don't really install on MS but generally oracle looks in
$ORACLE_HOME/network/admin for the tnsnames.ora file. You could try
creating a TNS_ADMIN environmental variable pointing to
$ORACLE_HOME/net80/admin. What happened when you installed DBD::Oracle?
It failed the tests I take it?

Jay