Re: Synchronization API for Snapshotting

From: Chander Ganesan <chander(at)otg-nc(dot)com>
To: Ketema Harris <ketema(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Synchronization API for Snapshotting
Date: 2006-07-14 15:00:13
Message-ID: 44B7B17D.8050007@otg-nc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

> Hello I would like to know if Pg has an interface that would allow a
> LVM with Snapshotting capabilities to know when the DB is in a
> consistent state to allow a snapshot to take place.

If you take a file system level snapshot, the DB will always be in a
consistent state (or never, depending on how you look at it). When you
restore that backup (taken from a LVM snapshot) PostgreSQL will replay
any information in the transaction logs that hasn't been recorded to
disk. Strictly speaking, the DB won't be in a consistent state - but it
will be in a state from which it can bring itself to a consistent
state. If you do this, you don't even need to interact with PostgreSQL
- you can simply perform the snapshot and back it up (the release the
snapshot when you are done).

The only caveat to this is that if you are doing such a thing, be sure
to consider any tablespaces you have off of the file system you are
snapshotting (for example, if you have a tablespace on a different LVM
volume, this snapshotting technique won't be reliable, since you'll only
snapshot part of your database).

Another alternative is to use PostgreSQL's online backup mechanism,
which doesn't require you to shut down the server, but will allow you to
perform an online backup.

We cover all of these topics in our PostgreSQL administration class - if
you're interested in learning more -
http://www.otg-nc.com/training-courses/coursedetail.php?courseid=40

Chander Ganesan
Open Technology Group, Inc.
One Copley Parkway, Suite 210
Morrisville, NC 27560
Phone: 877-258-8987/919-463-0999

>
> Thanks
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Garcia, Joshua 2006-07-14 18:56:06 PQexecParams and PQexecPreparaed
Previous Message Mike Ellsworth 2006-07-14 14:35:49 Re: Relational DB's & pics - a long business-related question