How many runs of dbvalid.exe do I have to run, using which options, to perform the maximum amount of checking?

I am guessing two runs...

One run with the defaults (no -d -fx -i -s or -t)

One run with just -s

No runs with any of -d -fx -i or -t

Further guesswork: The first run validates everything except checksums, and the second run does that.

asked 07 Oct '10, 14:40

Breck%20Carter's gravatar image

Breck Carter
accept rate: 20%

edited 11 Oct '10, 07:59

Volker%20Barth's gravatar image

Volker Barth


I agree that the docs are somewhat irritating on this topic...I would suggest to include the information whether the default comprises any of the options (and whether any option includes another one, if that is the case).

(07 Oct '10, 15:07) Volker Barth

So it's not just me? <g>...

(07 Oct '10, 15:09) Breck Carter

-s causes a VALIDATE CHECKSUM to be executed which does a sequential scan of the entire database and validates the checksum on each page. If you're not using checksums on your pages, that's a lot of wasted work.

Checksums on pages are checked every time the page is read from disk so if you are doing a full validation (ie the default), you will generally visit every or very nearly every page anyways and doing a separate checksum validation should not be necessary.

permanent link

answered 07 Oct '10, 17:09

John%20Smirnios's gravatar image

John Smirnios
accept rate: 40%


But otherwise, I've got it right? Other than possibly some checking done by -s, the default does everything? Because the Help is NOT clear on that subject.

(07 Oct '10, 19:40) Breck Carter

A default invocation of dbvalid will execute a VALIDATE DATABASE as well as a VALIDATE TABLE for each table. From what I see in the v11 code, validating a table will also validate each index on the table. In v12, things are implemented very differently and it's more difficult for me to determine off-hand exactly what is being done. I can tell you that we erroneously left the EXPRESS CHECK syntax and options in v12 but they are ignored by the server since they are no longer needed. We do something much cooler instead. In short, yes, it would appear the dbvalid default is to do everything.

(08 Oct '10, 19:41) John Smirnios

@John: Thanks for the details! - But the mere fact you did check code of different versions seems to second Breck's point that the docs are not clear here. And don't get me wrong - I do not want to check the code myself. But I would prefer to know what kind of validation I should practise (based on different risk assumptions). In that respect, your statement that the V12 dbvalid default does "everything" (or "everything senseful"?) is very welcome.

(08 Oct '10, 21:07) Volker Barth

The documentation for dbvalid is lacking because it just uses a wordy description rather than either describing which SQL statements are executed or the exact behaviour directly. The description of the SQL statements isn't too bad but could be improved. For example, VALIDATE TABLE says that it does checksum verifications so that would mean that an extra checksum validation wouldn't be necessary; however, there's no real way to get to that info from the documentation of the dbvalid tool. Even if the doc were fine, I would have gone to the source to verify.

(10 Oct '10, 13:04) John Smirnios

So far, btw, I've only said that v12 is different and its exact semantics are harder to look up so I haven't done that yet. Still, the intention is that a default run of dbvalid should be sufficiently extensive test of database validity. Other options are largely for doing a subset of tests (only some tables, only some indexes, just page checksums, etc).

(10 Oct '10, 13:09) John Smirnios

@John: Thanks again! May we expect you to give a hint to the doc team to improve the wording for dbvalid when your code research is finished? That would be fine! - And I agree that a description of dbvalid based on the VALIDATE statements would make sense, and that the dbvalid default run (as you describe its intention) exactly fits my expectations - and the "Watcom does the things the way they should be done" paradigm:)

(10 Oct '10, 15:15) Volker Barth

Yes, I will be reviewing & revising the documentation for dbvalid and the VALIDATE statements. Of course, the doc team only updates documentation for unreleased versions so hopefully we can get the changes in place for 12.0.1.

(11 Oct '10, 19:16) John Smirnios
More comments hidden
showing 5 of 7 show all flat view

FWIW, based on this question, I have made two comments on DCX (for SA 12 docs) w.r.t. dbvalid and the VALIDATE statements with backlinks to this question.

And reading the VALIDATE statements docs I had two more questions (taken from my comment there):

My current questions focus on the 2nd sentence in the 2nd paragraph in the remarks section: It says that "VALIDATE DATABASE also performs a checksum validation". Does it mean VALIDATE DATABASE includes the VALIDATE CHECKSUM option, or is it a kind of simplified checksum validation?

Furthermore, it states that VALIDATE DATABASE does not "...check data correctness". Is there any VALIDATE statement that does exactly that?

(Sorry for including more questions instead of an answer but they seem to be all part of the same general question.)

permanent link

answered 11 Oct '10, 16:20

Volker%20Barth's gravatar image

Volker Barth
accept rate: 32%


VALIDATE DATABASE visits every page and performs some other sanity checks. By virtue of reading each page, checksums are verified. So, VALIDATE DATABASE is effectively a superset of VALIDATE CHECKSUM. FWIW, VALIDATE DATABASE does its work by hauling everything through the cache but VALIDATE CHECKSUM reads directly from the file. I'm not sure why -- not my code :)

What does it mean to "check data correctness"? That could mean many different things. If checksums are enabled, VALIDATE DATABASE does verify that data hasn't changed while it was out on disk. It doesn't verify that the page wasn't

(14 Oct '10, 20:12) John Smirnios

[I wish comments could be longer]...scribbled on prior to be written out last (in which case the checksum is computed after the corruption occurred). VALIDATE DATABASE also does not verify that the set of values indexed in each index matches the set of values in the base table. VALIDATE TABLE for each table accomplishes that last part.

(14 Oct '10, 20:17) John Smirnios

@John: Thanks again for taking the time to explore this issue - that answers my (and Breck's) questions.

(15 Oct '10, 08:00) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 07 Oct '10, 14:40

question was seen: 1,524 times

last updated: 11 Oct '10, 16:20