User:PeteE > CheckDb

CheckDb

Overview

mindtouch.deki.checkdb.exe is a tool to check the integrity of a Deki database.  CheckDb runs a series of tests to verify the database table schema, indexes, character set, etc.  As Deki evolves, we will continue to add new tests to CheckDb.  CheckDb is an executable that can be run on it's own but each test is also an NUnit test which can be run from the NUnit GUI or console.

 

Configuration

CheckDb requires an xml configuration file named checkdb-config.xml to be located in the same directory as the mindtouch.deki.checkdb.exe binary.  Here is an example of the checkdb-config.xml

<config>
  <db-catalog>wikidb</db-catalog>
  <db-user>someuser</db-user>
  <db-password>somepassword</db-password>
  <db-options>pooling=true; Connection Timeout=5; Connection Lifetime=30; Protocol=socket; Min Pool Size=2; Max Pool Size=50; Connection Reset=false;character set=utf8;ProcedureCacheSize=25;Use Procedure Bodies=true;</db-options>
  <db-server>dekidev</db-server>
  <db-port>3306</db-port>
</config>

 

CheckDb also relies on an xml file (checkdb-schema.xml) which defines what the Deki database schema should look like.  This file is auto-generated based on a clean Deki installation and shouldn't need to be modified.

 

TODO: show how to run from nunit-gui or nunit-console

 

Tests

 

TestDbConnection

This tests verifies that you can connect to the database using the credentials specified in the checkdb-config.xml

 

CheckTablesExist

This tests verifies that each table in the checkdb-schema.xml file also exists in the wiki database.  Any additional tables that make exist in the wiki database that aren't in checkdb-schema.xml are ignored.

 

CheckColumns

This tests iterates over each table and checks the definition of the columns and indexes for each table.

 

CheckCatalogUtf8

This test verifies that the CHARACTER SET of the wiki database is utf8.

 

CheckHomePageExists

This tests verifies that the home page of the wiki exists. 

 

CheckParentPages

This tests checks each page in the pages table and checks for any orphaned pages.

Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08.2