Re: [sqlite] Backup API handling of corrupt source DB

2012-03-07 Thread Marcus Grimm

>>> You can do the backup and after that do an integrity check on the
>>> backup. Surely you're backing up on a different
>>> server, don't you? If the back up pass the integrity check it a real
>>> backup, if not, launch a warning.
>>
>> Yeah, that's a good idea.
>> Ohh boy, why I didn't think about that my self ? :-)
>
> In this process, you have to prevent that you overwrite your last
> "working" backup! Which database will you use, if you realize, that the
> backup is a corrupt database?

Yes, it creates a few backups over last N Days prior starting
to overwrite the oldest one.

It is not a embedded environment, so no problem.
I could create backups of a few month if necessary..

Thanks

Marcus

>
> On a webserver you should have enough space to make additional copies.
> In an embedded environment, this could be difficult.
>
> Thomas
>
>>
>> Thanks
>>
>> Marcus
>>
>>>
 Sure I could try to simulate that, but probably somebody here
 knows the answer.

 Thank you.

 Marcus
>>>
>>>
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Backup API handling of corrupt source DB

2012-03-07 Thread TeDe
Am 07.03.2012 13:21, schrieb Marcus Grimm:
>
> On 07.03.2012 13:13, Eduardo Morras wrote:
>> At 12:22 07/03/2012, you wrote:
>>> Dear list,
>>>
>>> I'm using the backup api to frequently backup
>>> a running sqlite database.
>>>
>>> I'm wondering if the backup API is able to detect a corrupt
>>> database or will it simply also backup a corrupt DB ?
>>>
>>> I evaluating the need to issue a (timeconsuming) "pragma
>>> integrity_check" prior
>>> running the backup to avoid that a backup will be overwritten
>>> with an invalid database.
>>
>> You can do the backup and after that do an integrity check on the
>> backup. Surely you're backing up on a different
>> server, don't you? If the back up pass the integrity check it a real
>> backup, if not, launch a warning.
>
> Yeah, that's a good idea.
> Ohh boy, why I didn't think about that my self ? :-)

In this process, you have to prevent that you overwrite your last
"working" backup! Which database will you use, if you realize, that the
backup is a corrupt database?

On a webserver you should have enough space to make additional copies.
In an embedded environment, this could be difficult.

Thomas

>
> Thanks
>
> Marcus
>
>>
>>> Sure I could try to simulate that, but probably somebody here
>>> knows the answer.
>>>
>>> Thank you.
>>>
>>> Marcus
>>
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Backup API handling of corrupt source DB

2012-03-07 Thread Marcus Grimm


On 07.03.2012 13:13, Eduardo Morras wrote:

At 12:22 07/03/2012, you wrote:

Dear list,

I'm using the backup api to frequently backup
a running sqlite database.

I'm wondering if the backup API is able to detect a corrupt
database or will it simply also backup a corrupt DB ?

I evaluating the need to issue a (timeconsuming) "pragma integrity_check" prior
running the backup to avoid that a backup will be overwritten
with an invalid database.


You can do the backup and after that do an integrity check on the backup. 
Surely you're backing up on a different
server, don't you? If the back up pass the integrity check it a real backup, if 
not, launch a warning.


Yeah, that's a good idea.
Ohh boy, why I didn't think about that my self ? :-)

Thanks

Marcus




Sure I could try to simulate that, but probably somebody here
knows the answer.

Thank you.

Marcus



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Backup API handling of corrupt source DB

2012-03-07 Thread Eduardo Morras

At 12:22 07/03/2012, you wrote:

Dear list,

I'm using the backup api to frequently backup
a running sqlite database.

I'm wondering if the backup API is able to detect a corrupt
database or will it simply also backup a corrupt DB ?

I evaluating the need to issue a (timeconsuming) "pragma 
integrity_check" prior

running the backup to avoid that a backup will be overwritten
with an invalid database.


You can do the backup and after that do an integrity check on the 
backup. Surely you're backing up on a different server, don't you? If 
the back up pass the integrity check it a real backup, if not, launch 
a warning.



Sure I could try to simulate that, but probably somebody here
knows the answer.

Thank you.

Marcus



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Backup API handling of corrupt source DB

2012-03-07 Thread Marcus Grimm


On 07.03.2012 12:53, Simon Slavin wrote:


On 7 Mar 2012, at 11:22am, Marcus Grimm  wrote:


I evaluating the need to issue a (timeconsuming) "pragma integrity_check" prior
running the backup to avoid that a backup will be overwritten
with an invalid database.


Did you know about



?  It misses out a check, but the check it misses out is for data which can be 
recovered simply by recreating corrupt indexes.


Yes, I'm aware about that check.



On the other hand, if you are using this as a warning system that corruption 
has occurred and therefore you may have faulty hardware, then the more thorough 
the check, the better.


Yes, it is just about safe design. I'm currently reviewing my implementation 
and thought
about the unlikely event of a DB corruption - In that case my current backup
mechanism will become easily useless, depending if the corruption is so
small that it is not detected during the normal program flow.
(The application is a server that runs for weeks)

However, it is so far a theoretical issue - we haven't yet seen any corruption
in the field. :-)

Thanks also to Dan for the clarification.

Kind regards

Marcus



Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Backup API handling of corrupt source DB

2012-03-07 Thread Simon Slavin

On 7 Mar 2012, at 11:22am, Marcus Grimm  wrote:

> I evaluating the need to issue a (timeconsuming) "pragma integrity_check" 
> prior
> running the backup to avoid that a backup will be overwritten
> with an invalid database.

Did you know about



?  It misses out a check, but the check it misses out is for data which can be 
recovered simply by recreating corrupt indexes.

On the other hand, if you are using this as a warning system that corruption 
has occurred and therefore you may have faulty hardware, then the more thorough 
the check, the better.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Backup API handling of corrupt source DB

2012-03-07 Thread Dan Kennedy

On 03/07/2012 06:22 PM, Marcus Grimm wrote:

Dear list,

I'm using the backup api to frequently backup
a running sqlite database.

I'm wondering if the backup API is able to detect a corrupt
database or will it simply also backup a corrupt DB ?


Backup just copies pages. It will not detect corruption.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Backup API handling of corrupt source DB

2012-03-07 Thread Marcus Grimm

Dear list,

I'm using the backup api to frequently backup
a running sqlite database.

I'm wondering if the backup API is able to detect a corrupt
database or will it simply also backup a corrupt DB ?

I evaluating the need to issue a (timeconsuming) "pragma integrity_check" prior
running the backup to avoid that a backup will be overwritten
with an invalid database.

Sure I could try to simulate that, but probably somebody here
knows the answer.

Thank you.

Marcus
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users