pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: akanksha kulkarni <akanksha_kul@yahoo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: reconstructing database
Date: Wed, 6 Oct 2004 09:27:35 -0700 (PDT)
Message-ID: <20041006162736.45531.qmail@web52905.mail.yahoo.com> (raw)
In-Reply-To: <23946.1096568539@sss.pgh.pa.us>

Hi Tom,

I am still not able to recover my old postgres
database.

As postmaster was not starting due to invalid
checkpoints, I ran pg_resetxlog utility . After that 
postmaster started, but I am not getting complete
data.
I made pg_dump of database but that comes out to be
very small file. I am sure most of the data is not
there.

Also most of the tables are showing empty when I
connect to database. 

I have old /data directory with me.

Is there any other way to extract data from raw data
files in /data/base.

I have found one of your posting related to this in
DBForums which is as below. Can you explain a little
bit more about 0x55 stuff.

Or if you know of some tool/script/postgres recovery
specialist(person) to extract data from raw /data
files, PLEASE let me know. 

Thanks for your help.

********* your reply to mlw's posting
**********************
Re: Recovery tools 

--------------------------------------------------------------------------------

mlw writes:
  > Just suppose that all the log files are gone, and
the only thing left is 
  > some of the files in the /data directory. Is there
any way to scan this 
  > data and dump it to a file which could
subsequently be used with a "COPY 
  > FROM STDIN" on a new database?

There aren't separate tools, and I'm not sure there
could or should be.
What I'd do in that situation is:
* pg_resetxlog to get a minimally valid xlog
* if clog is missing, gin up files containing 0x55
everywhere
(to make it look like every transaction has committed
--- or
put 00 everywhere if you'd rather assume that recent
transactions all aborted)
* start postmaster, look around, fix problems until I
can pg_dump.

AFAICS, you can make tools that work at the page/item
level (like
pg_filedump, see http://sources.redhat.com/rhdb/), but
there is hardly
any scope for doing anything intermediate between that
and a full
postmaster. There's no hope of decoding the contents
of a tuple without
access to the table's tuple descriptor, which means
you need most of the
system catalog mechanisms; plus you'd need the I/O
routines for the
datatypes involved. Might as well just use the
postmaster as your data
inspection tool.

regards, tom lane
 ***************************************************




 



--- Tom Lane <tgl@sss.pgh.pa.us> wrote:

> > 5. I then tried uninstalling new version by giving
> > command gmake clean. I also moved the new data
> > directory to temp directory.
> 
> "gmake clean" is not going to do an uninstall.
> 
> > 6. I reinstalled old version of postgres from RH
> > package manager.I copied old data directory of
> > previous install of older version of postgres and
> then
> > tried running postmaster but it didn't ran saying
> > there is newer version of postgres. 
> 
> I think you had both sets of executables installed
> at once and somehow
> you were picking up the wrong one.  There is nothing
> wrong with your old
> data directory, it's the executables you need to get
> straight.
> 
> 			regards, tom lane
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com



view thread (3+ messages)

Message-ID: <20041006162736.45531.qmail@web52905.mail.yahoo.com>
Permalink:  ../20041006162736.45531.qmail@web52905.mail.yahoo.com/
Also on:    postgresql.org/message-id/20041006162736.45531.qmail@web52905.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: akanksha_kul@yahoo.com, tgl@sss.pgh.pa.us
  Subject: Re: reconstructing database
  In-Reply-To: <20041006162736.45531.qmail@web52905.mail.yahoo.com>
  References: <23946.1096568539@sss.pgh.pa.us> <20041006162736.45531.qmail@web52905.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox