Unix Technical Forum

SOS. Database Lost

This is a discussion on SOS. Database Lost within the pgsql Admins forums, part of the PostgreSQL category; --> Hi All: I'm From Spain and I'll try to write in english as best as possible: I'm new in ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:07 AM
luis perruca
 
Posts: n/a
Default SOS. Database Lost

Hi All: I'm From Spain and I'll try to write in english as best as
possible:

I'm new in the list, and I have a serious problem: I am novice with
Postgresql and I haven't found any solution.
I Wil descrive the scenario:

I have Postgresql 8.0.1 running on Windows 2003 Server.
I have a Backup of my database, but is a little old

And here is my problem:

First, the Postgresql service didn't started (really started, but shut down
immediatly)
then I copied all the "postgresql" folder in other place, uninstalled and
reinstalled Postgresql, and then overwrite the "data" folder with the one
from the copy that I did.

Now, the service starts properly, but the database doesnīt work. I did
"pg_resetxlog" (I donīt know what it does, but I saw it somewhere).

From pgAdmin III, I see the database, I access it, I see the tables and
their properties, but no data. I get the error "xlog flush request
6D/432AAAA8 is not satisfied --- flushed only to 0/C03D020 CONTEXT: writing
block 925 of relation 16631/17254/18128" when I try to view the tables

I would need to know if I can recover the data from the tables and how to do
it.
I thank any suggestion that can help.

Luis Perruca

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:07 AM
cipher
 
Posts: n/a
Default Re: SOS. Database Lost

Hi,

I'm not a specialist in Postgres, but I would do the following:

1. Backup your data directories and install the old version of
postgres (8.0.1). It seems,
that the format of the data files has been changed.
2. Restore your data files. If you have luck, then your database
should be working.
3. After that, make a dump of your database(s). Under Linux, there is
a tool name "pg_dump".
Maybe use can also use pgadmin to create this dump. Note: pg_dump
writes to standard output - pipe it to a file!
4. Uninstall postgres and install the new version.
5. Execute the dump files. Under Linux, you can do so with the the
"psql" command.

I hope, this could be a litte help to you.


Greetings and good luck

Markus




On 20 Aug., 12:24, l.perr...@gmail.com ("luis perruca") wrote:
> Hi All: I'm From Spain and I'll try to write in english as best as
> possible:
>
> I'm new in the list, and I have a serious problem: I am novice with
> Postgresql and I haven't found any solution.
> I Wil descrive the scenario:
>
> I have Postgresql 8.0.1 running on Windows 2003 Server.
> I have a Backup of my database, but is a little old
>
> And here is my problem:
>
> First, the Postgresql service didn't started (really started, but shut down
> immediatly)
> then I copied all the "postgresql" folder in other place, uninstalled and
> reinstalled Postgresql, and then overwrite the "data" folder with the one
> from the copy that I did.
>
> Now, the service starts properly, but the database doesnīt work. I did
> "pg_resetxlog" (I donīt know what it does, but I saw it somewhere).
>
> From pgAdmin III, I see the database, I access it, I see the tables and
> their properties, but no data. I get the error "xlog flush request
> 6D/432AAAA8 is not satisfied --- flushed only to 0/C03D020 CONTEXT: writing
> block 925 of relation 16631/17254/18128" when I try to view the tables
>
> I would need to know if I can recover the data from the tables and how todo
> it.
> I thank any suggestion that can help.
>
> Luis Perruca



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:07 AM
Scott Marlowe
 
Posts: n/a
Default Re: SOS. Database Lost

On 8/20/07, luis perruca <l.perruca@gmail.com> wrote:
>
> Hi All: I'm From Spain and I'll try to write in english as best as possible:


Your english > my spanish, so please don't worry.

> I'm new in the list, and I have a serious problem: I am novice with
> Postgresql and I haven't found any solution.
> I Wil descrive the scenario:
>
> I have Postgresql 8.0.1 running on Windows 2003 Server.
> I have a Backup of my database, but is a little old


A pg_dump type backup, or a file system backup?

> And here is my problem:
>
> First, the Postgresql service didn't started (really started, but shut down
> immediatly)


