com.sleepycat.je.util
Class DbVerify

java.lang.Object
  extended by com.sleepycat.je.util.DbVerify
Direct Known Subclasses:
DbStat

public class DbVerify
extends Object

Verifies the internal structures of a database.

To verify a database and write the errors to stream:

    DbVerify verifier = new DbVerify(env, dbName, quiet);
    verifier.verify();
 


Field Summary
(package private)  boolean checkLsns
           
(package private)  String dbName
           
(package private)  Environment env
           
(package private)  File envHome
           
(package private)  boolean openReadOnly
           
(package private)  boolean quiet
           
 
Constructor Summary
DbVerify()
           
DbVerify(Environment env, String dbName, boolean quiet)
          Creates a DbVerify object for a specific environment and database.
 
Method Summary
(package private)  void closeEnv()
           
static void main(String[] argv)
          The main used by the DbVerify utility.
(package private)  void openEnv()
           
(package private)  void parseArgs(String[] argv)
           
(package private)  void printUsage(String msg)
           
 boolean verify(PrintStream out)
          Verifies a database and write errors found to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

envHome

File envHome

env

Environment env

dbName

String dbName

quiet

boolean quiet

checkLsns

boolean checkLsns

openReadOnly

boolean openReadOnly
Constructor Detail

DbVerify

DbVerify()

DbVerify

public DbVerify(Environment env,
                String dbName,
                boolean quiet)
Creates a DbVerify object for a specific environment and database.

Parameters:
env - The Environment containing the database to verify.
dbName - The name of the database to verify.
quiet - true if the verification should not produce errors to the output stream
Method Detail

main

public static void main(String[] argv)
                 throws DatabaseException
The main used by the DbVerify utility.

Parameters:
argv - The arguments accepted by the DbVerify utility.
 usage: java { com.sleepycat.je.util.DbVerify | -jar
 je-<version>.jar DbVerify }
             [-q] [-V] -s database -h dbEnvHome [-v progressInterval]
 

-V - show the version of the JE library.
-s - specify the database to verify
-h - specify the environment directory
-q - work quietly and don't display errors
-v - report intermediate statistics every progressInterval Leaf Nodes

Throws:
EnvironmentFailureException - if an unexpected, internal or environment-wide failure occurs.
DatabaseException

printUsage

void printUsage(String msg)

parseArgs

void parseArgs(String[] argv)

openEnv

void openEnv()
       throws Exception
Throws:
Exception

closeEnv

void closeEnv()

verify

public boolean verify(PrintStream out)
               throws DatabaseException
Verifies a database and write errors found to a stream.

Parameters:
out - The stream to write errors to.
Returns:
true if the verification found no errors.
Throws:
DatabaseException


Copyright (c) 2004-2010 Oracle. All rights reserved.