Re: Please help (backup)

From: Anibal David Acosta <aa(at)personal(dot)net(dot)py>
To: Phillip Smith <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Please help (backup)
Date: 2007-10-22 12:40:06
Message-ID: 471C9A26.9090302@personal.net.py
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Verdana">Really all file content after
object definitions looks like "Encoded/Encrypted" and when I do a
restore all table data are restored successfully (except one, that is
in the "corrupted sector"). So, maybe the pg_dump do a encrypt or
something like that over the DATA content.<br>
<br>
<br>
Thanks.<br>
<br>
<br>
</font></font><br>
Phillip Smith escribió:
<blockquote cite="mid:024701c8147c$55cc9430$9b0014ac(at)wbaus090"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";
color:black;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
pre
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.EmailStyle18
{font-family:Arial;
color:navy;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<div class="Section1">
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial; color: navy;">(Please
reply to the list so everyone can
keep track of the thread)</span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial; color: navy;">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…</span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<div
style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0cm 0cm 0cm 4pt;">
<p class="MsoNormal"><font color="black" face="Tahoma" size="2"><span
style="font-size: 10pt; font-family: Tahoma; color: windowtext;"
lang="EN-US">-----Original
Message-----<br>
<b><span style="font-weight: bold;">From:</span></b> Anibal David
Acosta
[<a class="moz-txt-link-freetext" href="mailto:aa(at)personal(dot)net(dot)py">mailto:aa(at)personal(dot)net(dot)py</a>] <br>
<b><span style="font-weight: bold;">Sent:</span></b> Monday, 22
October 2007
15:33<br>
<b><span style="font-weight: bold;">To:</span></b> Phillip Smith<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [ADMIN]
Please help
(backup)</span></font></p>
<p class="MsoNormal"><font color="black" face="Times New Roman"
size="3"><span style="font-size: 12pt;"> </span></font></p>
<p class="MsoNormal"><font color="black" face="Verdana" size="2"><span
style="font-size: 10pt; font-family: Verdana;">I open with word pad
&amp;
notepad, but table, functions and other object declarations looks like
"plain text" but the DATA nope.<br>
<br>
This is the beginnig of something that looks as DB object<br>
---------------------------------------------------------------------<br>
ALTER TABLE ONLY threads<br>
    ADD CONSTRAINT threads_fk1 FOREIGN KEY (forum_id) REFERENCES
forums(id) ON DELETE RESTRICT;<br>
 =   ALTER TABLE ONLY public.threads DROP CONSTRAINT
threads_fk1;<br>
       public       postgres   