What steps led to this happening. They might be important.

Did you install new /update software on this server? Especially
anti-virus software? That stuff's nearly as dangerous as a virus
itself for a database.

What are the exact error messages you got when this happened.

> then I copied all the "postgresql" folder in other place, uninstalled and
> reinstalled Postgresql, and then overwrite the "data" folder with the one
> from the copy that I did.


Did you shut down postgresql while you were copying those files back?

> Now, the service starts properly, but the database doesnīt work. I did
> "pg_resetxlog" (I donīt know what it does, but I saw it somewhere).


It reselts the transaction log pointer. It has likely set back in
time to when there was nothing in the database. Just guessing.

> From pgAdmin III, I see the database, I access it, I see the tables and
> their properties, but no data. I get the error "xlog flush request
> 6D/432AAAA8 is not satisfied --- flushed only to 0/C03D020 CONTEXT: writing
> block 925 of relation 16631/17254/18128" when I try to view the tables


Have you still got that old pg directory? Try shutting down pgsql,
copying the data part back in place, and restarting pgsql and see if
it starts up right or not.

> I would need to know if I can recover the data from the tables and how to do
> it.


Can't tell from what you've told us so far. Need more info of how you
got into this state and exact error messages you're getting as well.

My one piece of advice would be that if you data that's important,
look into running PostgreSQL (or any database really) on a unix box
with regular backups. If you must use windows use a single purpose
machine firewalled away from the rest of the universe with only a
pgsql port (5432) showing and no logins for anyone but the DBA to the
machine.

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 09:08 AM
Luis Perruca
 
Posts: n/a
Default Re: SOS. Database Lost

Scott Marlowe wrote:
> On 8/20/07, luis perruca <l.perruca@gmail.com> wrote:
>
>> Hi All: I'm From Spain and I'll try to write in english as best as possible:
>>

>
> Your english > my spanish, so please don't worry.
>
>
>> I'm new in the list, and I have a serious problem: I am novice with
>> Postgresql and I haven't found any solution.
>> I Wil descrive the scenario:
>>
>> I have Postgresql 8.0.1 running on Windows 2003 Server.
>> I have a Backup of my database, but is a little old
>>

>
> A pg_dump type backup, or a file system backup?
>
>

A file System backup
>> And here is my problem:
>>
>> First, the Postgresql service didn't started (really started, but shut down
>> immediatly)
>>

>
> What steps led to this happening. They might be important.
>
> Did you install new /update software on this server? Especially
> anti-virus software? That stuff's nearly as dangerous as a virus
> itself for a database.
>
> What are the exact error messages you got when this happened.
>
>

I don't remember exactly the error, but says something like "the service
started and then shut down. (some services shut down when have nothing
to do)". This really says nothing.
>> then I copied all the "postgresql" folder in other place, uninstalled and
>> reinstalled Postgresql, and then overwrite the "data" folder with the one
>> from the copy that I did.
>>

>
> Did you shut down postgresql while you were copying those files back?
>

Yes, postgresql was down when restoring the folder.
>
>> Now, the service starts properly, but the database doesnīt work. I did
>> "pg_resetxlog" (I donīt know what it does, but I saw it somewhere).
>>

>
> It reselts the transaction log pointer. It has likely set back in
> time to when there was nothing in the database. Just guessing.
>
>
>> From pgAdmin III, I see the database, I access it, I see the tables and
>> their properties, but no data. I get the error "xlog flush request
>> 6D/432AAAA8 is not satisfied --- flushed only to 0/C03D020 CONTEXT: writing
>> block 925 of relation 16631/17254/18128" when I try to view the tables
>>

>
> Have you still got that old pg directory? Try shutting down pgsql,
> copying the data part back in place, and restarting pgsql and see if
> it starts up right or not.
>

The service starts, but with the errors that I have told: I see the
tables but I get error or no data.
>
>> I would need to know if I can recover the data from the tables and how to do
>> it.
>>

