473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to Fix Corrupt Tables

JohanK
13
Hi there, i'm busy with quite a large project using PostgreSQL. Now the problem is that one of our data tables seems to have been corrupted. I cant open the table certain SQL queries like select does return results but the returned results are selective meaning that only certain fields are returned and not every thing that you asked for.

Is there a way to fix this or would we need to recreate the table and reload it with the data from the begining.

PS: attempts to export the data in the table have failed thus far.

Thanx in advance

Johan Kestlmeier
Jan 31 '07 #1
3 27034
michaelb
534 Expert 512MB
You did not give enough information to understand what's going on with your db.
I would suggest to open psql session and run these queries:

1.\d -- display table listing
2 \d my_bad_table -- display the table defiunition
3. select count (*) from my_bad_table ;
4. vacuum;
5 vacuum analyze;
6. vacuum full;

If you have a problem at some point one of these commands would most likely result in an obvious error.
Copy and paste here all output.


IMPORTANT:
Make sure that you created db backup before going through with this.
pg_dump may not work if you have corrupted db, stop database and create a recursive copy or tar-ball of your data directory.
Jan 31 '07 #2
michaelb
534 Expert 512MB
If you intend to continue using database replace it with your backup after you encountered errors from the commands I suggested above.
Make sure you stop the server before you create a backup or put it back in place.
Jan 31 '07 #3
JohanK
13
Thanx for the help

JohanK
Feb 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Amy DBA | last post by:
OK, I'm stumped now. I need help restoring a tablespace that has been marked offline. Here's a little background on the problem: 1) There was a hardware failure that caused the tablespace to...
4
by: aaj | last post by:
Hi all I have been given a corrupt access 2000 backend and asked to salvage the data.(youve gussed it, no backup) On trying to open it just kicks me out saying its not a valid database file -...
21
by: Dan | last post by:
Hi, just ran into my first instance of a backend Access97 database not compacting. I'm getting the "MSACCESS.EXE has generated errors.." message on compact. I've narrowed it down to the largest...
6
by: Annette Massie | last post by:
I have an 2000 database that is getting corrupt many times a day. The application is sittin on a network with about 5 users accessing it. Most times I get a call with the user saying the...
9
by: Bungle | last post by:
Hi There, Does anybody know where i might be able to locate a tool/application that can determine whether a Database is corrupt?? Also, can a bad network connection cause a corruption to a...
4
by: nepdae | last post by:
Well, after reading and hunting all over the web, including here, I still haven't been successful in my attempts to resolve my situation. So, I thought maybe I'd just ask. Here's the situation: ...
5
by: Bob Darlington | last post by:
Does anyone have a function which can be used to check tables in a db for corruption? I want to run such a routine to ensure that backups are not being saved with corrupt data. -- Bob...
3
by: nimajneb via AccessMonster.com | last post by:
Can anyone offer me any insight on the following problem? I have an Access database on a company shared drive. I'm the designer and the only user (so far). Suddenly, any time I try to open a...
0
by: Phil Stanton | last post by:
Sorry to repost this but I now seem to have the BE datbase corrupted. I have a FE, BE database on my home computer and a duplicate on the office computer. Both use Ak2 on Windows XP. The one at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.