473,396 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Backup?

Should one use pg_dumpall to backup the database or is it more practical
to just copy the data directory?
Regards,

BTJ
--
-----------------------------------------------------------------------------------------------
Bjørn T Johansen (BSc,MNIF)
Executive Manager
bt*@havleik.no Havleik Consulting
Phone : +47 67 54 15 17 Conradisvei 4
Fax : +47 67 54 13 91 N-1338 Sandvika
Cellular : +47 926 93 298 http://www.havleik.no
-----------------------------------------------------------------------------------------------
"The stickers on the side of the box said "Supported Platforms: Windows
98, Windows NT 4.0,
Windows 2000 or better", so clearly Linux was a supported platform."
-----------------------------------------------------------------------------------------------

Nov 11 '05 #1
4 1425
>>>>> "BTJ" == Bjørn T Johansen <Bj> writes:

BTJ> Should one use pg_dumpall to backup the database or is it more

yes, or pg_dump specific databases.

BTJ> practical to just copy the data directory?

this would do you no good, since the files are not necessarily in a
consistent state when you copy many of them. ie, the copy is
non-atomic, and there is no guarantee that all data is flushed to
disk.

i don't even do a file system dump of my PG data partition because of
this.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: kh***@kciLink.com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/

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

Nov 11 '05 #2
Bjørn T Johansen <bt*@havleik.no> writes:
Should one use pg_dumpall to backup the database or is it more practical
to just copy the data directory?


The data directory will not be consistent unless the server is
stopped. pg_dumpall works well, produces a consistent backup and is
easily portable to a different machine architecture if need be.

-Doug

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

http://archives.postgresql.org

Nov 11 '05 #3
On Thu, 2003-09-04 at 15:40, Doug McNaught wrote:
Bjørn T Johansen <bt*@havleik.no> writes:
Should one use pg_dumpall to backup the database or is it more practical
to just copy the data directory?


The data directory will not be consistent unless the server is
stopped. pg_dumpall works well, produces a consistent backup and is
easily portable to a different machine architecture if need be.


And it's smaller than the data/ directory, especially when "-F c"
option is used.

--
-----------------------------------------------------------------
Ron Johnson, Jr. ro***********@cox.net
Jefferson, LA USA

"The UN couldn't break up a cookie fight in a Brownie meeting."
Larry Miller
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 11 '05 #4
>>>>> "RJ" == Ron Johnson <ro***********@cox.net> writes:

RJ> On Thu, 2003-09-04 at 15:40, Doug McNaught wrote:
Bjørn T Johansen <bt*@havleik.no> writes:
> Should one use pg_dumpall to backup the database or is it more practical
> to just copy the data directory?


The data directory will not be consistent unless the server is
stopped. pg_dumpall works well, produces a consistent backup and is
easily portable to a different machine architecture if need be.


RJ> And it's smaller than the data/ directory, especially when "-F c"
RJ> option is used.

That and indexes are represented as a single "CREATE INDEX" statement,
rather than possibly gigabytes of data ;-)

I had one index which I just realized was redundant to another and
deleting it saved me ~1Gb on disk.

For the curious, the indexes were like this:

PRIMARY KEY (a,b);
INDEX a ON mytable (a);

The query planner shows slightly longer plans with just the PK, but
the cost savings on mass inserts which happen often offset this
immensely, not to mention 1Gb of disk which never needs to be read
into the buffers ;-)
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: kh***@kciLink.com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andrew E | last post by:
I just took over DBA responsibilities for an Oracle 8i database running on Linux. Although I've been working with relational databases for some time, I'm a bit green on Oracle so forgive me. My...
3
by: Thiko | last post by:
Hi I take one nightly full database backup at 02:00 and backup the transaction log to one backup set every 15mins. The commands to do this are as follows and are set up to run as database...
2
by: nt | last post by:
I am having a problem with a regular backup of an SQL Server (MSDE 2000) database to a local drive. I initiate the backup once a week, by issuing the required T-SQL, via ADO. In this case, the...
1
by: John Rajendran | last post by:
Hi there, I need to take a backup with the following scanerio in mind: At T1 I take the FULL BACK UP of the database called BACK_1_FULL.BACK in c:\ Then at T2 I would like to take only the...
6
by: Eric Herber | last post by:
I've a question regarding db2 (V8.1) and database backups going to a storage manager like TSM for example. As I can see in the storage manager if I backup the complete database over the TSM API...
1
by: alex | last post by:
Hi ! I couldn't make backups with our new system using db2 8.2. Every time I trigger a backup I get this error message: BACKUP DATABASE EBUERO2 ONLINE TO "/raid/backup/ebuero2/part1",...
4
by: uthuras | last post by:
Hi all, I have DB2ESE version 8.1 with FP 4 on AIX 5.2. My database used to be 1.1TB. When the DB size is 1.1TB, it takes approximately 7 hours to backup the entire database (online backup). The...
6
by: k04jg02 | last post by:
Problem: I have a properties dialog. X objects build the dialog, but a subclass of X, such as Y, can add more options to the dialog for Y specific properties. I would like to write code for the...
10
by: Konstantin Andreev | last post by:
Hello. Some time ago I asked in this conference, - How to use an ONLINE BACKUP to restore database onto another system? - but got no answers. Therefore I can conclude it is not possible. But......
2
by: clilush | last post by:
I've been working with db2 8.2fp14 for over a year now and was wondering what is a "standard" way of doing a backup to provide 24/7 operations with disaster recovery capabilities? My thoughts were...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.