http://www.perlmonks.org?node_id=935731


in reply to Re^3: Change in Berkeley DB in Perl 5.12?
in thread Change in Berkeley DB in Perl 5.12?

I saw your reply but I didn't now what you were suggesting. Can you please explain?
  • Comment on Re^4: Change in Berkeley DB in Perl 5.12?

Replies are listed 'Best First'.
Re^5: Change in Berkeley DB in Perl 5.12?
by Anonymous Monk on Nov 04, 2011 at 07:20 UTC

    I saw your reply but I didn't now what you were suggesting. Can you please explain

    I didn't make a suggestion :)

    I told you why your problem happens (Its the nature of the beast )

    and how to solve it ( You need to use db_stat db_verify db_dump db_upgrade)

    So when you encounter a problem after transferring a .db between machines, or upgrading ...

    The solution is to use one of the utilities provided for this purpose, db_stat, db_verify, db_dump, db_upgrade, ...

      Ah, I see, thanks.

      Unfortunately I am using one of 1&1's servers and have no access to these utilities which don't seem to be available from the DB_File module. There must be others in the same position as I am, who have no knowledge of how Berkeley DB works and who are just using DB_FIle to create hash database files. They would expect a Perl upgrade to be backwards compatible and won't understand why they can't now access their database files. I also thought that newer versions of the DB engine would also be backward compatible and did check the Oracle forum to see if there were any problems in this respect and there didn't seem to be. I did know that you can't transfer one of these database files from one computer to another but here they were on the same machine.

      There is no mention of possible problems in the DB_FIle CPAN page if the DB engine is upgraded and that this needs to be checked. This Perl module is only intended to be used for the facilities provided by Berekely DB version 1x and the ActiveState distribution of their ActivePerl only links DB_FIle to version 1 of the DB engine. It's unfortunate that the version of this Perl module that is installed from CPAN can't be adjusted so that it follows this practice.

        Unfortunately I am using one of 1&1's servers and have no access to these utilities which don't seem to be available from the DB_File module.

        Excuses excuses :) weak excuses :)

        There must be others in the same position as I am, who have no knowledge of how Berkeley DB works and who are just using DB_FIle to create hash database files.

        Yes, ignorance is default state :)

        They would expect a Perl upgrade to be backwards compatible and won't understand why they can't now access their database files.

        Unless your ticket promises a free lunch , its naive to expect a free lunch -- applies to transportation and computers :)

        Truism of computer software, before deploying upgrade, check Changelog, run your test suite (verify assumptions/contract), verify your backups

        I also thought that newer versions of the DB engine would also be backward compatible and did check the Oracle forum to see if there were any problems in this respect and there didn't seem to be.

        AFAIK, the db utilities are the backwards compatibility layer

        I did know that you can't transfer one of these database files from one computer to another

        <raiseEyebrow>How did you learn that exactly, intuition?</raiseEyebrow>

        :D

        ...but here they were on the same machine. There is no mention of possible problems in the DB_FIle CPAN page if the DB engine is upgraded and that this needs to be checked.

        I think this qualifies http://search.cpan.org/dist/DB_File/DB_File.pm#Using_DB_File_with_Berkeley_DB_version_2_or_greater

        Note: The database file format has changed multiple times in Berkeley DB version 2, 3 and 4. If you cannot recreate your databases, you must dump any existing databases with either the db_dump or the db_dump185 utility that comes with Berkeley DB. Once you have rebuilt DB_File to use Berkeley DB version 2 or greater, your databases can be recreated using db_load. Refer to the Berkeley DB documentation for further details.

         

        This Perl module is only intended to be used for the facilities provided by Berekely DB version 1x and the ActiveState distribution of their ActivePerl only links DB_FIle to version 1 of the DB engine.

        How did you reach that conclusion?

        For example, DB_File typically isn't available on win32 by default (since libdb isn't), this is also true for ActivePerl-5.14.2.1402-MSWin32-x86-295342

        It's unfortunate that the version of this Perl module that is installed from CPAN can't be adjusted so that it follows this practice.

        I doubt such a practice exists :)

        If you wish to link to a particular version of lidbd, like say http://www.cpan.org/src/misc/db.1.86.tar.gz, all you have to do is install it, and tell Makefile.PL to link to it (maybe edit http://cpansearch.perl.org/src/PMQS/DB_File-1.824/config.in)

        No, I'm not the Grinch