Quantcast
Channel: perl.dbi.users
Viewing all articles
Browse latest Browse all 225

(Fwd) Issues with Oracle DBD in Cygwin (3 messages)

$
0
0
----- Forwarded message from "Neargarder, Keith" <Keith.Neargarder@USA.GKNAEROSPACE.COM> -----

Date: Fri, 16 Sep 2016 22:16:11 +0000
From: "Neargarder, Keith" <Keith.Neargarder@USA.GKNAEROSPACE.COM>
To: "'timb@cpan.org'" <timb@cpan.org>, "'byterock@cpan.org'" <byterock@cpan.org>, "'yanick@cpan.org'" <yanick@cpan.org>, "'mjevans@cpan.org'" <mjevans@cpan.org>
Subject: Issues with Oracle DBD in Cygwin

Gentlemen,



Any assistance is greatly appreciated. I have been working on this for days now and am completely stuck.
I cannot find a way past the error below. I have searched online and tried everything I have found and
no luck. Wasn't sure if I should just create another Cygwin/DBD-Oracle post or what???



Suggestions please???



Let me know if you need more info. I tried to be as thorough as possible.



Couple of things I have noticed that seem off to me and might be an issue???

1. after unpacking the instant client files into c:\oracle\instantclient_12_1 (set as ORACLE_HOME)
I do NOT have a "lib" or "rdbms/lib" subdirectory - am I missing something? I have been using
LD_LIBRARY_PATH=$ORACLE_HOME/lib and I see it and the rdbms/lib referenced in LD_RUN_PATH but those
directories do not exist. If it were a problem I sure would expect some sort of error message but
nothing jumps out at me???

2. I cannot connect to my target database with the sqlplus installed under instant client however
I can connect using another Oracle client installed on the same server. Obviously this is an issue but I
don't believe I am even getting to the point where my Perl script tries to connect as it cannot even
load the Oracle.dll. With sqlplus I get the error: ORA-12154: TNS:could not resolve the connect
identifier specified

3. Tried using the other Oracle client I have installed where sqlplus does work but still get the
same error when trying to run my Perl script.

4. when running "perl Makefile.pl -V 12.1.0" one thing/difference that caught my eye is in my
output it has a line "Generating a Unix-style Makefile" whereas I have seen on another Gygwin/DBD-Oracle
post "Generating a GNU-style Makefile" - could this be an issue??? The make file seems to "work", runs
to completion and creates all the targets, so I guess it is OK.



Info:

. Windows Server 2008 R2 SP1 64-bit OS

. Cygwin Version 2.5.1

