2 Replies Latest reply: Oct 13, 2011 5:51 PM by 610797 RSS

    Problems reading earlier database

    610797
      The server I have been running a Perl script on has recently upgraded the version of Perl they are using from 5.8 to 5.10. My script uses the perl DB_File module to write some Berkeley DB databases and I now find that I can't read these databases. I see that the version of Berkeley DB that the Perl module is now linking to is 4.7.25 while previously it was much earlier, probably version 1 or 2.

      Can someone please confirm that the way that the data is stored has changed sometime between these earlier versions and this new one so that this will account for my problem?
        • 1. Re: Problems reading earlier database
          "Oracle, Sandra Whitman-Oracle"
          Hello,

          The, "Berkeley DB Upgrade Guide" at:
          http://download.oracle.com/docs/cd/E17076_02/html/upgrading/index.html
          should contain the information you are looking for.

          I went through and checked the section on:
          Database or Log File On-Disk Format Changes
          for releases from 4.1 to 4.7.25.

          I am not sure what problem you are experiencing, but the log file
          format changed from 4.1 to 4.7.25. Regarding database format changes:

          Upgrading from 4.5 to 4.6 there
          was a fully compatible database change:
          The format of Hash database pages was changed in the Berkeley DB 4.6 release, and items are now stored in sorted order. The format changes are entirely backward-compatible, and no database upgrades are needed. However, upgrading existing databases can offer significant performance improvements. Note that databases created using the 4.6 release may not be usable with earlier Berkeley DB releases.

          And going from 4.1 to 4.2 there was an incompatible database format change:
          Queue databases that use encryption or data checksum features with extent files will need to be dumped and reloaded prior to using with release 4.2. For more details, see Queue access method. [#8671]

          Thanks,
          Sandra
          • 2. Re: Problems reading earlier database
            610797
            Hello Sandra

            Many thanks for this. I've been doing further testing which confirms that the Berkeley DB files produced using Perl 5.8 and an earlier version of the Berkeley DB engine can't be read with Perl 5.10 using that 4.7 version of the engine, and vice versa. I can't now find out which version of the Berkeley DB engine was used with Perl 5.8 although I know that some versions of Perl 5.8 used version 1! I've checked the details of the upgrade from Perl 5.8 to 5.10 and there's no mention that there are backward compatibility problems.

            I don't think the Perl interface will use any fancy methods in using Berkeley DB so I doubt the incompatibility change going from 4.1 to 4.2 would be a problem. I see that with the change from 4.5 to 4.6 a database using the latter may not be usable by earlier versions although it suggests that the reverse is not the case. Perhaps there was a compatibilty change prior to version 4 that is causing my problem - I'll just have to assume that some change has been made to the Berkeley DB engine at some time to cause this problem.

            Regards
            Eric