Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Berkeley newbie question - cannot tie database

702152May 21 2009
I'm trying to tie a V3 Berkeley DB loaded from a V3 text export using the v4. db_load utility. When I do a db_dump it lists the version as 3 and the database dumps fine
I have the perl libraries for Berekeley v4.

I have tried the following two methods of tying w/ no luck:
#####################################
#!/usr/bin/perl
use BerkeleyDB::Hash;

my %hash;
tie %hash, 'BerkeleyDB::Hash', -Filename => $ARGV[0]
or die "can't read file '$ARGV[0]': $!";
print map { " $_ => $hash{$_}\n" } sort keys %hash;
#####################################
which gets :Bad File Descriptor
and

#####################################
use DBI;
use DB_File;

my $dbmfile="mydb.db";
use BerkeleyDB;

#0444

$DB = tie %DB, 'DB_File', $dbmfile, O_RDONLY, 0444, $DB_File::DB_HASH
|| die "Can't tie $dbmfile: $!\n";

#####################################
which gets "Can't read file 'mydb.db'

Any pointers would be appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2009
Added on May 21 2009
0 comments
1,162 views