Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Backup/Restore ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 11 Topic 15485 of 15987
Post > Topic >>

Backup/Restore of single table in multi TB database

by sodgodofall@[EMAIL PROTECTED] ("John Smith") May 7, 2008 at 01:02 PM

Hi,

I have a large database (multiple TBs) where I'd like to be able to do
a backup/restore of just a particular table (call it foo).  Because
the database is large, the time for a full backup would be
prohibitive.  Also, whatever backup mechanism we do use needs to keep
the system online (i.e., users must still be allowed to update table
foo while we're taking the backup).

After reading the documentation, it seems like the following might
work.  Suppose the database has two tables foo and bar, and we're only
interested in backing up table foo:

1. Call pg_start_backup

2. Use the pg_class table in the catalog to get the data file names
for tables foo and bar.

3. Copy the system files and the data file for foo.  Skip the data file
for bar.

4. Call pg_stop_backup()

5. Copy WAL files generated between 1. and 4. to another location.

Later, if we want to restore the database somewhere with just table
foo, we just use postgres's normal recovery mechanism and point it at
the files we backed up in 2. and the WAL files from 5.

Does anyone see a problem with this approach (e.g., correctness,
performance, etc.)?  Or is there perhaps an alternative approach using
some other postgresql mechanism that I'm not aware of?

Thanks!
- John

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 11 Posts in Topic:
Backup/Restore of single table in multi TB database
sodgodofall@[EMAIL PROTEC  2008-05-07 13:02:57 
Re: Backup/Restore of single table in multi TB database
david.t.wilson@[EMAIL PRO  2008-05-07 16:09:45 
Re: Backup/Restore of single table in multi TB database
jd@[EMAIL PROTECTED] (&q  2008-05-07 13:11:25 
Re: Backup/Restore of single table in multi TB database
jd@[EMAIL PROTECTED] (&q  2008-05-07 13:16:35 
Re: Backup/Restore of single table in multi TB database
simon@[EMAIL PROTECTED]   2008-05-07 22:28:44 
Re: Backup/Restore of single table in multi TB database
tgl@[EMAIL PROTECTED] (T  2008-05-07 17:41:01 
Re: Backup/Restore of single table in multi TB database
sodgodofall@[EMAIL PROTEC  2008-05-07 15:24:22 
Re: Backup/Restore of single table in multi TB database
simon@[EMAIL PROTECTED]   2008-05-08 07:25:16 
Ubuntu question
theqmaster@[EMAIL PROTECT  2008-05-08 01:52:17 
Re: Ubuntu question
kleptog@[EMAIL PROTECTED]  2008-05-08 09:01:02 
Re: Ubuntu question
justin@[EMAIL PROTECTED]   2008-05-08 03:48:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 17:46:33 CDT 2008.