We use Sybase Anywhere 10 and schedule backups to take place using an event with: BACKUP DATABASE DIRECTORY 'D:\BACKUP' TRANSACTION LOG TRUNCATE WAIT AFTER END

At what point does the database get 'frozen' when creating the backup .db/.log?

For example if we trigger the backup at 00:00 and it takes 45 minutes to finish does the backup db/log contain everything up to 00:00 or 00:45? We have had various results when testing this and would like a more definitive answer.

We would like these backups to contain all transactions up to midnight since we use these backups to form our monthly financial databases for reporting so having extra transactions after midnight can cause balancing issues.


asked 09 Jul '12, 12:58

Matt's gravatar image

accept rate: 0%

The database file will be as of the start of the backup and the log will be as of the end of the backup. To get the database to be up-to-date as of the end of the backup, you must apply the log (using -a or similar switch) to the database file.

If you want to use a copy of the database file as it existed at the start of the backup, take a copy of the backup database file, move the log file out of the way (so that the database cannot access it -- or use dblog -t to change the log name) then start the database with '-f'. The server will start then shut itself down again. You can then start it again without '-f'. Note that once you do this sort of thing to a backup database file, it can no longer be used to restore your database in the event of a failure so be sure to use a copy of the backup database file.

permanent link

answered 09 Jul '12, 13:19

John%20Smirnios's gravatar image

John Smirnios
accept rate: 37%

Thanks for the speedy reply, this is exactly what I was looking for.

We are only looking to use these databases without the transaction log for static reporting only databases for weekly/monthly/yearly reporting.

(09 Jul '12, 16:28) Matt
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](http://url.com/ "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: 09 Jul '12, 12:58

question was seen: 1,603 times

last updated: 09 Jul '12, 16:28