On Thu, 13 Jun 2002, [iso-8859-1] Ragnar Kj�rstad wrote:
>Alternatively to the pg_dump approach others have suggested you can
>snapshot your filesystem and then use regular backup.
>
>The easiest way to snapshot the filesystem is to use a logical volume
>manager (LVM or EVMS on linux) and then do:
>1. take database offline
>2. take snapshot
>3. take database online
>4. backup from snapshot
>5. remove snapshot
I would like to comment that while this is a possible way to backup your
database, it's not the way I would recommend going about it. There are
a couple of caveats:
1) In order to take a filesystem snapshot you must have enough diskspace
elsewhere to contain the filesystem snapshot. If your database resides
on a large filesystem with other data[0] then you're unlikely to want to
deal with caching an entire snapshot until amanda backs it up.
2) Backing up a database by grabbing the actual files off of the disk
can introduce problems if trying to restore onto, for instance, an
upgraded version of Postgres, which might have changed the ondisk
representation slightly. There are also problems if you migrate to a
different architecture since things like byte ordering can change. By
generating a database dump with pg_dump you insure that you have a
portable, plain text file full of valid query commands which can be read
into any future version of Postgres and possibly even into other RDMBS
products provided you choose a pg_dump format which is standards
complaint enough.
3) If your snapshot code is not atomic it means you must take your
database server down everytime you make the snapshot, which on a large
filesystem could be a non-trivial amount of time. With pg_dump you're
just dumping the tables via the standard Postgres interface so you've
got no issues with doing it on a running database.
[0] - which is a very likely scenario since I know few people who make a
seperate filesystem just to hold their database.
--
Brandon D. Valentine <[EMAIL PROTECTED]>
Computer Geek, Center for Structural Biology
"This isn't rocket science -- but it _is_ computer science."
- Terry Lambert on [EMAIL PROTECTED]