Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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 -

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?

In response to

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group