FAQ

How do I fix database corruption?

FAQ ID:    FAQ415
Version:    29.0
Status:    Published
Published date:    08/31/2009
Updated:    11/25/2013
 

Answer

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 9.4.1.1?

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

   src/sg_logdb.cpp,413,GetLogTableCache

      worker_thread_00000b3c(2876),,

   database_07e0f450505c11de9858f0004c07d0fa failed to read pLogTable"

Answer

Steps to recover your database:

NOTE: With the release of version 9.3.x, 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, 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 the version 9.3.x code: For these databases, you will need to re-create  two empty folders inside the <database_UID> directory called "main" and "video".

 

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

 

'ITC:database_b8c2776097e911deb895f0004c7f7d18'

 

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.


Rate this Page

Please take a moment to complete this form to help us better serve you.

Did this document help answer your question?
 
 
If you are finished providing feedback, please click the RATE CONTENT button. Otherwise, please add more detail in the following text box and then click RATE CONTENT.
 
 

Your response will be used to improve our document content.

Ask a Question