>
> Can't tell from what you've told us so far. Need more info of how you
> got into this state and exact error messages you're getting as well.
>
> My one piece of advice would be that if you data that's important,
> look into running PostgreSQL (or any database really) on a unix box
> with regular backups. If you must use windows use a single purpose
> machine firewalled away from the rest of the universe with only a
> pgsql port (5432) showing and no logins for anyone but the DBA to the
> machine.
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-10-2008, 09:08 AM
Adam Radlowski
 
Posts: n/a
Default Re: SOS. Database Lost

Louis, first try to start Your PostgreSQL engine "with a hand" from
command line window like this:
/usr/local/pgsql/bin/postmaster -D /home/postgres/data/psql
....and look, what's will be happen.
Of course, these "/usr/local/pgsql/bin/" shold be Your path do
"postmaster" binary and "/home/postgres/data/psql" shold be Your
directory with data (it has very characteristical structure - with
subdirectories "base", "global", "pg_*" and (between other files) then
files "postgresql.conf" and "pg_hba.conf".
If You have problems with spaces in Your directory names (ex. "Program
Files") use the quotation marks.
It all looks, that You are starting postgreSQL with path to the
directory, where data are distroyed.
With greetings
Adam

Luis Perruca wrote:
> Scott Marlowe wrote:
>> On 8/20/07, luis perruca <l.perruca@gmail.com> wrote:
>>
>>> Hi All: I'm From Spain and I'll try to write in english as best as
>>> possible:
>>>

>>
>> Your english > my spanish, so please don't worry.
>>
>>
>>> I'm new in the list, and I have a serious problem: I am novice with
>>> Postgresql and I haven't found any solution.
>>> I Wil descrive the scenario:
>>>
>>> I have Postgresql 8.0.1 running on Windows 2003 Server.
>>> I have a Backup of my database, but is a little old
>>>

>>
>> A pg_dump type backup, or a file system backup?
>>
>>

> A file System backup
>>> And here is my problem:
>>>
>>> First, the Postgresql service didn't started (really started, but
>>> shut down
>>> immediatly)
>>>

>>
>> What steps led to this happening. They might be important.
>>
>> Did you install new /update software on this server? Especially
>> anti-virus software? That stuff's nearly as dangerous as a virus
>> itself for a database.
>>
>> What are the exact error messages you got when this happened.
>>
>>

> I don't remember exactly the error, but says something like "the
> service started and then shut down. (some services shut down when have
> nothing to do)". This really says nothing.
>>> then I copied all the "postgresql" folder in other place,
>>> uninstalled and
>>> reinstalled Postgresql, and then overwrite the "data" folder with
>>> the one
>>> from the copy that I did.
>>>

>>
>> Did you shut down postgresql while you were copying those files back?
>>

> Yes, postgresql was down when restoring the folder.
>>
>>> Now, the service starts properly, but the database doesnīt work. I did
>>> "pg_resetxlog" (I donīt know what it does, but I saw it somewhere).
>>>

>>
>> It reselts the transaction log pointer. It has likely set back in
>> time to when there was nothing in the database. Just guessing.
>>
>>
>>> From pgAdmin III, I see the database, I access it, I see the tables and
>>> their properties, but no data. I get the error "xlog flush request
>>> 6D/432AAAA8 is not satisfied --- flushed only to 0/C03D020 CONTEXT:
>>> writing
>>> block 925 of relation 16631/17254/18128" when I try to view the tables
>>>

>>
>> Have you still got that old pg directory? Try shutting down pgsql,
>> copying the data part back in place, and restarting pgsql and see if
>> it starts up right or not.
>>

> The service starts, but with the errors that I have told: I see the
> tables but I get error or no data.
>>
>>> I would need to know if I can recover the data from the tables and
>>> how to do
>>> it.
>>>

>>
>> Can't tell from what you've told us so far. Need more info of how you
>> got into this state and exact error messages you're getting as well.
>>
>> My one piece of advice would be that if you data that's important,
>> look into running PostgreSQL (or any database really) on a unix box
>> with regular backups. If you must use windows use a single purpose
>> machine firewalled away from the rest of the universe with only a
>> pgsql port (5432) showing and no logins for anyone but the DBA to the
>> machine.
>>
>>

>
>



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:15 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com