?
Solved

corrupt table how to fix?

Posted on 2003-03-14
7
Medium Priority
?
2,764 Views
Last Modified: 2016-09-12
pervasive 2000

i have never used pervasive , i once used btrieve back in the gwbasic days (a lot of time eh?)
 
i am mostly into oracle,vb,mssql and other, but not pervasive,

The problem is a friend wich has no idea of nothing hehe, got a corrupt table and their frontend system is crashing, so she viewed the data using some pervasive tool, and says data from the last record "JUMPED FIELDS"
that is data from one field appeared in another and so on, the data jumped to the next field in the table, so data that should be on a field date appeared in another field, data from some numeric id, appeared in a description field, etc
i tought this was a development bug, but she said she has being using that system for two years without problems , and even if it was, the how could DATE data get into another field 8maybe in pervasive is possible, but not in other DBMS i know),
the question:
how to repair that table or the  database?
how to invoke the repair utility if there exists one?
or how to manually deal with the problem?

HAVE TRIED: copying all data to another table but she cannot! (some error about indexes being wrong ), she cannot delete that last record also
so i think that she shold REPAIR , but she does not know how, neither do i

HELP PLEASE, i know it is not much info, but she is not a tech user, and she is not in my city, so if you need to know anything, just ask me , so i can ask her :)


0
Comment
Question by:arana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 3

Accepted Solution

by:
jbuttery earned 1000 total points
ID: 8174306
Sounds like there's no backup? 1st make a copy of the file.

Then, go to a dos prompt and type
butil -stat database.btr

This will give you the number of records in the file. Write it down or do butil -stat database.btr>allrecs.txt to save to a file.

Go to a dos prompt and type
butil -save database.btr database.sav

This will save all the records into a sequential ASCII file, even the damaged ones. You might use this later to repair corrupt records.

Go to a dos prompt and type
butil -recover database.btr database.rec Make a note of the number of records recovered.

This will save all the non-corrupt records into a sequential ASCII file.

Go to a dos prompt and type
butil -clone database.cln database.btr

This will make a blank file with the same structure as the original file.

Go to a dos prompt and type
butil -load database.rec database.cln

This will insert the recovered records into the blank file.

Rename database.btr to database.org

Copy database.cln to database.btr

Use the Pervasive tool or the app to check the database.

Or you can zip the file and e-mail to me. Good luck.






0
 
LVL 11

Author Comment

by:arana
ID: 8175338
thanks for the info.

what about rebuilding indexes? and DDF?
0
 
LVL 3

Expert Comment

by:jbuttery
ID: 8175382
The recover and load should take care of the indexes. The DDFs will not need to change as long as the file is in the same directory as before.
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 3

Expert Comment

by:jbuttery
ID: 8214036
Well?
0
 
LVL 11

Author Comment

by:arana
ID: 8226688
THANKS A LOT, this was going ok, as you said and as she expected, at the asmetime their system provider was helping them and they finished very quick (it cost a lot also, but was not my money or hers hehe),

your answer is good and was doing the job, my friend is not so good, and she was slower than the service provier, anyhow thanks for the info, since thanks to it NOW I KNOW at least two things about pervasive  and how it works

1.- it can be fixed
2.- stay away from it!   :P :D
0
 
LVL 3

Expert Comment

by:jbuttery
ID: 8227079
Pervasive rocks! It's the fastest around. I have customers with over 20 million records in a DB and they get sub-second retrievals. But, if you don't know what you are doing, stay away.

Note: The database should be faster and smaller now that she rebuilt the indices.

Why did they pay someone?
0
 

Expert Comment

by:L P
ID: 41794895
Thank you so much for this article.  I tested on a file with a status 2 Disk I/O error and managed to recover 108013 records out of 108015.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question