pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedTransaction logs gone, how to restart?
3+ messages / 3 participants
[nested] [flat]
* Transaction logs gone, how to restart?
@ 2004-03-09 13:46 Jeff Boes <jboes@nexcerpt.com>
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Boes @ 2004-03-09 13:46 UTC (permalink / raw)
To: pgsql-admin
We backed up our test server yesterday (Pg 7.4.1) as the first step in switching
from Red Hat 7 to Whitebox. However, we failed to back up the transaction and
commit logs. Now that the OS and database are back to where they were, we get
this message on attempting to restart:
LOG: could not open file "/usr/local/pgsql/data/pg_xlog/00000041000000EE" (log
file 65, segment 238): No such file or directory
(There are other problems that we are still working to correct, but this is the
one that I don't understand.)
--
~~~~~~~~~~~~~~~~| Genius may have its limitations, but stupidity is not
Jeff Boes | thus handicapped.
jboes@qtm.net | --Elbert Hubbard (1856-1915), American author
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Transaction logs gone, how to restart?
@ 2004-03-09 15:51 Tom Lane <tgl@sss.pgh.pa.us>
parent: Jeff Boes <jboes@nexcerpt.com>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2004-03-09 15:51 UTC (permalink / raw)
To: Jeff Boes <jboes@nexcerpt.com>; +Cc: pgsql-admin
Jeff Boes <jboes@nexcerpt.com> writes:
> We backed up our test server yesterday (Pg 7.4.1) as the first step in switching
> from Red Hat 7 to Whitebox. However, we failed to back up the transaction and
> commit logs. Now that the OS and database are back to where they were, we get
> this message on attempting to restart:
> LOG: could not open file "/usr/local/pgsql/data/pg_xlog/00000041000000EE" (log
> file 65, segment 238): No such file or directory
Urgh. If you shut down the postmaster cleanly before backing up, then
you don't really need pg_xlog --- running pg_resetxlog will get you out
of the above problem. However, if you did not save pg_clog then I fear
you are well and truly screwed.
How long ago was your last complete (database-wide) VACUUM? If it was
just before shutdown then you may be able to achieve some semblance of
a consistent database, but if it was awhile ago then you do not have
a database but just a pile of bits :-(
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Transaction logs gone, how to restart?
@ 2004-03-09 16:08 Anjan Dave <adave@vantage.com>
0 siblings, 0 replies; 3+ messages in thread
From: Anjan Dave @ 2004-03-09 16:08 UTC (permalink / raw)
To: Jeff Boes <jboes@nexcerpt.com>; +Cc: pgsql-admin; Tom Lane <tgl@sss.pgh.pa.us>
If it helps in future, I use this script (don't remember where I had
found it..) to backup the databases on disk, and then the backup
directory can be backed up to the tape --
#!/bin/sh
# Backup PostgreSQL
TMPDIR=/var/lib/pgsql/backups
export TMPDIR
echo $TMPDIR
# dump each database schema/data separately
su -l postgres -c "psql -At -F ' ' -U postgres -d template1 <<__END__
SELECT datname FROM pg_database WHERE datallowconn;
__END__
" | while read DB; do
echo "PostgreSQL db $DB"
mkdir -p $TMPDIR/$DB
# schema
su -l postgres -c "pg_dump -Cs -F c -Z 9 -S postgresql $DB" \
> $TMPDIR/$DB/schema.pg
rm -rf $TMPDIR/$DB/schema.pg.gz
gzip $TMPDIR/$DB/schema.pg
# data
su -l postgres -c "pg_dump -bd -F c -Z 9 -S postgresql $DB" \
> $TMPDIR/$DB/data.pg
rm -rf $TMPDIR/$DB/data.pg.gz
gzip $TMPDIR/$DB/data.pg
# simple
su -l postgres -c "pg_dump $DB" \
> $TMPDIR/$DB/simple.sql
rm -rf $TMPDIR/$DB/simple.sql.gz
gzip $TMPDIR/$DB/simple.sql
done
# dump all globals (users/groups)
su -l postgres -c "pg_dumpall -g" \
> $TMPDIR/globals.sql
-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Tuesday, March 09, 2004 10:51 AM
To: Jeff Boes
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Transaction logs gone, how to restart?
Jeff Boes <jboes@nexcerpt.com> writes:
> We backed up our test server yesterday (Pg 7.4.1) as the first step in
> switching from Red Hat 7 to Whitebox. However, we failed to back up
> the transaction and commit logs. Now that the OS and database are back
> to where they were, we get this message on attempting to restart:
> LOG: could not open file
> "/usr/local/pgsql/data/pg_xlog/00000041000000EE" (log file 65, segment
> 238): No such file or directory
Urgh. If you shut down the postmaster cleanly before backing up, then
you don't really need pg_xlog --- running pg_resetxlog will get you out
of the above problem. However, if you did not save pg_clog then I fear
you are well and truly screwed.
How long ago was your last complete (database-wide) VACUUM? If it was
just before shutdown then you may be able to achieve some semblance of a
consistent database, but if it was awhile ago then you do not have a
database but just a pile of bits :-(
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-03-09 16:08 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-03-09 13:46 Transaction logs gone, how to restart? Jeff Boes <jboes@nexcerpt.com>
2004-03-09 15:51 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-03-09 16:08 Re: Transaction logs gone, how to restart? Anjan Dave <adave@vantage.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox