StrawberryPerl / Perl-Dist-Strawberry

Tooling to build and package releases for Perl on Windows.
https://strawberryperl.com
Other
280 stars 48 forks source link

perl 5.36 cpan | DBD::Oracle installation #69

Open shawnlaffan opened 1 year ago

shawnlaffan commented 1 year ago

We need the Oracle Instant Client 64bit for DBD::Oracle

https://github.com/StrawberryPerl/Perl-Dist-Strawberry/blob/5f6e4153087e3ce44d6000f6395e2914b2a86fdc/share/64bit-5.36.0.1.pp#L247

shawnlaffan commented 1 year ago

@genio - looks like we need to add the Oracle Instant Client to the docker image. The path is from a local machine used for the 5.32 builds, I assume.

I am not sure which of the downloads should be used for this.
https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html

genio commented 1 year ago

https://github.com/gwenshap/DBD-Oracle/blob/dc6325d4f96da3c54fc6862512f4de67e5ec03e2/README.win64.txt#L7 seems to indicate we can use either of the instant clients, so I'd say basic. I don't know if we need any of the features excluded from basic for basic-light

abraxxa commented 1 year ago

DBD::Oracle also needs the SQLPlus package to detect some settings like the version. If I remember correctly also the SDK is required. I can check that next week if you want.

shawnlaffan commented 1 year ago

Thanks @abraxxa - that would be very helpful.

shawnlaffan commented 1 year ago

DBD::Oracle also needs the SQLPlus package to detect some settings like the version. If I remember correctly also the SDK is required. I can check that next week if you want.

@abraxxa - have you had a chance to follow up on this?

shawnlaffan commented 1 year ago

Just a data point, building DBD::Oracle under the docker container needs both SQLPlus and OCI.

C:\spbuild\msys64\.cpanm\work\1683344904.1912\DBD-Oracle-1.83>set ORACLE_HOME=z:\sw\orainst

C:\spbuild\msys64\.cpanm\work\1683344904.1912\DBD-Oracle-1.83>perl Makefile.PL -V 21.9
Using DBI 1.643 (for perl 5.036001 on MSWin32-x64-multi-thread) installed in C:/strawberry/perl/vendor/lib/auto/DBI/
Configuring DBD::Oracle for perl 5.036001 on MSWin32 (MSWin32-x64-multi-thread)

If you encounter any problem, a collection of troubleshooting
guides are available under lib/DBD/Oracle/Troubleshooting.
'DBD::Oracle::Troubleshooting' is the general troubleshooting
guide, while platform-specific troubleshooting hints
live in their labelled sub-document (e.g., Win32
hints are gathered in 'lib/DBD/Oracle/Troubleshooting/Win32.pod').

Installing on a MSWin32, Ver#10.0
Using Oracle in z:/sw/orainst
Can't find sqlplus. Pity, it would have helped.
Forcing Oracle version to be treated as 21.9
Oracle Version 21.9 (21.9)
OCI directory not found, please install OCI in z:/sw/orainst at Makefile.PL line 324.
shawnlaffan commented 1 year ago

In the absence of further input I made the executive decision to not include this module ~from~ in the distribution.

Even if we provide the XS bindings, the user still has to have the instant client and sqlplus distributions on their machines.

Building the bindings seems not so difficult (a few env vars need to be set). I assume things were much harder at the time Strawberry Perl was started.

If there is a need for this module to be in SP then we would need to resolve the above issues for the build system and cut a new SP release.

I'll close this issue in about a week (or maybe later) unless there is further discussion.

xiaoyafeng commented 1 year ago

Strawberry Perl shipped with DBD-Oracle since 2015, and it's very helpful for Oracle DBA. hope it will reappear in next release ball.

abraxxa commented 1 year ago

DBD::Oracle also needs the SQLPlus package to detect some settings like the version. If I remember correctly also the SDK is required. I can check that next week if you want.

@abraxxa - have you had a chance to follow up on this?

Sorry for the much too late reply! We finally migrated away from Oracle and I failed to remember to look it up. I've installed all three zip files for DBD::Oracle to recognize the InstantClient:

Further the libaio1 package is required on Debian.

And I've set those env vars system wide via /etc/environment:

export ORACLE_HOME=/opt/instantclient_18_3
export LD_LIBRARY_PATH=/opt/instantclient_18_3
export TNS_ADMIN=/etc
export NLS_LANG=AMERICAN_AMERICA.AL32UTF
shawnlaffan commented 1 year ago

Thanks @abraxxa

That gives a good indication of which packages are needed for a Windows install.

I wonder if this is best done as an Alien module to simplify the user experience? It can be used to add the relevant paths to the system before running in addition to downloading and unpacking. (Assuming it is loaded before or as part of DBD::Oracle).

In any case, I have builds of 5.36.1 and 5.38.0 ready to go (more recent than the current dev releases). If we include it in Strawberry Perl then it will be in the next point releases (5.38.0.2, 5.36.1.2).

I'll leave this issue open.

thuety commented 11 months ago

I'm looking forward to build that includes DBD::Oracle... still using the eol 5.32.1 at the moment