Re: Lost INDEX files
Posted in 1996
> news@nihc.demon.co.uk (news) writes:
> I recently had a problem when 5 or 6 tracks on the hard disk went bad.
> The result was several index files (*.idx) disapeared. Is there any way to
> rebuild the index files from the data files (*.dat). I copied an old index
> file to replace the missing one. Although file status reported 150 rows for
> one file; presumably from systables, running bcheck with the -s option
> did not recreate the 150 rows.
>
> I am using I4GL 4.0 on SCO Unix.
And it must be the SE engine of some version.
First you must make realy shure that only *.idx files realy disapeared.
May be part of your datafiles where interlieved between the *.idx's on the
same tracks?
If the *.idx-file you copied in realy is current in the sense that you didn't
modify any indexes (added or deleted any) since this file was created (and
obviously this must be an index file for the same table from some backup)
you should be able to run bcheck (with no options) on it and have the
indexes rebuilt.
Otherwise the safest route is probably to create a new table with exactly
the same fields and do:
insert into newtable
select * from oldtable
This doesn't use any indexes and have saved me in similar situations.
It should work even with a dummy *.idx file.
When you are shure all the data actually is in the new table you drop
the old one and rename the new to the old name and create indexes on it.
For those who wonder: A procedure like this is often *much* better than
reloding everything from backups even if you have them with logs and
everything.
Nils.Myklebust@ccmail.telemax.no
NM-data, Aasesvei 71, 1300 Sandvika, Norway
My opinions are those of my company