vsdeepthi has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have a program that reads a very large data file from Berkeley DB which is mounted on a SAN Storage . This works perfectly fine on a solaris machine using perl5.6.0 version. However, the same program returns fewer values read from the same file on a linux machine. Is this a problem with the size of the data file? Any pointers to solve this mystery are welcome. Thanks, Shobha Deepthi

Replies are listed 'Best First'.
Re: Accessing BDB file fails on linux
by Corion (Patriarch) on Feb 21, 2011 at 11:55 UTC

    One thing that may come into play might be architecture differences, if you're using SPARC-solaris and x86-Linux, as the machines differ in endianness and I'm not sure whether BDB handles that. If it doesn't work around, then you have to convert the file one time from the old machine to the new machine.

      Actually on both machines the file loads properly and I can see all the keys as well. But on Linux when I try to access value for few keys it returns undef.
      
      
      
        Are either of the processes writing to the database or are they both just reading the database from the SAN drive?

        I'm not that familiar with the Perl API, but what do you mean when you say "When I try to access value for few keys it returns undef."

        BTW: Although Berkeley DB is endian-neutral in terms of it's internal data structures, it makes no attempt to interpret the data payload. Managing endian-ness changes is the responsibility of the embedding application.

Re: Accessing BDB file fails on linux
by Anonymous Monk on Feb 21, 2011 at 10:29 UTC
Re: Accessing BDB file fails on linux
by viveksnv (Sexton) on Feb 21, 2011 at 11:46 UTC
    Hi

    I guess, it may depends on SAN disk read/write (Solaris may able to read faster compare than Linux). Try with diagnostics in your program and also check with Linux strace command.

    Is there any major difference between those servers except OS flavor..like architecture, SAN connectivity...

      Solaris Machine:
      
      uname -a
      SunOS ddm-app-sj-prod 5.10 Generic_142900-12 sun4u sparc SUNW,Netra-T12
      
      
      Linux Machine:
      uname -a
      Linux sjc-lds-289 2.6.9-89.0.11.ELsmp #1 SMP Mon Aug 31 11:00:34 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
      
      Also, perl that Linux box using is perl5.6.1 whereas Solaris is using perl5.6.0. Is that something to consider?