Closed carragom closed 3 years ago
Reading #46 I saw the command to test the driver and this is what I'm getting
Oracle driver is not loading
$ perl -I/usr/local/Cellar/sqitch/v1.1.0/lib/perl5/darwin-thread-multi-2level -MDBD::Oracle -E 'say DBD::Oracle->VERSION'
Can't load '/usr/local/Cellar/sqitch/v1.1.0/lib/perl5/darwin-thread-multi-2level/auto/DBD/Oracle/Oracle.bundle' for module DBD::Oracle: dlopen(/usr/local/Cellar/sqitch/v1.1.0/lib/perl5/darwin-thread-multi-2level/auto/DBD/Oracle/Oracle.bundle, 1): Library not loaded: @rpath/libclntsh.dylib.19.1
Referenced from: /usr/local/Cellar/sqitch/v1.1.0/lib/perl5/darwin-thread-multi-2level/auto/DBD/Oracle/Oracle.bundle
Reason: image not found at /usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0/darwin-thread-multi-2level/DynaLoader.pm line 197.
at -e line 0.
Compilation failed in require.
BEGIN failed--compilation aborted.
The library can be found at /usr/local/oracle/product/19.8/instantclient/libclntsh.dylib.19.1
but for some reason DBD::Oracle
is not finding it there. This seems to be a problem with DBD::Oracle
but no idea how to proceed.
Got it working. Created a link in /usr/local/lib
and now it's working. Looks like DBD::Oracle
looks for libs on standard places and does not remember where the lib was when it got built. There seems to be an option to define DYLD_LIBRARY_PATH
and point it to extra places to look at. But according to the docs it does not get propagated to sub-shells so I'm not sure that could be used to improve Sqitch.
I guess not many use DBD::Oracle
in macOS.
cd /usr/local/lib
ln -s /usr/local/oracle/product/19.8/instantclient/libclntsh.dylib.19.1
Yeah, the only way I've found to get DYLD_LIBRARY_PATH
to work on Catalina and later is to disable SIP.
The interesting part here is that when compiling DBD::Oracle
actually uses $ORACLE_HOME
to look for the libs, shouldn't it also look at $ORACLE_HOME
at runtime?. Do you think this is something that could be requested from DBD::Oracle
?.
Sorry, I know this is not your domain.
Yeah, that's worth a try. You can post you request to the DBD::Oracle bug queue here or by emailing bug-DBD-Oracle@rt.cpan.org.
Thanks for the tip, turns out the venerable RT instance of CPAN is retiring. And the new issue tracker for this module is actually at Github. So I opened an issue at perl5-dbi/DBD-Oracle#128. Lets see if they can provide a better way. Meanwhile looks like the following also works without having to link anything.
export DYLD_LIBRARY_PATH=$ORACLE_HOME
perl -I/usr/local/Cellar/sqitch/v1.1.0/lib/perl5/darwin-thread-multi-2level -MDBD::Oracle -E 'say DBD::Oracle->VERSION'
Does not look like there is more that can be done on the Sqitch side to improve the user experience. I guess all things Oracle need to be ugly and uncomfortable. Otherwise it's just not Oracle 😂
Ah, glad you found the GitHub project for DBD::Oracle; I only found the RT, and also saw the retiring announcement, so went through my RT backlog and closed a few things in my own projects.
I guess all things Oracle need to be ugly and uncomfortable. Otherwise it's just not Oracle 😂
Ain't that the truth!
Hi,
Have a couple of projects with PostgreSQL without issues. Now trying to start an Oracle project but getting an error when deploying. Deploy command is like this.
Sqitch was installed with the following command and no errors were reported.
My
$ORACLE_HOME
points to/usr/local/oracle/product/19.8/instantclient
where I have the instant client version 19.8 which works fine at leastsqlplus
does. Looks like Sqitch is not finding the Oracle driver but the Perl module seems to correctly exists hereI also tried with other versions of the instant client, namely 11.2 and 12.2 with the same result. Am I missing something? Thanks in advance.