Based on that question, I would suggest that the validation of a database should check the signature string, too.

As John and Mark have explained in comments on this answer, some bytes in the first database page (the "signature") state whether the database file is valid or not.

Well, if the signature is invalid, validation of the database should give an error, too.

Nevertheless, the following statement running on my (not successfully upgraded) database (under returned no errors at all:

call dbo.sa_validate()

That just seems wrong.

Side effect: If it had given an error, the maintenance plan would not have overwritten a valid database backup.

asked 29 Jun '11, 04:39

Volker%20Barth's gravatar image

Volker Barth
accept rate: 32%

edited 29 Jun '11, 04:40

Seems to me a valuable enhancement

(29 Jun '11, 05:35) Martin

I don't think I have ever said this Volker, but I disagree with you in this case. In order for you to call dbo.sa_validate(), you need to be running the database. That means that the signature was valid at the time you started the database. The only way the signature can subsequently become invalid is through a failed upgrade as stated in my answer in your other post. So, while I agree that the enhancement you suggest might be worthwhile in some small way, I think it is better to enhance the documentation to state clearly that a failed upgrade will lead to an invalid database file and hence a backup is absolutely essential prior to starting the upgrade process.

permanent link

answered 29 Jun '11, 07:38

Karim%20Khamis's gravatar image

Karim Khamis
accept rate: 40%

"I don't think I have ever said this Volker" - that's alright with me:)

Well, if the only way a signature can become invalid is because of a failed upgrade, then I agree that the announced enhancement for an ALTER DATABASE restart warning would solve this issue better.

Nevertheless, I would naively expect that the validation of any database page (and isn't this what validation is for) would check for invalid contents. - Would validation notice when a page of a running database gets corrupted by a virus or the like? (I'm aware that the database files are opened exclusively by the database engine - but I could imagine that malicious programs might be able to overcome that protection.)

(29 Jun '11, 07:57) Volker Barth
Replies hidden

Fair enough Volker. I have opened an enhancement request to have validate database verify the database signature.

(29 Jun '11, 08:13) Karim Khamis
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: 29 Jun '11, 04:39

question was seen: 736 times

last updated: 29 Jun '11, 08:13