Using OnSQL event for logging as backup/recover
Posted: Wed 20 Aug 2014 20:39
Hi,
I want to use TCustomDASQLMonitor.OnSQL event for logging all INSERT, UPDATE and DELETE events. That's no problem.
But is there a simple way, using the logged sql statements for recovering after DB-failure?
At the beginning of a day I will make a backup of my DB-file.
Then I'm logging all sql statements (INSERT, UPDATE and DELETE).
If I have a DB-failure (e.g. disk crash), then I only have to copy the DB-backup from the morning and can recover the actual DB-state by executing the logged sql statements again.
Do you know a simple kind of executing the sql statements from logging?
Example:
update "TEST" set
"Testvalue" = :1
where
"Test_Id" = :2
:1(Integer,IN)=999
:2(Integer,IN)=1
Best regards
Rolf
I want to use TCustomDASQLMonitor.OnSQL event for logging all INSERT, UPDATE and DELETE events. That's no problem.
But is there a simple way, using the logged sql statements for recovering after DB-failure?
At the beginning of a day I will make a backup of my DB-file.
Then I'm logging all sql statements (INSERT, UPDATE and DELETE).
If I have a DB-failure (e.g. disk crash), then I only have to copy the DB-backup from the morning and can recover the actual DB-state by executing the logged sql statements again.
Do you know a simple kind of executing the sql statements from logging?
Example:
update "TEST" set
"Testvalue" = :1
where
"Test_Id" = :2
:1(Integer,IN)=999
:2(Integer,IN)=1
Best regards
Rolf