Re: Please help (backup)

From: "Phillip Smith" <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>
To: "'Anibal David Acosta'" <aa(at)personal(dot)net(dot)py>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Please help (backup)
Date: 2007-10-22 07:22:42
Message-ID: 024701c8147c$55cc9430$9b0014ac@wbaus090
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

(Please reply to the list so everyone can keep track of the thread)

You’ll need to look at the table definitions to work out what the data should look like, and if it doesn’t look like that – then it’s probably part of the corrupt data…

-----Original Message-----
From: Anibal David Acosta [mailto:aa(at)personal(dot)net(dot)py]
Sent: Monday, 22 October 2007 15:33
To: Phillip Smith
Subject: Re: [ADMIN] Please help (backup)

I open with word pad & notepad, but table, functions and other object declarations looks like "plain text" but the DATA nope.

This is the beginnig of something that looks as DB object
---------------------------------------------------------------------
ALTER TABLE ONLY threads
ADD CONSTRAINT threads_fk1 FOREIGN KEY (forum_id) REFERENCES forums(id) ON DELETE RESTRICT;
= ALTER TABLE ONLY public.threads DROP CONSTRAINT threads_fk1;
public postgres false

_____

1488
_____

1869
_____

1464
---------------------------------------------------------------------

This is the beginnig of something that looks as DB object
---------------------------------------------------------------------
xœeYÝzÚ¸½Þ}
Ï͹˜ïk¶1†»!¤¤$á MÛ3gÊ'Œ Ùbd;=É74Wç]æQæ
Î’Im·?!^–-ikk­µE—†CæjgJš½‰ÜÕ…È•VÂÒÅ›Ð]_ÊBZ
---------------------------------------------------------------------

BTW, I used the "PGAdmin" application to make the backup, I don't have any BLOB column, just normal data type (integer, varchar, datetime)

As you can see, the "data" section is not human readable, so I cant modify it.

Thanks for your time Phillip, I hope to find a solution.

regards.

Anibal

Phillip Smith escribió:

The dumped file is just a plain-text file (Depending on the data types
within your database)

You should be able to open the backup you made with pg_dump in your
favourite editor such as vi and search through for the dodgy data. Clear out
the bad stuff, write it back to disk and you should be good to go.

Obviously this won't "save" the damaged portion of the data, and it may have
unpredictable effects when you take in to account any foreign keys etc you
may have in the database that depends on this data.

Cheers,
~p

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org [mailto:pgsql-admin-
owner(at)postgresql(dot)org] On Behalf Of Anibal David Acosta
Sent: Monday, 22 October 2007 11:16
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] Please help (backup)

I have a backup done with "pg_dump" utility.

For some reason the backup file has 8 phisical bad sectors (17 KB of data)

Now when I try to restore the backup all tables are created successfully
and data of almost all tables restores successfully too, but one table
(the most important) appear empty.

When I do a pg_restore <backup_file> its show all sql instructions and
data until arrive to the "damaged sector" and throws a "out of memory"
exception.

I want to know if is possible to fix the backup file removing the blocks
in the "bad sectors" in order to restore all other information.

something like file dump surgery :)

Thanks!

Anibal


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

http://archives.postgresql.org



THINK BEFORE YOU PRINT - Save paper if you don't really need to print this

*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee. If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments
e-mail.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly


THINK BEFORE YOU PRINT - Save paper if you don't really need to print this

*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee. If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments
e-mail.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tino Schwarze 2007-10-22 08:17:20 Re: Postgres SQL with Suse Linux
Previous Message Phillip Smith 2007-10-22 04:41:31 Re: Please help (backup)