on 2010 Oct 07 3:40 PM
How many runs of 11.0.1.2472 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.
-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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
@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.
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.
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).
@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:)
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.
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.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
[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.
User | Count |
---|---|
66 | |
11 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.