> -----Original Message-----
> From: Elias Martenson [mailto:[EMAIL PROTECTED]]
> Sent: Freitag, 20. Dezember 2002 22:19
> To: [EMAIL PROTECTED]
> Subject: Full and log backup routines
> 
> 
> I'm trying to understand how to set up the backup routines in 
> order to 
> be completely safe.
> 
> As far as I can understand from reading the manuals, a full (not 
> checkpointed) backup is not guaranteed to be useful in restoring the 
> database. You always need at least one log backup taken after 
> the full 
> backup was finished. This is all good, so I decided to set up 
> the backup 
> routines so that a log backup was always made right after the full 
> backup and this log backup will them also be backed up to tape. This 
> should guarantee that I could always go back to the last 
> nightly backup, 
> in case disaste strikes and all my disks are wiped.
> 
> Now for my problem. It appears that you can't take a log 
> backup unless 
> you have at least one full page of data in the log. That 
> means, that if 
> I have an empty log, take a full backup, and then try to take a log 
> backup, the log backup will fail.
> 
> In this particular situation, all will be well though because 
> since no 
> transaction happened during the full backup, this backup will 
> be consistent.
> 
> However, since at least one page (8 kB?) of data needs to be 
> in the log 
> for the log backup to work, there is the potential for a 
> situation where 
> a very small transaction occurs during the full backup, thus 
> rendering 
> the full backup inconsistent, but the transaction was small enough to 
> prevent a log backup from being taken. In this situation I 
> will not be 
> able to recover using my nightly backup.
> 
> Is my understanding of the situation correct? (hopefully I'm 
> wrong) and 
> in that case, how is this supposed to work?

Hi,

first of all: Your're right that the last page of the Log-Device is
not saved, because it is in access by the log-writer. Due to the fact
that you are saving log in the db-mode warm, one cannot assure that
nobody is writing on the log (i.e. no open transaction modifies some
data). If you want to assure this, then you have to make a complete
backup with checkpoint, because there are no open transactions in such
a backup.

If you are making a backup for recovery (with a savepoint), then
you may need log-pages for recovery. Because there may be open 
transactions in the data-backup, you need the information for 
rolling them back/forward in order to reach a consistent state
(This is true only for Versions < 7.4; For 7.4 there is always 
a data-backup sufficient to reach a consistent state).

If you have a look into the backup-history, you will see if there is
a log-backup also needed for restart. If it is, you have to supply it.

The proper way to recover in the situation you described is to use 
the data-backup of the previous night together with the log-backup 
since then. So the only data you are potentially losing are 
transactions whose commit-entries are located on the last page 
of the log.


regards, Martin

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to