How do I fix database corruption?

<< Back to Knowledge Search



Related Questions

NOTE: 9.4.2.x introduced a database recovery feature that is automatically started if Reporter crashes or is shutdown prior to fully unloading.  

How do I upgrade from 9.3.x to

My Database is corrupt, and I need to recover it.

How do I create a new database without deleting the old reports and database name?

Using Reporter 9.1.x, how do I re-use an old database configuration(s) by refreshing them with my saved access logs?

I have an error message “(Database Error)” on my Administration screen; how do I recover?

I am seeing this error in my journals, which I'm told is because my database is corrupt; How do I recover?

" BCRJ:2010-01-26 06:17:21 (4b5ecf41) ALW.ERRO.DATAB



   database_07e0f450505c11de9858f0004c07d0fa failed to read pLogTable"


Steps to recover your database:

NOTE: With the release of version 9.3.x and newer, two new folders were created that need to be preserved in this process. If you suspect your database may have been created, after the upgrade to 9.3.x or newer, please take note to keep these folders in step 3.

1: Find database

Find the database you need to delete, by going to administration > system overview and scrolling down to the bottom of this page.  Here you'll see a list of database names and they're corresponding folder names and locations. You should also click on the "log sources" links and note down where your logs are being read from.

If Reporter is not running, you can track the folder location down by navigating down to <root installed folder> /settings/databases/<database_UID>.cfg file, and opening it with a text editor.

In the above example message the hash name is highlighted in bold.

Edit this cfg file and find where the database is located.

Often, it's under the same parent root folder in <root installed folder>/databases.


2: Stop Reporter.

On Linux go to /etc/init.d/ and type bcreporter stop.

On Windows, load the services.msc utility, find bluecoat reporter 9 and click stop.


3: Go to the Database location you found in step one, and delete everything in this folder, but not the folder itself.

In Windows the command is 'del *.*'

In Linux the command is 'rm  -rf  * '

NOTE: For databases created with  version 9.3.x  and later code: For these databases, you will need to re-create  two empty folders inside the <database_UID> directory called "main" and "video"(must be lowercase even on Windows).


To verify if your database was created with version 9.3.x, follow these steps:

In the command line, navigate to the /settings/databases folder and open the relevant <database_UID>.cfg.

TIP:  Opening up each CFG file will show you the name you assigned it.

If your database was created by a version 9.3.x, it will say "V9_2", as per the example below.

The number 2 indicates a second generation database, not Reporter version 9.2.

database = {

    options = {

      database_type = "v9_2"

      database_directory = "C:/Program Files/Blue Coat Reporter 9/databases"

      archive_directory = "C:/Program Files/Blue Coat Reporter 9/archive"

      database_root_directory = ""


If your database was created by version 9.2.x, or 9.1.x, it will say "V9_1".

database = {

    options = {

      database_type = "v9_1"

      database_directory = "C:/Program Files/Blue Coat Reporter 9/databases"

      archive_directory = "C:/Program Files/Blue Coat Reporter 9/archive"

      database_root_directory = ""


In the command line, navigate to the /settings folder and open the relevant preferences.cfg file.

Change the “crash_count” and crash_time” values to look like below

crash_count = ""

crash_time = ""


4: Go the location for log source(s) and rename the log files from *.done to *.


On windows the command is "ren *.done *."

On Linux reporter provides a utility to use for this in the Reporter folder.  This file is called reset.done and should be executed inside the folder containing the access logs.

In case you can't find it, here is the one line expression you use- it's between the greater than and less than symbols. 

< for i in `ls | grep '\.done$'`; do mv $i `echo $i | sed -e 's/\.done$//g'`; done >

5: Restart Reporter and it should begin to process all these renamed logs back into the database.

NOTE1: This article assumes you are renaming your log files, once reporter has finished with them. If you are moving them, you need to move them back for Reporter to process them.

NOTE2:  This entry in the journals, or bcreporter.out file, indicates corruption in the ITC database:  Following the steps above should fix this.

 2009-12-01 10:51:50 (4b1549a6) ALW.ERRO.DBMGR src/sg_profile.cpp,1426, worker_thread_41e02960(1105209696),,


Error 9 loading database




NOTE3:  In some cases Reporter will not load, and it may not be as clear as the above message as to which database is corrupt.  There are two ways to troubleshoot this:


1: Open up each database configuration file and mark them with a status of "disable".


If Reporter is not already stopped, stop it.

Open each database configuration file, as discovered in step 1, in your favorite text editor.

Find this entry, and change it from enable to disable.

database_5a9f5020f0c411deb646f0004d14f6ed = {

  label = "myDatabase-name"

  type = "main"

  state = "enable"

  version = ""

  creation = "1261683689"

Restart Reporter, and all the databases you marked in this fashion should not load.

If you do this for each database, you will find out which database(s) are causing Reporter not to load.

2: Moving the database files to a temporary location to see if Reporter will load is the only way of finding out which database(s) is corrupt.


The databases are kept under the databases folder, under the root install folder of Reporter.  (Don’t confuse this location with the databases folder under the settings folder, where we keep the database configuration files)

Move all files under each database, but preserving the database folder name, and attempt to load Reporter. Make sure it loads without any database in tack, and then unload it.

Move each database back in one by one, while loading Reporter each time.

The database that causes Reporter to crash is database that is corrupt.

Additional Information
Bug Number
InQuira Doc IdFAQ415

Article Feedback

Hide Properties
First Published      10/01/2014
Last Modified      10/01/2014
Last Published      10/01/2014
Article Audience
Article Number      000010417
Was this helpful?
Previous MonthNext Month