Unix Technical Forum

Problem with Online-Backup

This is a discussion on Problem with Online-Backup within the Pgsql General forums, part of the PostgreSQL category; --> Hi all, While there are inserts & updates happening into the database, is it possible to make the base ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 01:46 PM
roopa perumalraja
 
Posts: n/a
Default Problem with Online-Backup

Hi all,

While there are inserts & updates happening into the database, is it possible to make the base backup without losing any of the updates in the database?

What does select pg_start_backup('label'); & pg_stop_backup(); do actually?

I am worried if the file system backup tool will not store the data files in the /pgsql/data/base which is still getting populated. Or does the segment file store that?

Will the Continuous backup or Hot backup (if any) solve the problem?

Thanks a lot in advance


---------------------------------
Everyone is raving about the all-new Yahoo! Mail beta.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 01:46 PM
Richard Huxton
 
Posts: n/a
Default Re: Problem with Online-Backup

roopa perumalraja wrote:
> Hi all,
>
> While there are inserts & updates happening into the database, is it
> possible to make the base backup without losing any of the updates in
> the database?


Yes, that's the whole point of PITR. The filesystem backup + WAL files
gives you a working database when restored.

> What does select pg_start_backup('label'); & pg_stop_backup(); do
> actually?


Tell the server that you are taking a backup, start a new WAL segment
for you too.

http://www.postgresql.org/docs/8.2/s...archiving.html

> I am worried if the file system backup tool will not store the data
> files in the /pgsql/data/base which is still getting populated. Or
> does the segment file store that?


Not sure I understand you here.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 01:47 PM
roopa perumalraja
 
Posts: n/a
Default Re: Problem with Online-Backup

Thanks a lot for your reply. To make it more clear will the be no loss of data or data corruption when taking a base backup while there is inserts & updates happening in the database?

--
Roopa

Richard Huxton <dev@archonet.com> wrote:
roopa perumalraja wrote:
> Hi all,
>
> While there are inserts & updates happening into the database, is it
> possible to make the base backup without losing any of the updates in
> the database?


Yes, that's the whole point of PITR. The filesystem backup + WAL files
gives you a working database when restored.

> What does select pg_start_backup('label'); & pg_stop_backup(); do
> actually?


Tell the server that you are taking a backup, start a new WAL segment
for you too.

http://www.postgresql.org/docs/8.2/s...archiving.html

> I am worried if the file system backup tool will not store the data
> files in the /pgsql/data/base which is still getting populated. Or
> does the segment file store that?


Not sure I understand you here.

--
Richard Huxton
Archonet Ltd



---------------------------------
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 01:47 PM
Ron Johnson
 
Posts: n/a
Default Re: Problem with Online-Backup

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/01/07 03:02, roopa perumalraja wrote:
> Hi all,
>
> While there are inserts & updates happening into the database, is
> it possible to make the base backup without losing any of the
> updates in the database?


pg_dump does transactionaly-consistent hot backups.

PITR allows you to roll forward to the point-in-time at which the
system crashed.

> What does select pg_start_backup('label'); & pg_stop_backup(); do
> actually?
>
> I am worried if the file system backup tool will not store the
> data files in the /pgsql/data/base which is still getting
> populated. Or does the segment file store that?


Open-database file-level backups might work with PITR, but I
wouldn't trust it.

Closed-database file-level backups definitely work.

> Will the Continuous backup or Hot backup (if any) solve the
> problem?


See above.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFwmfgS9HxQb37XmcRAjrcAKDB751ZWH/aKV17URY4OKwVN4dosgCfasCD
dF21fHEpPpFQ/TII0OijV6Q=
=EbJe
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-09-2008, 01:47 PM
Glen Parker
 
Posts: n/a
Default Re: Problem with Online-Backup

> Open-database file-level backups might work with PITR, but I
> wouldn't trust it.


IME, it does work, and very well. Inconsistencies in the heap files are
trumped by the WAL archive during recovery.

-Glen


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-09-2008, 01:47 PM
Ron Johnson
 
Posts: n/a
Default Re: Problem with Online-Backup

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/01/07 16:27, Glen Parker wrote:
>> Open-database file-level backups might work with PITR, but I
>> wouldn't trust it.

>
> IME, it does work, and very well. Inconsistencies in the heap files are
> trumped by the WAL archive during recovery.


Tarring hot database files still gives me the willies. But then, I
wear belt and suspenders.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFwnVGS9HxQb37XmcRAqZCAKDNCuAD1ZKnXNCFDrdC+8 6rxkKINgCg7syt
QpSZmzLAKlJFdoWThULV/1o=
=Ociw
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-09-2008, 01:47 PM
Glen Parker
 
Posts: n/a
Default Re: Problem with Online-Backup

> Tarring hot database files still gives me the willies. But then, I
> wear belt and suspenders.


I understand. A list of "file changed while we read it" errors is just
a little unnerving at first!

I did quite a few end to end backup/PITR tests, and no matter what I did
to the DB during backup, no matter how many errors tar or cpio produced,
I have been unable to find any problems with the end result.

OTOH, I still take a full base backup every night and keep ten days
worth of WAL files on our backup server, so I guess maybe I don't
*completely* trust it :-)

-Glen


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-09-2008, 01:47 PM
Tom Lane
 
Posts: n/a
Default Re: Problem with Online-Backup

Glen Parker <glenebob@nwlink.com> writes:
>> Tarring hot database files still gives me the willies. But then, I
>> wear belt and suspenders.


> I understand. A list of "file changed while we read it" errors is just
> a little unnerving at first!


> I did quite a few end to end backup/PITR tests, and no matter what I did
> to the DB during backup, no matter how many errors tar or cpio produced,
> I have been unable to find any problems with the end result.


In theory, at least, this is exactly as reliable as Postgres' crash
recovery: it's essentially the same mechanism that gets us back to a
consistent state on-disk after a crash. So don't worry too much about
all those gripes from tar. (The only real problem with 'em is they
might distract you from a more serious problem, like out-of-space.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-09-2008, 01:48 PM
Ron Johnson
 
Posts: n/a
Default Re: Problem with Online-Backup

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/01/07 18:04, Glen Parker wrote:
>> Tarring hot database files still gives me the willies. But then, I
>> wear belt and suspenders.

>
> I understand. A list of "file changed while we read it" errors is just
> a little unnerving at first!
>
> I did quite a few end to end backup/PITR tests, and no matter what I did
> to the DB during backup, no matter how many errors tar or cpio produced,
> I have been unable to find any problems with the end result.
>
> OTOH, I still take a full base backup every night and keep ten days
> worth of WAL files on our backup server, so I guess maybe I don't
> *completely* trust it :-)


Or you don't trust tape to be 100% reliable.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFwpWNS9HxQb37XmcRAtUhAKDavPVEGP4UiqNh8Wn4yM 87+8YwGgCeJ0XM
QMLq3wgjA1LiVTi+a8xwkI0=
=xVi1
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-09-2008, 01:48 PM
Richard Huxton
 
Posts: n/a
Default Re: Problem with Online-Backup

roopa perumalraja wrote:
> Thanks a lot for your reply. To make it more clear will the be no
> loss of data or data corruption when taking a base backup while there
> is inserts & updates happening in the database?


Updates to the database continue uninterrupted.

The base backup alone is *not* enough to be safe.

The base backup + WAL segments *are* enough to be safe.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:40 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com