Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2808
  • Last Modified:

corrupt table how to fix?

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 :)

  • 4
  • 2
1 Solution
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.

aranaAuthor Commented:
thanks for the info.

what about rebuilding indexes? and DDF?
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.
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

aranaAuthor Commented:
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
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?
L PCommented:
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.

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now