Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

PAR+DBD::Oracle assistance

by Viko (Acolyte)
on Dec 16, 2008 at 18:52 UTC ( #730713=perlquestion: print w/replies, xml ) Need Help??
Viko has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I'm fiddling with PAR and got stuck on the following:

I'm working with 2 solaris boxes - one with Oracle 10 and one with Oracle 9. Since I want move a pp'd executable from one box to the other (don't want to worry about having identical env's), I thought of bundling Oracle libs into my PAR file like such:
pp -z 9 -v 3 -p -o MYBUNDLE.par \ -M MY_DBI_WRAPPER_MODULE \ -l \ -l \
However, when I run a script which does
I get the following error:
install_driver(Oracle) failed: Can't load '/var/tmp/par-myuser/cache-8 +e6048b78729baef2dc5e08b6cb2d6fbf6d79bf9/' for module DBD:: +Oracle: fatal: open failed: +No such file or directory at /path/to/perl/lib/5.10.0/sun4-solaris/Dy line 203. at /path/to/perl/lib/site_perl/5.10.0/PAR/ line 109 Compilation failed in require at (eval 27) line 3. Perhaps a required shared library or dll isn't installed where expecte +d at line 83
When I check in the /var/par-user/cache directory, I do see file there and has good permissions.

Any idea what I'm doing wrong or if what I want is at all possible?

Thanks in advance

Replies are listed 'Best First'.
Re: PAR+DBD::Oracle assistance
by almut (Canon) on Dec 16, 2008 at 22:15 UTC
    I do see file there and has good permissions.

    What the error message is trying to tell you is that can't be loaded because the shared library (that is linked against) is not found.

    Okay, just a guess... but Solaris' dynamic loader ( is special in that you can't modify LD_LIBRARY_PATH (required to find shared libs in non-standard locations) from within an already running program — due to caching at exec time.  (Also see %ENV and DBI, for example.)

    If I'm reading the PAR sources correctly, it does add its temp directory to LD_LIBRARY_PATH after unpacking, but AFAICT, it does not run the actual script via exec or system, but rather via do (which does not create a new process, so the above caching issue would apply). My assessment of the situation - based on quickly grepping through the sources - could be wrong, though...(!)

    Anyhow, a possible workaround that you could try is to re-exec your script, e.g.

    #!/usr/bin/perl BEGIN { unless ($ENV{DONE_RESTARTING_MYSELF}) { # avoid endless loop... $ENV{DONE_RESTARTING_MYSELF} = 1; exec $^X, $0, @ARGV; } } # ...

      I had seen the issue with solaris ENVs before and had found the solution here at PerlMonks. However, PAR does handle that part effectively - when running my script and printing $ENV{LD_LIBRARY_PATH}, I get the correct cache dir.

      What I did find out (thanks to the replies to my question) is that PAR isn't extracting and as is expected.

      Is this a bug, or am I doing something weird?

      Update: Looks like someone else already asked a similar question: I was expecting PAR to extract all files and file structure by itself...
        However, PAR does handle that part effectively - when running my script and printing $ENV{LD_LIBRARY_PATH}, I get the correct cache dir.

        The point I was trying to make is that even though PAR is setting LD_LIBRARY_PATH to the correct directory, the dynamic loader will ignore it. This is because - on Solaris - LD_LIBRARY_PATH is parsed only once at process startup, and PAR modifies it after that. This means that if the program later tries to dynamically load other libs at runtime via dlopen (as DynaLoader does) from that non-standard location, it won't work...  unless you re-exec the program to have LD_LIBRARY_PATH be re-read.

        But as it seems, you're not even at a point where this would matter :) — i.e. with and not having been extracted at all...  I'm afraid I can't help with the latter problem.

Re: PAR+DBD::Oracle assistance
by Corion (Pope) on Dec 16, 2008 at 21:55 UTC

    I don't "do" Oracle, but my guess is that has further external prerequisites (like the Oracle loadable libraries) which haven't been moved to the other machine. Also, you likely need to set $ENV{ORA_HOME} or whatever the Oracle environment variable is called.

      Thanks Corion, but my whole idea is to avoid having to have Oracle installed in the other machine altogether - or at least not having to have the same oracle envs. ldd put me on the right path though. :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://730713]
Approved by Paladin
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2018-05-26 22:21 GMT
Find Nodes?
    Voting Booth?