[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Rebuild PostgreSQL 'cobalt' database



>On Wed, 4 Jun 2003, Bo von Hohenlohe wrote:
>
>> RE: Rebuild PostgreSQL 'cobalt' database
>>
>> 1) Before I Rebuild PostgreSQL 'cobalt' database I tried to check my data
>> base for errors per
>> http://list.cobalt.com/pipermail/cobalt-users/2002-December/082670.html :
>>
>> su - postgres
>> psql cobalt
>> SELECT * FROM quota;
>>
>> 2) I get:
>>
>> [root@ns1 /root]# su - postgres
>> [postgres@ns1 pgsql]$ psql cobalt
>> Connection to database 'cobalt' failed.
>> fe_sendauth: no password supplied
>
>did you change pg_hba.conf
>#local cobalt crypt
>local all trust
>
>> Where can I find the password for the cobalt data base? The password for
>> admin/root does not work.


>
>the password is in /etc/cobalt/.meta.id
>But you shouldn't need it if you changed
>did you change pg_hba.conf
>
>Make sure you change it back when you are finished
>
>Gerald
>--



Attention Gerald:

1) I have been receiving a message from admin. Here is one line:
NOTICE:  Index pg_attribute_attrelid_index: NUMBER OF INDEX' TUPLES (592)
IS NOT THE SAME AS HEAP' (583) Please confirm that this indicates the need
to rebuild the cobalt data base.

2) ValueWeb/Affinity where I lease my servers want to charge me $150 to
rebuild the data base, which is nuts, so I must attempt to do it myself. If
the rebuild fails I want to be assured that I can reverse the process. What
is the procedure for restoring the original (although corrupted) database?

3)  I am rebuilding the data base on my RaQ3, where the path is
/home/pgsql, but on my RaQ4  /home/pgsql does not exist. Where is the
directory I need to be in on my RaQ4?

4) Please clarify these commands:
At "cobalt=>" prompt type "SELECT * FROM quota;" and press Enter.
How do I get "At "cobalt=>"?

5) Other instructions I found on the net recommend that one should comment
out rather than deleting the following. What is the best thing to do?

REMOVE THE QUOTA STUFF (SINCE IT'S BROKEN ANYWAY):
- -  Edit 'cobalt-schema' and remove the 'CREATE TABLE "quota" ( );"
section (spread over 2-3 lines)
- -  Remove the 'COPY "quota" FROM stdin;' line (end of schema file)
- -  Exit editor and save changes

6) Here is your script I found at
http://list.cobalt.com/pipermail/cobalt-users/2002-December/082670.html
Would you please confirm integrity.

Thank you very much for your time.

*** START OF PROCEDURE ***

MAKE IT SO THAT WE CAN GET EASIER ACCESS TO THE DATABASE:

- -  Establish shell session as root
- -  cd /home/pgsql
- -  cp pg_hba.conf pg_hba.conf.safe
- -  Edit pg_hba.conf and change "local all crypt" to "local all trust"
- -  su - postgres
- -  psql cobalt

CONFIRM THE ERROR:

- -  At "cobalt=>" prompt type "SELECT * FROM quota;" and press Enter.

   If you see "ERROR:  cannot find attribute 1 of relation quota" then
the quota table is corrupt

   If you do not get an error, STOP. The quota table is not the
problem.

- -  \q (to exit psql tool)

SAVE THE DATABASE SCHEMA:

- -  pg_dump cobalt > cobalt-schema

REMOVE THE QUOTA STUFF (SINCE IT'S BROKEN ANYWAY):

- -  Edit 'cobalt-schema' and remove the 'CREATE TABLE "quota" ( );"
section (spread over 2-3 lines)
- -  Remove the 'COPY "quota" FROM stdin;' line (end of schema file)
- -  Exit editor and save changes

TAKE DEEP BREATH AND DESTROY EXISTING (but corrupt) 'cobalt' DATABASE:

- -  destroydb cobalt
- -  createdb cobalt

REBUILD THE 'cobalt' DATABASE FROM THE SCHEMA FILE:

- -  psql cobalt < cobalt-schema
- -  exit (to become root again)

RUN SCRIPT TO REBUILD QUOTA TABLE:

- -  /usr/local/sbin/swatch

CHECK TO MAKE SURE IT WORKED:
- -  su - postgres
- -  psql cobalt
- -  SELECT * FROM quota;
        You should not get an error message this time...
- -  \q

- -  Go into the UI and try stuff to make sure UI works too

- -  exit (to become root)

CLEAN EVERYTHING UP:

- -  rm cobalt-schema
- -  mv pg_hba.conf.safe pg_hba.conf

*** END OF PROCEDURE ***

Bo von Hohenlohe
Bo von Hohenlohe Productions
bvhprods@xxxxxxx
http://www.artfreak.com
http://www.maddogcom.com/