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

RE: [cobalt-users] HOWTO: Rebuild PostgreSQL 'cobalt' database due to corrupt quota table



Hello Bruce,

I followed everything but I have the following error when I erase the
'cobalt' database: (After the DEEP BREATH)


[postgres@ns1 pgsql]$ destroydb cobalt
Connection to database 'template1' failed.
No pg_hba.conf entry for host localhost, user postgres, database
template1
destroydb: database destroy failed on cobalt.

----------

In my original pg_hba.conf file I had the following line:
Local COBALT crypt (an not local ALL crypt)

I changed this into

Local cobalt trust  or must this be local ALL trust ??

Can you give me some more advise ?

Thanks 

Steven Depuydt
www.BeNe.WS 

-----Oorspronkelijk bericht-----
Van: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx] Namens Bruce Timberlake
Verzonden: zondag 8 december 2002 19:43
Aan: cobalt-users@xxxxxxxxxxxxxxx
Onderwerp: [cobalt-users] HOWTO: Rebuild PostgreSQL 'cobalt' database
due to corrupt quota table

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Can you tell me what you have done (DETAILED) because I have the
> same problems with my RAQ3I and I have also the same error message
> with DiskUsage.

HOWTO: Rebuild the PostgreSQL database "cobalt" due to corrupt quota 
table

CAUTION: This procedure completely deletes and recreates the 'cobalt' 
database. Use with care, as this database holds all the info about 
every domain on your RaQ. If you mess it up, you might as well 
reformat the drive and start over...

NOTE: This procedure should work for RaQ3 and RaQ4.  RaQ3 is the model 
with this problem, but the database is the same between the 2 
systems.


*** 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 ***

- -- 
Bruce Timberlake

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE985K5vLA2hUZ9kgwRAvCKAJ9VEeQ5o03ocvGFWbQQE71DNOaHxwCfQANE
JbfmngZPrFLt4IKAxxaH6AU=
=5Wag
-----END PGP SIGNATURE-----

_____________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To subscribe/unsubscribe, or to SEARCH THE ARCHIVES, go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.427 / Virus Database: 240 - Release Date: 6/12/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.427 / Virus Database: 240 - Release Date: 6/12/2002