Re: Postgres Dropped DB have recovered files how to restore

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: lifetronics <lifetronics(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres Dropped DB have recovered files how to restore
Date: 2016-06-06 20:57:54
Message-ID: 3352202d-a288-5d98-4a17-d3f337434a60@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/04/2016 01:20 PM, lifetronics wrote:
> This morning I accidently deleted my database for my OpenERP accounting. I
> did not have a good backup system setup so I was unable to do a system
> restore. i did manage to recover the files the drop command removed but I
> dont know how to get the DB back into postgres? Can anyone help me with
> this. I realy need this db to be restored otherwise I am screwed.
>
> These are the folders I recovered(i think my db was in the \base\19456
> folder):
>
> C:\Program Files (x86)\OpenERP
> 7.0-20141104-021038\PostgreSQL\data\base\19456\ *
>
> C:\Program Files (x86)\OpenERP
> 7.0-20141104-021038\PostgreSQL\data\base\19456\ *
>
> C:\Program Files (x86)\OpenERP
> 7.0-20141104-021038\PostgreSQL\data\base\311296
>
> C:\Program Files (x86)\OpenERP
> 7.0-20141104-021038\PostgreSQL\data\global\pg_internal.init\ *
>
> C:\Program Files (x86)\OpenERP
> 7.0-20141104-021038\PostgreSQL\data\pg_stat_tmp\ *
>
> I am running Windows Server 2012 R2 and postgres 9.3. Any help wil be much
> apreciated I am kind of desperate.

This is what a complete $DATADIR for 9.3 looks like on a Linux source
install:

postgres(at)killi:/usr/local/pgsql93/data> l
total 140
drwx------ 16 postgres users 4096 Jan 11 09:06 ./
drwxr-xr-x 7 root root 4096 Jun 27 2013 ../
drwx------ 14 postgres users 4096 Jun 4 2015 base/
drwx------ 2 postgres users 4096 Nov 18 2015 global/
drwx------ 2 postgres users 4096 Jun 27 2013 pg_clog/
-rw------- 1 postgres users 4476 Jun 27 2013 pg_hba.conf
-rw------- 1 postgres users 1636 Jun 27 2013 pg_ident.conf
drwxr-xr-x 3 postgres users 36864 Jan 11 08:42 pg_log/
drwx------ 4 postgres users 4096 Jun 27 2013 pg_multixact/
drwx------ 2 postgres users 4096 Jan 11 08:42 pg_notify/
drwx------ 2 postgres users 4096 Jun 27 2013 pg_serial/
drwx------ 2 postgres users 4096 Jun 27 2013 pg_snapshots/
drwx------ 2 postgres users 4096 Jan 11 09:06 pg_stat/
drwx------ 2 postgres users 4096 Jan 11 09:06 pg_stat_tmp/
drwx------ 2 postgres users 4096 Apr 26 2015 pg_subtrans/
drwx------ 2 postgres users 4096 Feb 23 2015 pg_tblspc/
drwx------ 2 postgres users 4096 Jun 27 2013 pg_twophase/
-rw------- 1 postgres users 4 Jun 27 2013 PG_VERSION
drwx------ 3 postgres users 4096 Jun 4 2015 pg_xlog/
-rw------- 1 postgres users 20329 Jan 11 09:06 postgresql.conf
-rw------- 1 postgres users 63 Jan 11 08:42 postmaster.opts

So if what you show is everything then you are short some important
directories.

>
>
>
>
> --
> View this message in context: http://postgresql.nabble.com/Postgres-Dropped-DB-have-recovered-files-how-to-restore-tp5906468.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Cramer 2016-06-06 22:18:22 Re: Postgres Dropped DB have recovered files how to restore
Previous Message Tom Lane 2016-06-06 20:47:50 Re: Why threads every 30 seconds?