24

Problem has appeared after DB restore. How I can repair DB?

Gengzu
  • 542
  • 1
  • 4
  • 13

3 Answers3

32

Gengzu, You probably moved the database between machines. In order to resolve the problem, you need to run:

 esentutl /d Data

From the RavenDB data directory

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • What is the issue here? Can this be automated? – TFD Aug 16 '12 at 12:32
  • You probably moved the db between machines – Ayende Rahien Aug 16 '12 at 14:08
  • 2
    Yes, so why does this require a manual step? What is esent/RavenDB tracking that is machine specific? What stops esent/RavenDB doing this step at startup? – TFD Aug 16 '12 at 21:12
  • TFD, it related to how the data is indexed with relation to your culture settings. We have a task to add it to RavenDB ops. – Ayende Rahien Aug 23 '12 at 05:52
  • 2
    Doesn't work for me. I get: Operation terminated with error -1032 (JET_errFileAccessDenied, Cannot access file, the file is locked or in use) after 20.31 seconds. – nathanchere Sep 11 '12 at 23:26
  • @FerretallicA - I've run into the same issue after upgrading my azure instance from 2008 SP2 to 2008 R2. Have you solved the JET_errFileAccessDenied problem? – Jakub Konecki Oct 27 '12 at 23:39
  • 1
    Didn't end up resolving it. It was a good push to look for alternatives where I found OrientDB which offers most of the benefits of RavenDB without any of the licensing catches. – nathanchere Oct 30 '12 at 00:17
  • 3
    Running "esentutl /d Data/Data" solved the -1032 error for me. Seems there is a file named "Data" inside of the directory named "Data" which is confusing things. – Ondrej Balas Dec 27 '12 at 23:35
  • 1
    This happened for me after updating from Windows 8 to 8.1, and running the command in this answer solved the problem. – Josh Gallagher Oct 19 '13 at 19:02
  • 1
    You need to do it for all databases in ravendb as well as for the system database – puco Oct 22 '13 at 14:54
  • You might need to do this from a command problem with elevated privileges, especially if you're getting the -1032 error. It fixed it for me. – Josh Aug 20 '14 at 18:48
4

You should run the util from inside that Data folder in Raven. When I ran it in the root of Raven server -> "Operation terminated with error -1032..." also showed up.

Anton
  • 326
  • 1
  • 7
4
  1. Open a command prompt as administrator

  2. Change directory to RavenDB's \Database\System folder

  3. Run the command below.

    esentutl /d Data

Karl Glennon
  • 3,149
  • 4
  • 29
  • 31
  • This was extremely useful - it's not obvious from any of the other answers from EXACTLY where to run this command – Niels Brinch May 28 '13 at 18:24
  • An important extra note. You may have to run this in your individual databases as well. RavenDB/Database/Databases/YourDatabaseName – Niels Brinch May 28 '13 at 18:45