Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB Java Edition version 3.3.75
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sleepycat.je.util
Class DbScavenger

    java.lang.Object
      com.sleepycat.je.util.DbDump
          com.sleepycat.je.util.DbScavenger

    public class DbScavenger

extends DbDump

Used to retrieve as much data as possible from a corrupted environment. This utility is meant to be used programmatically, and is the equivalent to the -R or -r options for `DbDump`.

To scavenge a database:

      DbScavenger scavenger =
          new DbScavenger(env, outputDirectory, , , );
      scavenger.dump();

The recovered databases will put placed in the outputDirectory with ".dump" file suffixes. The format of the .dump files will be suitable for use with DbLoad.

Field Summary

Fields inherited from class com.sleepycat.je.util.DbDump
`dbName, doAggressiveScavengerRun, doScavengerRun, env, envHome, formatUsingPrintable, outputDirectory, outputFile, verbose`

Constructor Summary
`DbScavenger(Environment env, String outputDirectory, boolean formatUsingPrintable, boolean doAggressiveScavengerRun, boolean verbose)` Create a DbScavenger object for a specific environment.

Method Summary
`void` | `dump()` Start the scavenger run.
`void` | `setDumpCorruptedBounds(boolean dumpCorruptedBounds)` Set to true if corrupted boundaries should be dumped out.

Methods inherited from class com.sleepycat.je.util.DbDump
`dumpOne, main, openEnv, parseArgs, printHeader, printUsage`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DbScavenger

    public DbScavenger(Environment env,
                       String outputDirectory,
                       boolean formatUsingPrintable,
                       boolean doAggressiveScavengerRun,
                       boolean verbose)

  Create a DbScavenger object for a specific environment.

  Parameters:
    `env` - The Environment containing the database to dump.
    `outputDirectory` - The directory to create the .dump files in.
    `formatUsingPrintable` - true if the dump should use printable characters.
    `doAggressiveScavengerRun` - true if true, then all data records are dumped, regardless of whether they are the latest version or not.
    `verbose` - true if status output should be written to System.out during scavenging.

Method Detail

### setDumpCorruptedBounds

    public void setDumpCorruptedBounds(boolean dumpCorruptedBounds)

  Set to true if corrupted boundaries should be dumped out.

### dump

    public void dump()
              throws IOException,
                     DatabaseException

  Start the scavenger run.

  Overrides:
    `dump` in class `DbDump`
  Throws:
    `DatabaseException` - if a failure occurs.
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB Java Edition version 3.3.75
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2004,2008 Oracle. All rights reserved.