http://qs321.pair.com?node_id=1172148

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

I am running Perl script on CentOS7, BerkeleyDB data is generated continuously, because of a sudden power failure, the database is damaged, I can not read any data, there are 52G data.

I try to fix it, but did not succeed, __db.001 , __db.002 , __db.003 have been removed in the repair process, please help me, what is the method to get the data?

Thank you!

Below this is the way to produce data:

...... sub DB{ $env=new BerkeleyDB::Env -Home=>$db_home, -Flags=>DB_CREATE|DB_INIT_MPOOL || die; $db=tie(%hash,"BerkeleyDB::Btree", -Filename=>$db_name, -Flags=>DB_CREATE, -Env=>$env) || die; } ......

The following is a reading method, but is no work

$|=1; use BerkeleyDB; my $env=new BerkeleyDB::Env -Home=>'/home/root/URL/DB' #-Flags=>DB_CREATE#|DB_INIT_MPOOL || die; my %hash; my $db=tie(%hash,"BerkeleyDB::Btree", -Filename=>'URL.db', # -Flags=>DB_CREATE, -Env=>$env) || die; while(my ($k,$v)=each %hash){ print "$k\t$v\n"; } untie $db;