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

Invalid page header

I have 5 corrupted page headers as evidenced by these errors:

ERROR: Invalid page header in block 13947 of ...

The corruption is causing numerous queries to abort. First option is to try
to salvage data before attempt restore from backup. I want to try to edit
the file to zero out the bogus headers. I realize there may be data lost
from this attempt. I have scalpel (binary editor) in hand.

Which bytes should I edit, and what do I make them?
$ pg_filedump -if -R 1343 1343 25268878.38650946

************************************************** ***************
* PostgreSQL File/Block Formatted Dump Utility - Version 1.1
*
* File: 25268878.38650946
* Options used: -if -R 1343 1343
*
* Dump created on: Wed Oct 20 19:14:06 2004
************************************************** ***************

Block 1343 ************************************************** ****
<Header> -----
Block Offset: 0x00a7e000 Offsets: Lower 0 (0x0000)
Block: Size 0 Version 0 Upper 0 (0x0000)
LSN: logid 0 recoff 0x00000000 Special 0 (0x0000)
Items: -5 Free Space: 0
Length (including item array): 24

Error: Invalid header information.

0000: 00000000 00000000 00000000 00000000 ................
0010: 00000000 00000000 ........

<Data> ------
Error: Item index corrupt on block. Offset: <-5>.

<Special Section> -----
Error: Invalid special section encountered.
Error: Special section points off page. Unable to dump contents.

*** End of Requested Range Encountered. Last Block Read: 1343 ***
---------------------------(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 #1
5 4103
On Wednesday October 20 2004 5:34, Ed L. wrote:
I have 5 corrupted page headers as evidenced by these errors:

ERROR: Invalid page header in block 13947 of ...

The corruption is causing numerous queries to abort. First option is to
try to salvage data before attempt restore from backup. I want to try to
edit the file to zero out the bogus headers. I realize there may be data
lost from this attempt. I have scalpel (binary editor) in hand.

Which bytes should I edit, and what do I make them?
In other words, how do I calculate which bytes to zero to simulate
zero_damaged_pages??

TIA.



$ pg_filedump -if -R 1343 1343 25268878.38650946

************************************************** ***************
* PostgreSQL File/Block Formatted Dump Utility - Version 1.1
*
* File: 25268878.38650946
* Options used: -if -R 1343 1343
*
* Dump created on: Wed Oct 20 19:14:06 2004
************************************************** ***************

Block 1343 ************************************************** ****
<Header> -----
Block Offset: 0x00a7e000 Offsets: Lower 0 (0x0000)
Block: Size 0 Version 0 Upper 0 (0x0000)
LSN: logid 0 recoff 0x00000000 Special 0 (0x0000)
Items: -5 Free Space: 0
Length (including item array): 24

Error: Invalid header information.

0000: 00000000 00000000 00000000 00000000 ................
0010: 00000000 00000000 ........

<Data> ------
Error: Item index corrupt on block. Offset: <-5>.

<Special Section> -----
Error: Invalid special section encountered.
Error: Special section points off page. Unable to dump contents.

*** End of Requested Range Encountered. Last Block Read: 1343 ***

---------------------------(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
On Wednesday October 20 2004 10:12, Ed L. wrote:
On Wednesday October 20 2004 10:00, Tom Lane wrote:
"Ed L." <pg***@bluepolka.net> writes:
In other words, how do I calculate which bytes to zero to simulate
zero_damaged_pages??


Why simulate it, when you can just turn it on? But anyway, the answer
is "the whole page".


Old 7.3.4 installation, didn't realize that feature was there. Thx.


That worked for 3 of 4 cases, but for a fourth, I see the message that it's
zeroing the page, but then it continues to report invalid page header for
that block... maybe the header is too fouled up to fix?
Ed
---------------------------(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
"Ed L." <pg***@bluepolka.net> writes:
In other words, how do I calculate which bytes to zero to simulate
zero_damaged_pages??


Why simulate it, when you can just turn it on? But anyway, the answer
is "the whole page".

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #4
On Wednesday October 20 2004 10:00, Tom Lane wrote:
"Ed L." <pg***@bluepolka.net> writes:
In other words, how do I calculate which bytes to zero to simulate
zero_damaged_pages??


Why simulate it, when you can just turn it on? But anyway, the answer
is "the whole page".


Old 7.3.4 installation, didn't realize that feature was there. Thx.
---------------------------(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 #5
On Wednesday October 20 2004 10:43, Ed L. wrote:
On Wednesday October 20 2004 10:12, Ed L. wrote:
On Wednesday October 20 2004 10:00, Tom Lane wrote:
"Ed L." <pg***@bluepolka.net> writes:
> In other words, how do I calculate which bytes to zero to simulate
> zero_damaged_pages??

Why simulate it, when you can just turn it on? But anyway, the
answer is "the whole page".


Old 7.3.4 installation, didn't realize that feature was there. Thx.


That worked for 3 of 4 cases, but for a fourth, I see the message that
it's zeroing the page, but then it continues to report invalid page
header for that block... maybe the header is too fouled up to fix?


I didn't notice zero_damaged_pages because it doesn't show up by default in
the postgresql.conf file, I guess wisely since it is somewhat dangerous to
the forensic evidence.

I fixed the case that zero_damaged_pages didn't by truncating the file at
the precise byte offset reported by pg_filedump for the bad block via
'pg_filedump -if -R ...'

Ed

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #6

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

Similar topics

6
by: R. Rajesh Jeba Anbiah | last post by:
Is it necessary or is there any standard to send HTTP header status for form inputs ? Say, the user is entering invalid password in login form and now all the applications I have seen are just...
0
by: CSN | last post by:
There are a bunch of these in PG's log: ERROR: Invalid page header in block 14 of start_items_key What does it mean? PG seems to be working fine - anything I need to fix/adjust/worry about?...
1
by: Ed L. | last post by:
I have a server with 20 pgsql clusters on it. I am seeing a slew of errors like the following across 5 of these clusters, all running 7.3.4 on Linux with kernel 2.4.18-4bigmem: ERROR: Invalid...
2
by: Anthony | last post by:
Our Database is having errors. We are currently using PostgreSQL to store 2.5 Million records per day. The average addition to our primary table is 4.5 Gigs of data. We are doing this on a dual...
5
by: Steve Crawford | last post by:
This morning I got bitten by the "SELECT INTO" / "CREATE TABLE AS" from tables without OIDs bug in 7.4.1. Postmaster killed all the backends and restarted - pg was down for 2 seconds. This...
7
by: Nadav | last post by:
Hello, When I create an XML header using this code: XmlDeclaration header = doc.CreateXmlDeclaration("1.0", "UTF-8", null); XmlElement rootElement = doc.DocumentElement; ...
2
by: clevrmnkey | last post by:
I've had nothing but trouble from the System.Net.Mail objects, but I finally need to make them work, and I can't for the life of me see what I'm doing wrong. I pared back my mail transaction to...
9
by: mark4asp | last post by:
Why is this page invalid? Pasted into http://validator.w3.org/ I'm told that the page is invalid. Why? It flags problems with the <bodyand </htmltags but I can't see why. Is the W3C validator...
4
by: mattehz | last post by:
Hey there, I am trying to upload old source files and came across these errors: Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_html.php on line 59...
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:
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.