false
<hr align="left" size="1">   1488
<hr align="left" size="1">   1869
<hr align="left" size="1">   1464      <br>
---------------------------------------------------------------------</span></font><br>
<font face="Verdana" size="2"><span
style="font-size: 10pt; font-family: Verdana;"><br>
<br>
This is the beginnig of something that looks as DB object<br>
---------------------------------------------------------------------</span></font><br>
<font face="Verdana" size="2"><span
style="font-size: 10pt; font-family: Verdana;"> xœeYÝzÚ¸½Þ}<br>
Ï͹˜ïk¶1†»!</span></font><font face="Verdana" size="2"><span
style="font-size: 10pt; font-family: Verdana;"></span></font><font
face="Verdana" size="2"><span
style="font-size: 10pt; font-family: Verdana;">¤¤$á
MÛ3gÊ'Œ Ùbd;=É74Wç]æQæ<br>
Î’Im·?!^–-ikk­µE—†CæjgJš½‰ÜÕ…È•VÂÒÅ›Ð]_ÊBZ<br>
---------------------------------------------------------------------</span></font><br>
<font face="Verdana" size="2"><span
style="font-size: 10pt; font-family: Verdana;"><br>
BTW, I used the "PGAdmin" application to make the backup, I don't
have any BLOB column, just normal data type (integer, varchar, datetime)<br>
<br>
<br>
As you can see, the "data" section is not human readable, so I
cant  modify it.<br>
<br>
<br>
Thanks for your time Phillip, I hope  to find a solution.<br>
<br>
regards.<br>
<br>
Anibal<br>
</span></font><br>
Phillip Smith escribió: </p>
<pre wrap=""><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">The dumped file is just a plain-text file (Depending on the data types</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">within your database)</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">You should be able to open the backup you made with pg_dump in your</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">favourite editor such as vi and search through for the dodgy data. Clear out</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">the bad stuff, write it back to disk and you should be good to go.</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">Obviously this won't "save" the damaged portion of the data, and it may have</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">unpredictable effects when you take in to account any foreign keys etc you</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">may have in the database that depends on this data.</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">Cheers,</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">~p</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">  </span></font></pre>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" type="cite">
<pre wrap=""><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">-----Original Message-----</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">From: <a moz-do-not-send="true"
href="mailto:pgsql-admin-owner(at)postgresql(dot)org">pgsql-admin-owner(at)postgresql(dot)org</a> [<a
moz-do-not-send="true" href="mailto:pgsql-admin">mailto:pgsql-admin</a>-</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"><a moz-do-not-send="true"
href="mailto:owner(at)postgresql(dot)org">owner(at)postgresql(dot)org</a>] On Behalf Of Anibal David Acosta</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">Sent: Monday, 22 October 2007 11:16</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">To: <a moz-do-not-send="true"
href="mailto:pgsql-admin(at)postgresql(dot)org">pgsql-admin(at)postgresql(dot)org</a></span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">Subject: [ADMIN] Please help (backup)</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">I have a backup done with "pg_dump" utility.</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">For some reason the backup file has 8 phisical bad sectors (17 KB of data)</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">Now when I try to restore the backup all tables are created successfully</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">and data of almost all tables restores successfully too, but one table</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">(the most important) appear empty.</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">When I do a pg_restore &lt;backup_file&gt; its show all sql instructions and</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">data until arrive to the "damaged sector" and throws a "out of memory"</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">exception.</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">I want to know if is possible to fix the backup file removing the blocks</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">in the "bad sectors" in order to restore all other information.</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">something like file dump surgery :)</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">Thanks!</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">Anibal</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">---------------------------(end of broadcast)---------------------------</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">TIP 4: Have you searched our list archives?</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">               <a moz-do-not-send="true"
href="http://archives.postgresql.org">http://archives.postgresql.org</a></span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">    </span></font></pre>
</blockquote>
<pre wrap=""><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">THINK BEFORE YOU PRINT - Save paper if you don't really need to print this</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">*******************Confidentiality and Privilege Notice*******************</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">The material contained in this message is privileged and confidential to</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">the addressee.  If you are not the addressee indicated in this message or</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">responsible for delivery of the message to such person, you may not copy</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">or deliver this message to anyone, and you should destroy it and kindly</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">notify the sender by reply email.</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">Information in this message that does not relate to the official business</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">Weatherbeeta, its employees, contractors or associates shall not be liable</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">for direct, indirect or consequential loss arising from transmission of this</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">message or any attachments</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">e-mail.</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">---------------------------(end of broadcast)---------------------------</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">TIP 1: if posting/reading through Usenet, please send an appropriate</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">       subscribe-nomail command to <a
moz-do-not-send="true" href="mailto:majordomo(at)postgresql(dot)org">majordomo(at)postgresql(dot)org</a> so that your</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">       message can get through to the mailing list cleanly</span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;"> </span></font></pre>
<pre><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt;">  </span></font></pre>
</div>
</div>
<br>
<p>THINK BEFORE YOU PRINT - Save paper if you don't really need to
print this e-mail.
</p>
<p><b>*******************Confidentiality and Privilege
Notice*******************</b>
</p>
<p>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.
</p>
<p>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
<br>
</p>
<pre wrap="">
<hr size="4" width="90%">
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.488 / Virus Database: 269.15.3/1082 - Release Date: 20/10/2007 14:59
</pre>
</blockquote>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 17.8 KB

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2007-10-22 14:39:38 Re: Please help (backup)
Previous Message yogesh 2007-10-22 12:03:52 Re: Postgres SQL with Suse Linux