You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Maison Mo <mo...@yahoo.fr> on 2010/09/06 18:32:41 UTC

Backup : snapshot at beginning or mixed content ?

Hello dear derby developers,

I have a question about database backup.

According to admin guide, there are two methods for that operation :
1 - freeze the DB with SYSCS_UTIL.SYSCS_FREEZE_DATABASE and perform a (hopefully quick) external copy of database files ; then UNFREEZE
2 - Use SYSCS_UTIL.SYSCS_BACKUP_DATABASE(...)

I wonder what happens when commits are performed during the backup.
- With method 1 I expect the commits to hang until the unfreeze
- With method 2 what happens exactly ? Does the commit go into the backup ? Always ? Never ? Does it depends on the table(s) on which the commit is performed ?

My problem is the following : I need to backup 2 differents databases, that are linked with two different JEE applications. I can suspend these apps for a while, but not as long as the time required to perform the backup (several minutes).
It would be nice if I could suspend the apps for one second, start the backups, then release the apps and the backup would include only the commited record at the time the backup started.

Is that possible with derby ? If not, what kind of workaround could I use so that the databases remain coherent in between them ?

Thank you in advance for your answers.

  M. Maison





      

Re: Backup : snapshot at beginning or mixed content ?

Posted by Kathey Marsden <km...@sbcglobal.net>.
  On 9/6/2010 9:32 AM, Maison Mo wrote:
> Hello dear derby developers,
>
> I have a question about database backup.
>
> According to admin guide, there are two methods for that operation :
> 1 - freeze the DB with SYSCS_UTIL.SYSCS_FREEZE_DATABASE and perform a 
> (hopefully quick) external copy of database files ; then UNFREEZE
> 2 - Use SYSCS_UTIL.SYSCS_BACKUP_DATABASE(...)
>
> I wonder what happens when commits are performed during the backup.
> - With method 1 I expect the commits to hang until the unfreeze
> - With method 2 what happens exactly ? Does the commit go into the 
> backup ? Always ? Never ? Does it depends on the table(s) on which the 
> commit is performed ?
>
Assuming you are using a current version, I believe you are safe using 
online-backup which should not block which was introduced in 10.2[1].  
There are a few exceptions regarding  unlogged operations, see online 
backup documentation [2]:

Uncommitted transactions do not appear in the backed-up database and new 
commits that occur during the backup  will not appear in the backup.


Thanks Kathey
[1] https://issues.apache.org/jira/browse/DERBY-239
[2]http://db.apache.org/derby/docs/10.5/adminguide/cadminhubbkup01.html