473,773 Members | 2,286 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I recover from>> pg_xlog/000000000000000 0 (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/000000000000000 0 (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/000000000000000 0 (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 YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 23 '05 #1
5 7742
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/000000000000000 0 (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/000000000000000 0 (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 YourEmailAddres sHere" to ma*******@postg resql.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/000000000000000 0 (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/000000000000000 0 (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*******@postg resql.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
2018
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 concat operator. I think it's as simple as editing "zend_language_scanner.l" from the source, changing "." to "&", and "->" to ".", then recompiling, but I haven't tested this. Has anyone done that before?
23
16144
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> <HEAD><TITLE></TITLE> <SCRIPT LANGUAGE="JavaScript" SRC="../inc/JSfile.js"><SCRIPT> <SCRIPT> <!-- other javascript scripts working propely
8
1886
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 --> script runs and output result. the form code
3
6269
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 subfields: node 10 x -1 y 1
9
2371
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 started. What I'd like to do is write a piece of C code that inputs to the pro- gram a line written to a file. The Java code written below does exactly what I want; it writes the <String"ab cd" to file "Java.Txt" and then reads it back in to variable...
1
2081
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. something like # a has 50 bytes, and b has 100 bytes f = FileList (open('a'), open('b')) f.read (100) # read 50 bytes from a and 50 from b
8
7125
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 unpack" I've googled it and it says that happens when you have too few or too many strings that don't match with the variables in number your trying to assign them too. Below are the lines in reading in:
3
1189
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
3054
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 DB2 v7 to DB2 v9. We hired a consultant to help us, and things went pretty smoothly ... up until a few weeks after, when a co-worker tried to insert JavaScript in to our database. That's when we learned that v9, unlike v7, has a problem with...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8937
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.