Informix backup question
Posted in 2016
User asked three questions about Informix backup behavior: (1) Does a backup started at 3 AM include only transactions before 3 AM? (2) Where are dirty pages flushed during backup when new transactions occur? (3) Can a backup spanning 3-7 AM be used to restore point-in-time at 4 AM?
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Storage & Space Management, Logging & Checkpoints
Question 1: when IDS start to do a backup on 3 AM , Do the backup only include those transaction data before 3 AM? Queston 2: When IDS is doing the backup ? there are still some new transactions,when do the checkpoint,where those dirty page will be flushed to ? Is it temporary dbspace? Question 3: If IDS start to do a backup on 3 AM , and finish the backup on 7 AM in the same day, could I use this backup image to restore the PIT 4 AM instead of to use yesterday backup and logical log? thanks for your time.
There is an in-depth discussion of backups and how they work in my book = (shameless self-promoting advertisement) =E2=80=9CAdministering Informix = Dynamic Server, Building the Foundation=E2=80=9D available at Amazon and = other fine booksellers. Short answers 1. yes 2 checkpoint occurs as backup starts and data is flushed to disk 3 No, backup is set to the backup timestamp which in this case is 3 am. = You can use backed logical logs to =E2=80=9Croll forward=E2=80=9D to a = more current moment in time though. Carlton ------------------------------------------------- Carlton Doe Flower Mound, TX No trees were killed in the transmission of this email, however a large = number of electrons were temporarily inconvenienced.=20 > On Sep 7, 2016, at 9:38 AM, CHUAN LU <luchuan@cn.ibm.com> wrote: >=20 > Question 1:=20 > when IDS start to do a backup on 3 AM , Do the backup only include = those=20 > transaction data before 3 AM?=20 >=20 > Queston 2:=20 > When IDS is doing the backup ? there are still some new = transactions,when do=20 > the checkpoint,where those dirty page will be flushed to ? Is it = temporary=20 > dbspace?=20 >=20 > Question 3:=20 > If IDS start to do a backup on 3 AM , and finish the backup on 7 AM in = the=20 > same day, could I use this backup image to restore the PIT 4 AM = instead of to=20 > use yesterday backup and logical log?=20 >=20 > thanks for your time.=20 >=20 >=20 > = **************************************************************************= *****=20 > Forum Note: Use "Reply" to post a response in the discussion forum.=20= >=20
There is a checkpoint performed at the start of the backup. Any transaction begun after that checkpoint will not be contained in the archive. Only the before image of a page that is modified by any transaction while the archive is in progress is included in the archive. The after image is not included. Because we only archive the before image of the page while the archive is underway, the dirty page can be flushed to the place that it would normally be flushed. We only archive the before image of the page once. When you restore the archive, you have the option to not apply any logical logs. If you do that, then the system will perform a logical recovery based on the restored log files and the checkpoint that was performed at the start of the archive. So - yes, you could restore as of the time of the archive checkpoint. Madison Pruet Retired and Loving it On Wednesday, September 7, 2016 9:38 AM, CHUAN LU <luchuan@cn.ibm.com> wrote: Question 1: when IDS start to do a backup on 3 AM , Do the backup only include those transaction data before 3 AM? Queston 2: When IDS is doing the backup ? there are still some new transactions,when do the checkpoint,where those dirty page will be flushed to ? Is it temporary dbspace? Question 3: If IDS start to do a backup on 3 AM , and finish the backup on 7 AM in the same day, could I use this backup image to restore the PIT 4 AM instead of to use yesterday backup and logical log? thanks for your time. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
See my responses below:
Art
Art S. Kagel, President and Principal Consultant
ASK Database Management
www.askdbmgt.com
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on the IIUG, nor any other organization with which I am
associated either explicitly, implicitly, or by inference. Neither do
those opinions reflect those of other individuals affiliated with any
entity with which I am affiliated nor those of the entities themselves.
On Wed, Sep 7, 2016 at 10:38 AM, CHUAN LU <luchuan@cn.ibm.com> wrote:
> Question 1:
> when IDS start to do a backup on 3 AM , Do the backup only include those
> transaction data before 3 AM?
>
Yes. Archives are "as of" the checkpoint taken at the start time of the
archive which is a few seconds after beginning the ontape/onbar execution.
>
> Queston 2:
> When IDS is doing the backup ? there are still some new transactions,when
> do
> the checkpoint,where those dirty page will be flushed to ? Is it temporary
> dbspace?
>
All transactions continue normally during an Informix archive. Informix
invented a unique way to perform a consistent archive while the server is
being actively updated live. Informix 4.00 was the first database engine
that could be successfully archived without taking it offline which led to
the version v4.xx & v5.xx releases being dubbed "Informix Online Server".
Informix copies all chunks to the archive in dbspace and chunk order while
saving the physical log records written after the initial checkpoint in
temp tables (one per dbspace). Those chunk pages might contain pages
modified after the archive began due to LRU flushing and checkpoints that
happened after the archive began. However, after each dbspace has been
completely copied to the archive the temp table containing the original
images of pages from that dbspace that were modified during the archive are
written to the archive and the temp table is dropped. During a restore
these pre-images are restored overwriting any modified pages that might
have been written to disk during the archive with the version of the page
that existed at the moment the archive began.
>
> Question 3:
> If IDS start to do a backup on 3 AM , and finish the backup on 7 AM in the
> same day, could I use this backup image to restore the PIT 4 AM instead of
> to
> use yesterday backup and logical log?
>
Yes with reservations. If you used onbar to archive the server and the
logical logs then you can use onbar to perform a point-in-time restore to
any moment after the start time of the archive to the nearest second. If
you used ontape for the archive and backed up the logical logs using ontape
-a then you can restore the server and stop rolling forward logical logs to
a resolution of any single logical log archive file which might get you a
restore to a point close to 4AM but not exactly. (If you backed up the
logical logs using ontape -c then there will be multiple logical logs
archived to a single large file so the logical log roll forward will not
stop at a particular logical log but only at the end of the file.) If you
archive the server using onbar but the logical logs using ontape, your
options are similar to having archived with ontape (you would perform a
physical restore using onbar then a logical log restore/roll forward using
ontape) just more complicated.
>
> thanks for your time.
>
>
> ************************************************************
> *******************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--001a11443350c0ba93053bec670e
Sorry - misread your question about PIT. If you want to restore to a time AFTER the archive checkpoint, then you must apply the logical logs created after the archive checkpoint. I thought you were wanting to do a restore to the archive checkpoint time. Madison Pruet Retired and Loving it On Wednesday, September 7, 2016 10:09 AM, Madison Pruet <madison_pruet@yahoo.com> wrote: There is a checkpoint performed at the start of the backup. Any transaction begun after that checkpoint will not be contained in the archive. Only the before image of a page that is modified by any transaction while the archive is in progress is included in the archive. The after image is not included. Because we only archive the before image of the page while the archive is underway, the dirty page can be flushed to the place that it would normally be flushed. We only archive the before image of the page once. When you restore the archive, you have the option to not apply any logical logs. If you do that, then the system will perform a logical recovery based on the restored log files and the checkpoint that was performed at the start of the archive. So - yes, you could restore as of the time of the archive checkpoint. Madison Pruet Retired and Loving it On Wednesday, September 7, 2016 9:38 AM, CHUAN LU <luchuan@cn.ibm.com> wrote: Question 1: when IDS start to do a backup on 3 AM , Do the backup only include those transaction data before 3 AM? Queston 2: When IDS is doing the backup ? there are still some new transactions,when do the checkpoint,where those dirty page will be flushed to ? Is it temporary dbspace? Question 3: If IDS start to do a backup on 3 AM , and finish the backup on 7 AM in the same day, could I use this backup image to restore the PIT 4 AM instead of to use yesterday backup and logical log? thanks for your time. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
You already recieved two different answers... let's go for the third:
I don't thisnk we can answer this simply.... You can do the backup in three
ways:
1) Ontape. In that case the backup image for all the dbspaces is exactly
how it was at 3AM
2) Onbar whole system backup. Similar to ontape, but can be run in paralell
3) Onbar non-whole system backup. In this case the physical image of
different dbspaces will have different timestamps. As such if the PIT you
want is later thant the start of the last dbspace then you should be able
to restore the PIT with this image. Otherwise you won't.
When you request the PIT onbar will "see which image it needs. As long as
you still have it, you don't need to worry about it. But it's good to
understand the process because the time will be different (depending on how
many logs you have to apply)
HTH
On Wed, Sep 7, 2016 at 4:38 PM, CHUAN LU <luchuan@cn.ibm.com> wrote:
> Question 1:
> when IDS start to do a backup on 3 AM , Do the backup only include those
> transaction data before 3 AM?
>
> Queston 2:
> When IDS is doing the backup ? there are still some new transactions,when
> do
> the checkpoint,where those dirty page will be flushed to ? Is it temporary
> dbspace?
>
> Question 3:
> If IDS start to do a backup on 3 AM , and finish the backup on 7 AM in the
> same day, could I use this backup image to restore the PIT 4 AM instead of
> to
> use yesterday backup and logical log?
>
> thanks for your time.
>
>
> ************************************************************
> *******************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...
--94eb2c05fb201a9520053beca466