Re: Removing a corrupt database by hand

Поиск
Список
Период
Сортировка
От Mike Christensen
Тема Re: Removing a corrupt database by hand
Дата
Msg-id 499D0079.7020900@comcast.net
обсуждение исходный текст
Ответ на Re: Removing a corrupt database by hand  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-general
I get this:

C:\Program Files\PostgreSQL\8.3\data>..\bin\postgres.exe -d 5 -D .
2009-02-19 06:44:30 GMT DEBUG:  postgres: PostmasterMain: initial environ dump:
2009-02-19 06:44:30 GMT DEBUG:  -----------------------------------------
2009-02-19 06:44:30 GMT DEBUG:          ALLUSERSPROFILE=C:\Documents and Setting
s\All Users
2009-02-19 06:44:30 GMT DEBUG:          ClusterLog=C:\WINDOWS\Cluster\cluster.lo
g
2009-02-19 06:44:30 GMT DEBUG:          CommonProgramFiles=C:\Program Files\Comm
on Files
2009-02-19 06:44:30 GMT DEBUG:          COMPUTERNAME=KITCHENPC
2009-02-19 06:44:30 GMT DEBUG:          ComSpec=C:\WINDOWS\system32\cmd.exe
2009-02-19 06:44:31 GMT DEBUG:          CYGWIN=tty
2009-02-19 06:44:31 GMT DEBUG:          FP_NO_HOST_CHECK=NO
2009-02-19 06:44:31 GMT DEBUG:          lib=C:\Program Files\SQLXML 4.0\bin\
2009-02-19 06:44:31 GMT DEBUG:          NUMBER_OF_PROCESSORS=4
2009-02-19 06:44:31 GMT DEBUG:          OS=Windows_NT
2009-02-19 06:44:31 GMT DEBUG:          Path=c:\Perl\bin;C:\Perl\site\bin;C:\Per
l\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\M
icrosoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft Windows Small Busi
ness Server\Networking\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\
Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL S
erver\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Perforce\C:\Program Fi
les\Perforce
2009-02-19 06:44:31 GMT DEBUG:          PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.J
S;.JSE;.WSF;.WSH
2009-02-19 06:44:31 GMT DEBUG:          PROCESSOR_ARCHITECTURE=x86
2009-02-19 06:44:31 GMT DEBUG:          PROCESSOR_IDENTIFIER=x86 Family 6 Model
15 Stepping 11, GenuineIntel
2009-02-19 06:44:31 GMT DEBUG:          PROCESSOR_LEVEL=6
2009-02-19 06:44:31 GMT DEBUG:          PROCESSOR_REVISION=0f0b
2009-02-19 06:44:31 GMT DEBUG:          ProgramFiles=C:\Program Files
2009-02-19 06:44:31 GMT DEBUG:          PROMPT=$P$G
2009-02-19 06:44:31 GMT DEBUG:          SBSProgramDir=C:\Program Files\Microsoft
 Windows Small Business Server
2009-02-19 06:44:31 GMT DEBUG:          SystemDrive=C:
2009-02-19 06:44:31 GMT DEBUG:          SystemRoot=C:\WINDOWS
2009-02-19 06:44:31 GMT DEBUG:          TEMP=C:\DOCUME~1\postgres\LOCALS~1\Temp
2009-02-19 06:44:31 GMT DEBUG:          TMP=C:\DOCUME~1\postgres\LOCALS~1\Temp
2009-02-19 06:44:31 GMT DEBUG:          USERDNSDOMAIN=KITCHENPC.LOCAL
2009-02-19 06:44:31 GMT DEBUG:          USERDOMAIN=HOME
2009-02-19 06:44:31 GMT DEBUG:          USERNAME=postgres
2009-02-19 06:44:31 GMT DEBUG:          USERPROFILE=C:\Documents and Settings\po
stgres
2009-02-19 06:44:31 GMT DEBUG:          VISUALSVN_SERVER=C:\Program Files\Visual
SVN Server\
2009-02-19 06:44:31 GMT DEBUG:          windir=C:\WINDOWS
2009-02-19 06:44:31 GMT DEBUG:          winsbprogramdir=C:\Program Files\Windows
 for Small Business Server
2009-02-19 06:44:31 GMT DEBUG:          PGLOCALEDIR=C:/Program Files/PostgreSQL/
8.3/share/locale
2009-02-19 06:44:31 GMT DEBUG:          PGSYSCONFDIR=C:/Program Files/PostgreSQL
/8.3/etc
2009-02-19 06:44:31 GMT DEBUG:          LC_COLLATE=English_United States.1252
2009-02-19 06:44:31 GMT DEBUG:          LC_CTYPE=English_United States.1252
2009-02-19 06:44:31 GMT DEBUG:          LC_MONETARY=C
2009-02-19 06:44:31 GMT DEBUG:          LC_NUMERIC=C
2009-02-19 06:44:31 GMT DEBUG:          LC_TIME=C
2009-02-19 06:44:31 GMT DEBUG:          LC_MESSAGES=English_United States.1252
2009-02-19 06:44:31 GMT DEBUG:  -----------------------------------------
2009-02-19 06:44:31 GMT DEBUG:  TZ "US/Pacific" matches Windows timezone "Pacifi
c Standard Time"
2009-02-18 22:44:31 PST LOG:  loaded library "$libdir/plugins/plugin_debugger.dl
l"
2009-02-18 22:44:31 PST DEBUG:  invoking IpcMemoryCreate(size=38395904)
2009-02-18 22:44:31 PST DEBUG:  max_safe_fds = 987, usable_fds = 1000, already_o
pen = 3



And it stays there forever..  I'm mucking around with stuff in the debugger right now and it's looking like it's crashing due to bad file handles..  In fact, this line might be the culprit:

SysLoggerPID = SysLogger_Start();

If I skip over it, it continues but then gets other errors due to bad file handles..  Heh, whatever I did totally wrecked the DB..  We really need some sort of dbrepair tool one of these days..

Mike

Joshua D. Drake wrote:
On Wed, 2009-02-18 at 19:58 -0800, Mike Christensen wrote: 
I have two questions actually..

First off, is there a way to remove a database if the postgres.exe 
service won't start?  It seems if I just delete the data\base\xxxxx 
directory, then postgres will crash.  Is there a way to drop a DB that 
prevents postgres.exe from starting?
   
What happens if you start postgresql in single user mode?
 
Second question, if I just re-install postgres and create a fresh new 
instance, is there a way to import my old data files back into the 
database?  Thanks!

Mike
   

В списке pgsql-general по дате отправления:

Предыдущее
От: "Sameer Mahajan"
Дата:
Сообщение: postgres wish list
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: how to do this select?