Marc Dirix wrote:
The log records *EVERY* query which is executed.
Therefor you can restore an old backup, and redo every query until
time-point X
Every write query that is. MySQL logs all querys which did and might
have updated any data -- it even logs INSERTs which didn't match any
rows. So this can include OPTIMIZE and the like too, which you would not
want to run during recovery.
I think what Anne meant was something like this:
At 1 am a level 0 backup is created. Logs are running. At 4 am the
database is corrupted due to a bad query, but works on and gets new
inserts etc. At 9 am the corruption is discovered. Can one restore the
level zero from 1 am, then apply the logs until 4 am, skip the bad query
or whatever caused the corruption and then apply the logs from 4 am till
9 am?
In short, apply logs from level zero until now, except for the bad query
somewhere in the middle.
I've been lucky and have never had to restore from binary logs on a
production machine. I'd guess in such a case you'd first have to find
the offending query and then use --start/stop-position=N or
--start/stop-datetime=datetime to get the good queries.
So the answer would be would be YES then, one can restore all the good
changes. I'm pretty sure this is the case with PostgreSQL too.
Links to read:
http://dev.mysql.com/doc/refman/5.0/en/binary-log.html
http://dev.mysql.com/doc/refman/5.0/en/mysqlbinlog.html
http://dev.mysql.com/doc/refman/5.0/en/backup-strategy-example.html
HTH,
Alex
_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail