1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
# -*- Mode: Perl -*- |
# -*- Mode: Perl -*- |
3 |
# $Basename$ |
# $Basename$ |
4 |
# $Revision: 1.4 $ |
# $Revision: 1.5 $ |
5 |
# Author : Ulrich Pfeifer |
# Author : Ulrich Pfeifer |
6 |
# Created On : Mon Dec 31 13:57:11 2001 |
# Created On : Mon Dec 31 13:57:11 2001 |
7 |
# Last Modified By: Ulrich Pfeifer |
# Last Modified By: Ulrich Pfeifer |
26 |
|
|
27 |
$DB_BTREE->{'cachesize'} = 200_000 ; |
$DB_BTREE->{'cachesize'} = 200_000 ; |
28 |
|
|
29 |
my %OPT = (clean => 0, |
my %OPT = ( |
30 |
database => 'DB', |
database => 'DB', |
31 |
dir => $WAIT::Config->{WAIT_home} || '/tmp', |
dir => $WAIT::Config->{WAIT_home} || '/tmp', |
32 |
table => 'ora', |
table => 'ora', |
33 |
); |
); |
34 |
|
|
35 |
GetOptions(\%OPT, |
GetOptions(\%OPT, |
|
'clean!', |
|
36 |
'database=s', |
'database=s', |
37 |
'dir=s', |
'dir=s', |
38 |
'table=s', |
'table=s', |
39 |
) || die "Usage: ...\n"; |
) || die "Usage: ...\n"; |
40 |
|
|
|
if ($OPT{clean} and -d "$OPT{dir}/$OPT{database}") { |
|
|
my $tmp = WAIT::Database->open(name => $OPT{database}, |
|
|
'directory' => $OPT{dir}) |
|
|
or die "Could not open table $OPT{table}: $@\n"; |
|
|
my $tbl = $tmp->table(name => $OPT{table}); |
|
|
$tbl->drop if $tbl; |
|
|
rmtree("$OPT{dir}/$OPT{database}/$OPT{table}", 1, 1) |
|
|
if -d "$OPT{dir}/$OPT{database}/$OPT{table}"; |
|
|
$tmp->close; |
|
|
} |
|
|
|
|
41 |
my $db; |
my $db; |
42 |
unless (-d "$OPT{dir}/$OPT{database}") { |
unless (-d "$OPT{dir}/$OPT{database}") { |
43 |
$db = WAIT::Database->create(name => $OPT{database}, |
$db = WAIT::Database->create(name => $OPT{database}, |
113 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
114 |
|
|
115 |
B<index_ora> |
B<index_ora> |
|
[B<-clean>] [B<-noclean>] |
|
116 |
[B<-database> I<dbname>] |
[B<-database> I<dbname>] |
117 |
[B<-dir> I<directory>] |
[B<-dir> I<directory>] |
118 |
[B<-table> I<table name>] |
[B<-table> I<table name>] |
124 |
|
|
125 |
=over 5 |
=over 5 |
126 |
|
|
|
=item B<-clean> / B<-noclean> |
|
|
|
|
|
Clean the table before indexing. Default is B<off>. |
|
|
|
|
127 |
=item B<-database> I<dbname> |
=item B<-database> I<dbname> |
128 |
|
|
129 |
Specify database name. Default is F<DB>. |
Specify database name. Default is F<DB>. |