behaviour of ontape
Posted in 2006
The poster asked how ontape decides the point-in-time of a level-0 online backup, puzzled that the backup reported containing logical log n while log n was still being written, and whether he should force onmode -c / onmode -l first. Replies explained that ontape takes an "archive checkpoint" at the start of the archive; the archive reflects the storage spaces as of that checkpoint, and the listed log is simply the log active at that time (possibly only partially). Forcing a checkpoint/log switch beforehand is unnecessary. On restore, ontape says which log to roll forward from and locates the correct position within it using the archive checkpoint, so a log backup covering that log suffices. The poster confirmed this answered his question.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Backup & Restore, Server Administration, Logging & Checkpoints, Platform-Specific Issues, Versions, Editions & End-of-Life
Hi,
I've got a question regarding backing up with ontape.
Our database is not big. The idea is to have a nightly Level 0 backup to
STDIO. The procedure takes less than 13 minutes and results in a 18GB
file. This can be copied elsewhere later, without overloading the
informix database server etc.
Logical logging is enabled too, it backs up automatically to files. The
alarmprogram parameter is set to log_full.sh, which compresses the log
files etc. This works fine.
I've read the docs and came to the conclusion, that if I want a level
zero backup from THIS moment, I have to force a checkpoint (onmode -c)
and then advance the logfile (onmode -l). Then create the L0 backup,
which would include everything up to (and including) the logfile I just
backed up. At least that's what I thought.
I tried this in practice, but saw unexpected results.
$ onmode -c
$ onmode -l
$ ontape -v -s -L 0 -t STDIO
>/mnt/backup/db.kisise-L0-2006.10.15.ifxdump
2>/mnt/backup/db.kisise-L0-2006.10.15.log
The backup was successful and the logfile stated:
> This tape contains the following logical logs:
>
> 43931
>
> Program over.
The problem here is that logical log 43931 is still being written (see
it via ISA). When I issued the command onmode -l, it backed up 43930.
Soon 43931 would be backup up too. Now if I'd want to restore the Level
0 backup and logical log 43931, wouldn't it have partially duplicate data?
I'd understand if ontape would execute onmode -c and onmode -l for the
logical log 43931 itself and then claim, it contains it in the level
zero backup. But that's not the case either.
I guess the problem is, I don't really understand, up to which point
exactly a level zero backup is performed. I was not able to find
information on this in the Information Center nor via google.
Running IDS 10.00.UC4 on linux SLES9.
Hope somebody can explain the details,
Alex
Aleksander wrote:
> Hi,
>
> I've got a question regarding backing up with ontape.
>
> Our database is not big. The idea is to have a nightly Level 0 backup to
> STDIO. The procedure takes less than 13 minutes and results in a 18GB
> file. This can be copied elsewhere later, without overloading the
> informix database server etc.
>
> Logical logging is enabled too, it backs up automatically to files. The
> alarmprogram parameter is set to log_full.sh, which compresses the log
> files etc. This works fine.
>
> I've read the docs and came to the conclusion, that if I want a level
> zero backup from THIS moment, I have to force a checkpoint (onmode -c)
> and then advance the logfile (onmode -l). Then create the L0 backup,
> which would include everything up to (and including) the logfile I just
> backed up. At least that's what I thought.
>
> I tried this in practice, but saw unexpected results.
>
> $ onmode -c
> $ onmode -l
> $ ontape -v -s -L 0 -t STDIO
> >/mnt/backup/db.kisise-L0-2006.10.15.ifxdump
> 2>/mnt/backup/db.kisise-L0-2006.10.15.log>
> The backup was successful and the logfile stated:
>
> > This tape contains the following logical logs:
> >
> > 43931
> >
> > Program over.
>
> The problem here is that logical log 43931 is still being written (see
> it via ISA). When I issued the command onmode -l, it backed up 43930.
>
> Soon 43931 would be backup up too. Now if I'd want to restore the Level
> 0 backup and logical log 43931, wouldn't it have partially duplicate data?
>
> I'd understand if ontape would execute onmode -c and onmode -l for the
> logical log 43931 itself and then claim, it contains it in the level
> zero backup. But that's not the case either.
>
> I guess the problem is, I don't really understand, up to which point
> exactly a level zero backup is performed. I was not able to find
> information on this in the Information Center nor via google.
>
> Running IDS 10.00.UC4 on linux SLES9.
>
> Hope somebody can explain the details,
>
> Alex
An ontape Level 0 archive is backed up as at "the archive checkpoint",
which is the checkpoint taken at the start of the level 0 archive.
Level-0 Backups ... For online backups, the data on the backup tape reflects the contents of the storage spaces at the time the level-0 backup began. ..... http://publib.boulder.ibm.com/infocenter/idshelp/v10/topic/com.ibm.bar.doc/barmst279.htm
Hi,
Thanks for the replies, I'm not there yet though.
I failed to mention, that I will be doing online backups. Doesn't matter
much though.
>
http://publib.boulder.ibm.com/infocenter/idshelp/v10/topic/com.ibm.bar.doc/barmst279.htm
From the info center page:
"For online backups, the data on the backup tape reflects the contents
of the storage spaces at the time the level-0 backup began."
So it does a full checkpoint, as TBP mentioned?
And more:
"(The time the backup started could reflect the last checkpoint before
the backup started.)"
I don't get this one, what does this mean?
Anyhow, how can ontape claim that it contains logical log number n, when
n is still being written even after the backup has completed?
Alex
Aleksander wrote:
> Hi,
>
> Thanks for the replies, I'm not there yet though.
>
> I failed to mention, that I will be doing online backups. Doesn't matter
> much though.
>
> >
> http://publib.boulder.ibm.com/infocenter/idshelp/v10/topic/com.ibm.bar.doc/barmst279.htm
>
>
> From the info center page:
> "For online backups, the data on the backup tape reflects the contents
> of the storage spaces at the time the level-0 backup began."
>
> So it does a full checkpoint, as TBP mentioned?
>
...
11:34:30 Loading Module <SPLNULL>
11:34:31 Checkpoint Completed: duration was 0 seconds.=> The following is also known as an "Archive Checkpoint" - this will be the point in time from a level 0 restore with no logical
log restore <=
11:34:31 Checkpoint loguniq 622, logpos 0x1d1018, timestamp: 0x260b0a4
11:34:31 Maximum server connections 0
11:34:31 Level 0 Archive started on rootdbs, dbspace_blob1, dbspace_1, dbspace_2, dbspace_extra, dbspace_sblob1, dbspace_sblob2
11:34:35 Archive on rootdbs, dbspace_blob1, dbspace_1, dbspace_2, dbspace_extra, dbspace_sblob1, dbspace_sblob2 Completed.
> And more:
> "(The time the backup started could reflect the last checkpoint before
> the backup started.)"
>
> I don't get this one, what does this mean?
>
It is just "vague" and I would ignore it :)
>
> Anyhow, how can ontape claim that it contains logical log number n, when
> n is still being written even after the backup has completed?
>
>
What is on tape is the "logical log info that is required for an instance to be restored without performed a logical log tape
restore". It is basically the logical logs that were active through the level 0 archive.
This may not be the complete logical log, as you have seen.
> Alex
TBP (The Big Potato) wrote:
> 11:34:30 Loading Module <SPLNULL>
> 11:34:31 Checkpoint Completed: duration was 0 seconds. > => The following is also known as an "Archive Checkpoint" - this will
be the point in time from a level 0 restore with no logical
> log restore <=
> 11:34:31 Checkpoint loguniq 622, logpos 0x1d1018, timestamp: 0x260b0a4
>
> 11:34:31 Maximum server connections 0
> 11:34:31 Level 0 Archive started on rootdbs, dbspace_blob1,
dbspace_1, dbspace_2, dbspace_extra, dbspace_sblob1, dbspace_sblob2
> 11:34:35 Archive on rootdbs, dbspace_blob1, dbspace_1, dbspace_2,
dbspace_extra, dbspace_sblob1, dbspace_sblob2 Completed.
OK, so there's really no point in forcing a checkpoint nor advancing the
logfile before a level zero backup.
>> Anyhow, how can ontape claim that it contains logical log number n, when
>> n is still being written even after the backup has completed?
>>
>>
> What is on tape is the "logical log info that is required for an instance to be restored without performed a logical log tape
> restore". It is basically the logical logs that were active through the level 0 archive.
>
> This may not be the complete logical log, as you have seen.
Meaning, it contains only a part of the logical log "n"?
OK, level zero has the info, that logical log number "n" was written
during the backup process. Now I restore from level 0 and after that
logical log number "n".
So how does ontape during a restore, in such a case, know what data to
restore from logical log "n" and what was already restored from the
level 0 backup?
Or does it only contain the number "n" and no data?
Alex
Aleksander wrote:
> TBP (The Big Potato) wrote:
>
> > 11:34:30 Loading Module <SPLNULL>
> > 11:34:31 Checkpoint Completed: duration was 0 seconds.> > => The following is also known as an "Archive Checkpoint" - this will
> be the point in time from a level 0 restore with no logical
> > log restore <=
> > 11:34:31 Checkpoint loguniq 622, logpos 0x1d1018, timestamp: 0x260b0a4
> >
> > 11:34:31 Maximum server connections 0
> > 11:34:31 Level 0 Archive started on rootdbs, dbspace_blob1,
> dbspace_1, dbspace_2, dbspace_extra, dbspace_sblob1, dbspace_sblob2
> > 11:34:35 Archive on rootdbs, dbspace_blob1, dbspace_1, dbspace_2,
> dbspace_extra, dbspace_sblob1, dbspace_sblob2 Completed.>
> OK, so there's really no point in forcing a checkpoint nor advancing the
> logfile before a level zero backup.
>
>>> Anyhow, how can ontape claim that it contains logical log number n,
>>> when n is still being written even after the backup has completed?
>>>
>>>
>> What is on tape is the "logical log info that is required for an
>> instance to be restored without performed a logical log tape restore".
>> It is basically the logical logs that were active through the level 0
>> archive.
>>
>> This may not be the complete logical log, as you have seen.
>
>
> Meaning, it contains only a part of the logical log "n"?
>
> OK, level zero has the info, that logical log number "n" was written
> during the backup process. Now I restore from level 0 and after that
> logical log number "n".
>
> So how does ontape during a restore, in such a case, know what data to
> restore from logical log "n" and what was already restored from the
> level 0 backup?
>
> Or does it only contain the number "n" and no data?
>
> Alex
What are you trying to clarify here?
I take the following backup :
======================================================
> ontape -s -L 0
Please mount tape 1 on /tmp/tapedev and press Return to continue ...
10 percent done.
20 percent done.
30 percent done.
40 percent done.
100 percent done.
Please label this tape as number 1 in the arc tape sequence.
This tape contains the following logical logs:
622
Program over.
======================================================
I then move on a couple of logs, and then do a logical log backup using ontape -a :
=======================================================
> ontape -a
Performing automatic backup of logical logs.
Please mount tape 1 on /tmp/ltapedev and press Return to continue ...
Do you want to back up the current logical log? (y/n) n
Please label this tape as number 1 in the log tape sequence.
This tape contains the following logical logs:
620 - 623
Program over.
=======================================================
Now, when it comes to restore I either want to restore from the Level 0 backup without rolling forward my logical logs tapes :
=====================================================
ontape -r
...
(details of spaces)
...
Continue restore? (y/n)yDo you want to back up the logs? (y/n)n
Restore a level 1 archive (y/n) n
Do you want to restore log tapes? (y/n)n
/usr4/products/IDS/10.00.FC1/bin/onmode -sy
Program over.
=====================================================
which restores the instance to the Archive checkpoint taken at the begining of the level 0 archive.
OR
I want to restore from the Level 0 backup AND rollforward through some logical log tape(s) :
=====================================================
ontape -r
...
(details of spaces)
...
Continue restore? (y/n)yDo you want to back up the logs? (y/n)n
Restore a level 1 archive (y/n) n
Do you want to restore log tapes? (y/n)y
Roll forward should start with log number 622
Please mount tape 1 on /tmp/ltapedev and press Return to continue ...
Do you want to restore another log tape? (y/n)n
Program over.
======================================================
which restores to the end of the logical logs on the tape(s) provided
ALL logical logs will be backed up to LTAPEDEV - i.e. there are no "gaps" in the logical logs on LTAPEDEV.
Rolling forward after a level 0 restore using the logical log backup tapes will start at the Archive Checkpoint and go forward.
Any clearer??
TBP (The Big Potato) wrote:
> Any clearer??
I think so, when ontape -r asks for logical log 622, it's OK to give it
a file/tape containing logs from 620 to at least 622. So it's capable of
finding the correct starting point itself. Wherever it may be in 622,
cause it's marked by the "archive checkpoint" in the logical log too,
correct?
I was not sure of this and thought I had to provide a tape which starts
exactly at the point where archive point was taken.
Thanks a bunch,
Alex