473,385 Members | 1,843 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,385 software developers and data experts.

How do I recover from>> pg_xlog/0000000000000000 (log file 0, segment

Hello,

Is there a way to recover from the following error?
I have (had) an existing database and wish not
to lose the data tables.

Thanks for any help,

Pete
[postgres@web2 /]$ pg_ctl start
postmaster successfully started
[postgres@web2 /]$ LOG: database system shutdown was interrupted at
2004-10-18 11:41:55 PDT
LOG: open of /web2-disk1/grip/database/pg_xlog/0000000000000000 (log
file 0, segment 0) failed: No such file or directory
LOG: invalid primary checkpoint record
LOG: open of /web2-disk1/grip/database/pg_xlog/0000000000000000 (log
file 0, segment 0) failed: No such file or directory
LOG: invalid secondary checkpoint record
PANIC: unable to locate a valid checkpoint record
LOG: startup process (pid 2803) was terminated by signal 6
LOG: aborting startup due to startup process failure

[postgres@web2 /]$

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
5 7709
peter Willis <pe****@borstad.com> writes:
[postgres@web2 /]$ LOG: database system shutdown was interrupted at
2004-10-18 11:41:55 PDT
LOG: open of /web2-disk1/grip/database/pg_xlog/0000000000000000 (log
file 0, segment 0) failed: No such file or directory
LOG: invalid primary checkpoint record
LOG: open of /web2-disk1/grip/database/pg_xlog/0000000000000000 (log
file 0, segment 0) failed: No such file or directory
LOG: invalid secondary checkpoint record
PANIC: unable to locate a valid checkpoint record
LOG: startup process (pid 2803) was terminated by signal 6
LOG: aborting startup due to startup process failure


pg_resetxlog would probably get you to a point where you could start
the server, but you should not have any great illusions about the
consistency of your database afterward.

How did you get into this state, anyway? And what PG version is it?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2
pw


Tom Lane wrote:
peter Willis <pe****@borstad.com> writes:

[postgres@web2 /]$ LOG: database system shutdown was interrupted at
2004-10-18 11:41:55 PDT
LOG: open of /web2-disk1/grip/database/pg_xlog/0000000000000000 (log
file 0, segment 0) failed: No such file or directory
LOG: invalid primary checkpoint record
LOG: open of /web2-disk1/grip/database/pg_xlog/0000000000000000 (log
file 0, segment 0) failed: No such file or directory
LOG: invalid secondary checkpoint record
PANIC: unable to locate a valid checkpoint record
LOG: startup process (pid 2803) was terminated by signal 6
LOG: aborting startup due to startup process failure


pg_resetxlog would probably get you to a point where you could start
the server, but you should not have any great illusions about the
consistency of your database afterward.

How did you get into this state, anyway? And what PG version is it?

regards, tom lane


The server was running with postgres on terabyte firewire 800 drive.
A tech decided to 'hot-plug' another terabyte drive into the system
without downing the server, umounting the first drive, and then remounting
both drives.
Since ohci drivers tend to enumerate and mount without using the
hardware ID of
the drive , the poor kernel got confused and decided that the new drive
was first in line....clang!

I had a database backup from the previous day. I just used that.

I set up a cron job to pg_dump and gzip every hour and
dump any backup gz files older than 1 week.
I love that 'date' command .. :)

date +%F-%H%M%S

nice............ :)

Peter


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #3
On Tue, Oct 19, 2004 at 03:49:04PM -0700, pw wrote:
I set up a cron job to pg_dump and gzip every hour and
dump any backup gz files older than 1 week.


Huh ... be sure to keep some older backup anyway! There was just
someone on a list (this one?) whose last two weeks of backups contained
no data (a guy with OpenACS or something).

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The eagle never lost so much time, as
when he submitted to learn of the crow." (William Blake)
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #4
> On Tue, Oct 19, 2004 at 03:49:04PM -0700, pw wrote:
I set up a cron job to pg_dump and gzip every hour and
dump any backup gz files older than 1 week.


Huh ... be sure to keep some older backup anyway! There was just
someone on a list (this one?) whose last two weeks of backups contained
no data (a guy with OpenACS or something).


Also, if you don't routinely test your backups every now and then,
how can you be sure they'll work when you NEED them to?
--
Mike Nolan
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #5
pw

Mike Nolan wrote:
On Tue, Oct 19, 2004 at 03:49:04PM -0700, pw wrote:

I set up a cron job to pg_dump and gzip every hour and
dump any backup gz files older than 1 week.


Huh ... be sure to keep some older backup anyway! There was just
someone on a list (this one?) whose last two weeks of backups contained
no data (a guy with OpenACS or something).

Also, if you don't routinely test your backups every now and then,
how can you be sure they'll work when you NEED them to?
--
Mike Nolan


Hello,

If vacuumdb and pg_dump don't work
then I have bigger problems than just a hardware burp.

It's just like any other (MS incuded) software. You have to trust
it until it proves otherwise.
I've seen oracle go south because of hardware, etc. too.
At least I'm not spending $30,000 for the adventure.
I don't get any more satisfaction for the $30 grand
than rebuilding from a backup anyway.
If I really felt paranoid about it I could have a
test server set up and make a cron job that scps
the current backup over and builds
a database from it. Then queries every table for the
last updated record and compares it to the local server.
A days work tops.

I'm pretty sure the current backup method is OK though.
It can even move the database backup off site in case the
place burns down.

In the case of the fellow with no data, It's difficult
to say whether that's real or not.
I moved a DB over to another machine and had to open the tar
file that came from pg_dump, edit the 'restore.sql' in several
places, and run the script manually so I could watch the error logging.
All the data was there, it just wasn't going through the
COPY command properly (path issues). Also, the proceedural language
that I was using for a trigger needed to be installed by 'postgres'
user *first* before I was able to make part of the script work.
It's pretty easy to forget all the schema stuff in a
database over time.
Did that guy look in the '.dat' files to see if there
was data?
Peter
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #6

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

Similar topics

5
by: Google Mike | last post by:
Is there a way to change PHP's source and recompile so that I can use "." instead of "->" for the object operator? Of course, I would also change "." (the concat operator) to "&" or "+" for the...
23
by: Loony | last post by:
I have got a code like this in HTML section in ASP file which includes javascript file! The script works under MS IE but doesn't with Firefox! Can anybody tell me what is wrong? <HTML>...
8
by: flit | last post by:
Hello All, I am trying to get information from a form and send it to a python script without success.. Here is my objective: User enters data in form --form send variables to python script...
3
by: Daniel Nogradi | last post by:
Hi list, I have an awk program that parses a text file which I would like to rewrite in python. The text file has multi-line records separated by empty lines and each single-line field has two...
9
by: kvnsmnsn | last post by:
Over the course of my career I've transitioned from an Ada programmer (am I dating myself?) to a C programmer to a Java programmer and now back to a C programmer with the job I've currently...
1
by: kgk | last post by:
I would like to concatenate several file-like objects to create a single file-like object. I've looked at fileinput, however this returns a fileinput object that is not very file-like. ...
8
by: Shawn Minisall | last post by:
I am trying to read a few lines of a file with multiple values, the rest are single and are reading in fine. With the multiple value lines, python says this "ValueError: too many values to...
3
by: iu2 | last post by:
Hi, I'm trying to write data to both a file and the console, so I did: class File_and_console(file): def write(self, s): file.write(self, s) print s, hello
26
by: machineghost | last post by:
First off, let me just say that as someone with no DBA training whatsoever, any help I can get with this issue will be very, very much appreciated. My company recently migrated our database from...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...

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.