You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
Home > DW Product Help > Software Applications > DW Spectrum IPVMS > Troubleshooting > Resolving Corrupted Database Index for DW Spectrum
Resolving Corrupted Database Index for DW Spectrum
print icon

Resolving Corrupted Database Index for DW Spectrum

-----------------------------------

Affected Roles:  Owner, Administrator

Related Digital Watchdog VMS Apps:  DW Spectrum IPVMS

Software Version:  DW Spectrum v5.0.0.35746

Last Edit:  September 6, 2024

-----------------------------------

 

Database Index Issues

If you have recently ran the Reindex Archive function but do not see the previously recorded footage available for viewing after the process has completed, it is possible that the database index has become corrupted.

This article will explain common signs of database corruption, the database file locations, as well as how to remove and replace corrupted database files with a new database index.

 

**NOTE:  Using the Reindex Archive function will not restore video archives or footage that has been manually deleted by a user or that has been automatically overwritten by the Server. Reindexing the database is for the purposes of restoring the relationship between the system database and the storage drives of the DW Spectrum Server.

**NOTE:  Deleting and creating a new database index can take anywhere from a few minutes to a whole day, depending on the amount of storage that is currently written to the archive.

 

Related Articles

 

Supported/Affected Devices

  • DW Blackjack® Server Series

 

Archive Storage Management

Before attempting to restore the database index, check the following:

  • Confirm that the video archive and file directories (folders) have not been renamed or moved from their default locations. Any changes to the active directory that the DW Spectrum Server program is writing to, without also matching the same changes in the Storage Settings of DW Spectrum, will interfere with the system’s ability to recognize the files and will cause an error.
  • Confirm that there is sufficient Reserved Space available for the storage drives of the DW Spectrum Server.

 

Common Circumstances/Causes of Database Corruption

There are some circumstances where a server’s database index is corrupted. Things that can lead to a database corruption include unforeseen operating system failure, hard drive failure, etc.

Some signs that may hint toward a database corruption can include:

  • Slow HDD/SDD reading and writing errors
  • Recent DW Spectrum video archive recordings are suddenly no longer accessible
  • Recording failures
  • DW Spectrum detecting drives as “inaccessible” or incorrectly identifying drives as “reserved”
  • Server failover issues
  • Time sync issues involving time/date stamps on recorded video footage
  • Unstable Network Communication to NAS devices.

 

In the event of such database index corruption issues, the database files will need to be removed from the hosting server and new database files will need to be created.

 

Database Index File Locations

The DW Spectrum database files are stored across ALL partition volumes that the DW Spectrum Server program detected as accessible during the initial system setup. This means that even if there are volumes that are not actively being used by DW Spectrum, the system will still create files within those volumes to communicate the current volume status to DW Spectrum.

These database files can be found on DW Blackjack Servers in the following locations:

 

Windows OS

  • Local Disk C:\DW Spectrum Media (OS volume)
  • Local Disk D|E|F|etc.:\DW Spectrum Media (media archive volume)
  • Local Disk Z:\DW Spectrum Media (recovery volume)

 

Ubuntu/Linux OS

  • /opt/digitalwatchdog/mediaserver/var/data (OS volume)
  • /home1|home2|home3|etc./DW\ Media \Server (all other volumes)

 

NAS Devices

If smb NAS (network active storage) devices are in use, you will need to access the file directory of the NAS volumes. The database on a DW-BJMAS files can be found in:

  • \\<IP_address>\Recording1
  • \\<IP_address>\Recording2

 

File Properties

The related files will end with .TMP and .NXDB for the indexing database. And object_detection.sqlite for analytic database information related to the database index.

In general, there will normally only be a single .TMP file and a single .NXDB file. An indication of a corrupted database index is when a file within the directory is “depreciated”.

However, if there are additional .TMP and .NXDB files present, this does not explicitly mean that the database is corrupted but it may still create issues for DW Spectrum’s ability to register the correct index properly.

 

Removing and Replacing the Database Index

Below are the instructions for creating a new database index for a DW Spectrum Server using a Windows OS or an Ubuntu Linux OS.

 

Windows OS Guide

To remove and replace the Database Index on a DW Spectrum Server machine using a Windows OS:

  1. Stop the DW Media Service.

Locate the Service Tray at the bottom-right corner of the Windows Taskbar then right-click on the DW icon and select “Stop Server”.

 

If the DW icon does not appear in the Service Tray, you can also open the Windows “Services application to stop the DW Media Server process.

 

  1.  After stopping the media server, use the Windows File Explorer and navigate to the file directory containing the database index (see Database Index File Locations section above).

In most circumstances, you may only need to remove the .TMP and .NXDB files. However, if you are experiencing issues with the DW Spectrum Object Detection analytics engine as well, remove the .SQLITE file too.  Additionally, there may be numerous .tmp and .nxdb files.  Remove all of the .tmp and .nxdb files present.

Repeat this step for ALL DW Spectrum Media volumes (C:/, D:/, E:/, etc.) on the server.

 

  1. After removing the files from ALL storage volumes, Start the DW Media Service again.

Locate the Service Tray at the bottom-right corner of the Windows Taskbar then right-click on the DW icon and select “Start Server”.

If the DW icon does not appear in the Service Tray, you can also open the Windows “Services application to start the DW Media Server process.

 

  1. After restarting the DW Media Service, launch the DW Spectrum Client and log in as the Owner (admin).

Right-click on the Server and open the “Server Settings” menu.

If the system has not already begun to do so, you can click the Reindex Archive button to manually have the system begin the reindexing process. Since there will be no existing database for the system to scan, DW Spectrum will begin to create a new one for the server. This can take anywhere from a few minutes to a whole day, depending on the amount of storage.

This completes the process for creating a new database index on a WinOS server.

 

Ubuntu Linux OS Guide

To remove and replace the Database Index on a DW Spectrum Server machine using an Ubuntu Linux OS:

  1. Simultaneously press the CTRL+ALT+T keys on the keyboard to open the Terminal application.

Log in as the superuser with the command:

sudo su

 

Enter the OS login credential for the superuser. The DW Blackjack default OS password is “Dw5pectrum”. The superuser password will be hidden as you enter it into the Terminal application.

 

  1. Stop the DW Media Server with the command:

service digitalwatchdog-mediaserver stop

 

  1. After stopping the DW Media Server, change from the home directory to the file directory with the DW Media Server with the command:

cd /opt/digitalwatchdog/mediaserver/var/data

 

  1. To list all the items in the selected directory, use the command:

ls

The database index files will be listed (.NXDB, .TMP).

 

  1. Delete both the .NXDB and .TMP database files as they appear in the list. Replace “%file_name%” with the file name in the command:

rm -rf %file_name%

            (For example:  rm -rf 3352c017-8cf0-41ad-581f-77e7c33ce02.tmp)

 

  1. Verify that the .NXDB and .TMP files have been removed by using the ls command again. The files should no longer appear in the list.  If there are multiple .tmp and .nxdb files, ensure that all are removed.

You will need to go through the additional file directories (home1, home2, etc.) after deleting the files.

Repeat Step 3 through Step 5 for all additional DW Media Server folders and delete the directory index files for ALL volumes.

To change to additional file directories (home1, home2, etc.), use the command below. Change out “home1” with the other file directory name(s) (home2, home3, etc.) as you progress through the additional volumes.

cd /home1\DW \Spectrum \Media

 

  1. After deleting the database index files from all directories, Start the DW Media Server service again. To start the service, use the command:

service digitalwatchdog-mediaserver start

 

  1. After restarting the DW Media Service, launch the DW Spectrum Client and log in as the Owner (admin).

Right-click on the Server and open the “Server Settings” menu.

If the system has not already begun to do so, you can click the Reindex Archive button to manually have the system begin the reindexing process. Since there will be no existing database for the system to scan, DW Spectrum will begin to create a new one for the server. This can take anywhere from a few minutes to a whole day, depending on the amount of storage.

This completes the process for creating a new database index on an Ubuntu Linux OS server.

 

 

 

 

For More Information or Technical Support

DW Technical Support:  866.446.3595

https://www.digital-watchdog.com/contact-tech-support/

______________________________________________________________________________

DW Sales:  866.446.3595                   [email protected]        www.digital-watchdog.com

scroll to top icon