. Perl 5.22.2 (Cygwin's Perl build, see output of "perl -V" below)

. Oracle 12.1.0 (database on a Linux server if that matters; I am able to connect to it from
this Windows server with sqlplus

. Instant Client 12.1.0.2.0 - first I tried 64-bit, did not work then tried 32-bit when I
remembered another 3^rd party software required 32-bit Oracle client; I downloaded the Instant client
basic, SDK and sqlplus zip files and extracted them all into c:\oracle\instantclient_12_1

. DBD-Oracle 1.74



Environment variables:

. ORACLE_DSN="DBI:Oracle:host=$my_host;sid=$my_sid"

. ORACLE_USERID=$my_user/$my_pass

. ORACLE_HOME=/cygdrive/c/oracle/instantclient_12_1

. LD_LIBRARY_PATH=$ORACLE_HOME/lib



Steps taken (as outlined in Cygwin.pod):

5. extracted the DBD-Oracle 1.74 package into my personal work directory
/home/svb000028/perl5/DBD-Oracle-1.74

6. cd /home/svb000028/perl5/DBD-Oracle-1.74

7. generated the liboci.a using: dlltool --input-def oci.def --output-lib liboci.a

8. downloaded instant client packages and unpacked them into the c:\oracle\instantclient_12_1
directory.

9. set environment variables (see above), tried ORACLE_USERID with and without the trailing
"@$my_sid" as I have seen it both ways in different posts

10. ran: perl Makefile.pl (see output below)

11. ran: make (see output below)

12. tried make test but all those fail so not much use

13. ran: make install (see output below)

14. ran my own simple test.pl script to test out DBD-Oracle connection; tried variations of connect
info but nothing works; using line as suggested in Cygwin.pod, sample connect line below(from test.pl
line 152):

$dbh = DBI->connect(

"dbi:Oracle:host=$my_host;sid=$my_sid",

$my_user, $my_pass);



Error/output from test.pl:



$ test.pl

install_driver(Oracle) failed: Can't load
'/usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle:
Exec format error at /usr/lib/perl5/5.22/x86_64-cygwin-threads/DynaLoader.pm line 193.

at (eval 35) line 3.

Compilation failed in require at (eval 35) line 3.

Perhaps a required shared library or dll isn't installed where expected

at /home/svb000028/util/test.pl line 152.



perl -V output:



$ perl -V

Summary of my perl5 (revision 5 version 22 subversion 2) configuration:



Platform:

osname=cygwin, osvers=2.5.1(0.29753), archname=cygwin-thread-multi

uname='cygwin_nt-6.3 cygwin 2.5.1(0.29753) 2016-04-21 22:14 x86_64 cygwin '

config_args='-des -Dprefix=/usr -Dmksymlinks -Darchname=x86_64-cygwin-threads
-Dlibperl=cygperl5_22.dll -Dcc=gcc -Dld=g++ -Accflags=-ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv'

hint=recommended, useposix=true, d_sigaction=define

useithreads=define, usemultiplicity=define

use64bitint=define, use64bitall=define, uselongdouble=undef

usemymalloc=n, bincompat5005=undef

Compiler:

cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe
-Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2',

optimize='-O3',

cppflags='-DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe
-Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong'

ccversion='', gccversion='5.3.0', gccosandvers=''

intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3

d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3

ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8

alignbytes=8, prototype=define

Linker and Libraries:

ld='g++', ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base
-fstack-protector-strong'

libpth=/usr/lib

libs=-lpthread -lgdbm -ldb -ldl -lcrypt -lgdbm_compat

perllibs=-lpthread -ldl -lcrypt

libc=/usr/lib/libcygwin.a, so=dll, useshrplib=true, libperl=cygperl5_22.dll

gnulibc_version=''

Dynamic Linking:

dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '

cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import -Wl,--export-all-symbols
-Wl,--enable-auto-image-base -fstack-protector-strong'





Characteristics of this binary (from libperl):

Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS

PERL_DONT_CREATE_GVSV

PERL_HASH_FUNC_ONE_AT_A_TIME_HARD

PERL_IMPLICIT_CONTEXT PERL_NEW_COPY_ON_WRITE

PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV

USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS

USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE

USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME

USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API

Built under cygwin

Compiled at Apr 30 2016 17:04:50

@INC:

/usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads

/usr/lib/perl5/site_perl/5.22

/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads

/usr/lib/perl5/vendor_perl/5.22

/usr/lib/perl5/5.22/x86_64-cygwin-threads

/usr/lib/perl5/5.22

.





perl Makefile.pl -V 12.1.0 output:



$ perl Makefile.pl -V 12.1.0

Using DBI 1.636 (for perl 5.022002 on cygwin-thread-multi) installed in
/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/



Configuring DBD::Oracle for perl 5.022002 on cygwin (cygwin-thread-multi)



Remember to actually *READ* the README file! Especially if you have any problems.



Installing on a cygwin, Ver#2.5

Using Oracle in /cygdrive/c/oracle/instantclient_12_1

DEFINE _SQLPLUS_RELEASE = "1201000200" (CHAR)

Forcing Oracle version to be treated as 12.1.0

Oracle version 12.1.0 (12.1)

Using OCI directory 'sdk'



client_version=12.1





DEFINE= -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112





Checking for functioning wait.ph





System: perl5.022002 cygwin_nt-6.3 cygwin 2.5.1(0.29753) 2016-04-21 22:14 x86_64 cygwin

Compiler: gcc -O3 -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe
-Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2

Linker: /usr/bin/ld

Sysliblist:



Checking if your kit is complete...

Looks good

LD_RUN_PATH=/cygdrive/c/oracle/instantclient_12_1/lib:/cygdrive/c/oracle/instantclient_12_1/rdbms/lib

Using DBD::Oracle 1.74.

Using DBD::Oracle 1.74.

Using DBI 1.636 (for perl 5.022002 on cygwin-thread-multi) installed in
/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/

Generating a Unix-style Makefile

Writing Makefile for DBD::Oracle

Writing MYMETA.yml and MYMETA.json



*** If you have problems...

read all the log printed above, and the README and README.help.txt files.

(Of course, you have read README by now anyway, haven't you?)



make output:



$ make

cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h

cp lib/DBD/Oracle/Object.pm blib/lib/DBD/Oracle/Object.pm

cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm

cp lib/DBD/Oracle/Troubleshooting/Hpux.pod blib/lib/DBD/Oracle/Troubleshooting/Hpux.pod

cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm

cp lib/DBD/Oracle/Troubleshooting.pod blib/lib/DBD/Oracle/Troubleshooting.pod

cp lib/DBD/Oracle/Troubleshooting/Win64.pod blib/lib/DBD/Oracle/Troubleshooting/Win64.pod

cp lib/DBD/Oracle/Troubleshooting/Linux.pod blib/lib/DBD/Oracle/Troubleshooting/Linux.pod

cp lib/DBD/Oracle/Troubleshooting/Win32.pod blib/lib/DBD/Oracle/Troubleshooting/Win32.pod

cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h

cp lib/DBD/Oracle/Troubleshooting/Vms.pod blib/lib/DBD/Oracle/Troubleshooting/Vms.pod

cp lib/DBD/Oracle/Troubleshooting/Cygwin.pod blib/lib/DBD/Oracle/Troubleshooting/Cygwin.pod

cp lib/DBD/Oracle/Troubleshooting/Sun.pod blib/lib/DBD/Oracle/Troubleshooting/Sun.pod

cp lib/DBD/Oracle.pm blib/lib/DBD/Oracle.pm

cp lib/DBD/Oracle/Troubleshooting/Aix.pod blib/lib/DBD/Oracle/Troubleshooting/Aix.pod

cp lib/DBD/Oracle/Troubleshooting/Macos.pod blib/lib/DBD/Oracle/Troubleshooting/Macos.pod

cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h

Running Mkbootstrap for Oracle ()

chmod 644 "Oracle.bs"

"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- Oracle.bs
blib/arch/auto/DBD/Oracle/Oracle.bs 644

"/usr/bin/perl.exe" -p -e "s/~DRIVER~/Oracle/g"
/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/Driver.xst > Oracle.xsi

"/usr/bin/perl.exe" "/usr/lib/perl5/5.22/ExtUtils/xsubpp" -typemap
'/usr/lib/perl5/5.22/ExtUtils/typemap' -typemap '/home/svb000028/perl5/DBD-Oracle-1.74/typemap'
Oracle.xs > Oracle.xsc

mv Oracle.xsc Oracle.c

gcc -c -I/cygdrive/c/oracle/instantclient_12_1/sdk/include
-I/cygdrive/c/oracle/instantclient_12_1/rdbms/demo
-I/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE
-U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" -Wall
-Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112 Oracle.c

gcc -c -I/cygdrive/c/oracle/instantclient_12_1/sdk/include
-I/cygdrive/c/oracle/instantclient_12_1/rdbms/demo
-I/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE
-U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" -Wall
-Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112 dbdimp.c

In file included from dbdimp.h:420:0,

from Oracle.h:52,

from dbdimp.c:21:

dbdimp.c: In function `ora_db_login6':

ocitrace.h:74:7: warning: format `%d' expects argument of type `int', but argument 12 has type `size_t
{aka long unsigned int}' [-Wformat=]

"%sOCISessionPoolCreate(envhp=%p,ph=%p,pn=%p,pnl=%p,min=%d,max=%d,incr=%d,
un=%s,unl=%d,pw=%s,pwl=%d)=%s\n",\

^

dbdimp.c:725:5: note: in expansion of macro `OCISessionPoolCreate_log_stat'

OCISessionPoolCreate_log_stat(

^

ocitrace.h:74:7: warning: format `%d' expects argument of type `int', but argument 14 has type `size_t
{aka long unsigned int}' [-Wformat=]

"%sOCISessionPoolCreate(envhp=%p,ph=%p,pn=%p,pnl=%p,min=%d,max=%d,incr=%d,
un=%s,unl=%d,pw=%s,pwl=%d)=%s\n",\

^

dbdimp.c:725:5: note: in expansion of macro `OCISessionPoolCreate_log_stat'

OCISessionPoolCreate_log_stat(

^

In file included from Oracle.h:50:0,

from dbdimp.c:21:

dbdimp.c: In function `ora_st_FETCH_attrib':

/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/DBIXS.h:381:45: warning: unused variable
`imp_dbh' [-Wunused-variable]

#define D_imp_dbh_from_sth D_imp_from_child(imp_dbh, imp_dbh_t, imp_sth)

^

/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/DBIXS.h:379:39: note: in definition of
macro `D_imp_from_child'

type *name = (type*)(DBIc_PARENT_COM(child))

^

dbdimp.c:4349:9: note: in expansion of macro `D_imp_dbh_from_sth'

D_imp_dbh_from_sth;

^

gcc -c -I/cygdrive/c/oracle/instantclient_12_1/sdk/include
-I/cygdrive/c/oracle/instantclient_12_1/rdbms/demo
-I/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE
-U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" -Wall
-Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112 oci8.c

oci8.c: In function `ora_blob_read_mb_piece':

oci8.c:1845:13: warning: format `%lu' expects argument of type `long unsigned int', but argument 6 has
type `ub4 {aka unsigned int}' [-Wformat=]

" blob_read field %d, ftype %d, offset %ld, len %lu, "

^

rm -f blib/arch/auto/DBD/Oracle/Oracle.dll

LD_RUN_PATH="/cygdrive/c/oracle/instantclient_12_1/lib:/cygdrive/c/oracle/instantclient_12_1/rdbms/lib"
g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base
-fstack-protector-strong Oracle.o dbdimp.o oci8.o -o blib/arch/auto/DBD/Oracle/Oracle.dll \

/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE/cygperl5_22.dll -L/home/svb000028/perl5/DBD-Oracle-1.74
-loci \



chmod 755 blib/arch/auto/DBD/Oracle/Oracle.dll

Manifying 13 pod documents



make install output:



$ make install

"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- Oracle.bs
blib/arch/auto/DBD/Oracle/Oracle.bs 644

Manifying 13 pod documents

Files found in blib/arch: installing files in blib/lib into architecture dependent library tree

Installing /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads/auto/DBD/Oracle/mk.pm

Installing /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads/auto/DBD/Oracle/Oracle.dll

Appending installation info to /usr/lib/perl5/5.22/x86_64-cygwin-threads/perllocal.pod

WARNING: This document may contain technical data whose export is restricted by the Arms Export Control
Act (Title 22, U.S.C., SEQ 2751 ET SEQ) or the Export Administration Act (Title 50, U.S.C., APP
2401-2420). Violations of these export laws are subject to severe criminal penalties. This e-mail is
strictly confidential and intended solely for the addressee. It may contain information which is covered
by legal, professional, or other privilege. If you are not the intended addressee you must not use,
disclose, or copy this transmission. This E-mail is not intended to impose nor shall it be construed as
imposing any legally binding obligation upon any of the GKN group of companies ("GKN"), and/or any
subsidiaries thereof or associated companies thereof. Neither GKN nor any subsidiaries thereof or
associated companies thereof gives any representation or warranty as to the accuracy or completeness of
the contents of this E-mail. GKN shall not be held liable to any person resulting from the use of any
information contained in this E-mail and shall not be liable to any person who acts or omits to do
anything in reliance upon it. Unendorsed export or re-export is prohibited.

----- End forwarded message -----

Viewing all articles
Browse latest Browse all 225

Trending Articles