Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Index Corruption

Status
Not open for further replies.

jrajesh

Programmer
Aug 12, 2001
72
HK
Hi,
We run an application with 6 tables in a DBC.
The cdx of just one table ('Vendors') keeps getting corrupted off and on.
(There are no triggers in the dbc for any of the tables.)

The structure of the table:
VENDOR Character 40
PHONE Character 15
FAX Character 15
EMAIL Character 40
ADD1 Character 30
ADD2 Character 30
ADD3 Character 30
CITY Character 10
COUNTRY Character 20
TELEX Character 10
BUSINESS Character 25
CONTACT Character 30

The table contains 1520 records and the indexed columns are:
Vendor, business, country, city and contact.

Could someone please advise me on the possible cause of this corruption?

Thanks and best regards,
Rajesh
 
Rajesh,

Is this a shared table on a network drive?



Regards

Griff
Keep [Smile]ing
 
GriffMG,
Thanks for your reply.
Yes, it is a shared table on the network.
Buffering is set to 3.

Regards,
Rajesh
 
Hi,

I'm not 100% sure with this, but if the server is an MS Windows one - you MIGHT be having opportunistic file locking problems.

The vendor file is fairly small, and NT might be grabbing it for the first client.

Cut and paste the following into a file called woplocks.reg
and run it on the workstations

Code:
REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkStation\Parameters]
"EnableOplockForceClose"=dword:00000001
"EnableOplocks"=dword:00000000
"UseOpportunisticLocking"=dword:00000000

Cut and paste the following into a file called soplocks.reg
and run it on the server

Code:
REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
"EnableOplockForceClose"=dword:00000001
"EnableOplocks"=dword:00000000

That will disable it in most cases.


Regards

Griff
Keep [Smile]ing
 
Griff,
Thanks again for your reply.
Could you perhaps explain what is being done to the registry with the set of instructions that you've given.

Incidentally, I've dbfs with just 20 records (User) and Accounts (100 recs.). Nothing happens to these files :-(

I'll talk to the Network person & find out the server config etc., just in case.
Thanks again for the help.
Best regards,
Rajesh
 
Rajesh

This is clutching at straws really, there is no good reason why an index on a small file like this should be corrupt - there are two or three possibilities:

1) On a network, a client could be crashing out of the application without updating the file.

2) The network client, server or cabling might be damaged and not all the data going back and forth cleanly.

3) The server is applying the op. locking trick on one of the files (the data) but not the index or vica versa...

The registry entries come from MS, they inhibit the servers desire to supply files locked exclusively (which NT does to try and improve it's performance) even when a client has asked to open them in shared mode.

The clients can also apply the same technique - so the registry entries for them do the same sort of thing.

I can't be sure the files will help - but they do remove one set of possibilities and generally I try to ensure they are applied to any server and workstation running a VFP application, before I try much else.



Regards

Griff
Keep [Smile]ing
 
Griff,
Thanks for your explanation.
Have incorporated your code on the server and clients.
Have to wait for a few days and find out whether this
works or not.
Thanks again for your help.
Best regards,
Rajesh
 
Rajesh:

Just curious, have there been any hardware changes on the network including changes (adding RAM for instance) to the server?

Has the problem been there since the first day or did it start happening after a time with no problems?

Also, the Opportunistic Locking issue mentioned above can cause problems. The reason it's there is to speed up LAN performance. Your best bet is to do what you have done by turning this feature off.

Having said all that, I would still suspect the data in that particular table as the source of the problem. 1500 or so records is NOTHING for a Foxpro table. I would check the table data with something like STonrefield's toolkit.

As well, delete and recreate the index tags.
DELETE TAG ALL
Close the file.
Re-open it and create your indecies.

Or, copy the table to another one, delete the original, and copy it back.

Just some tricks that have worked for me in the past.

Bill


 
Steve,
I have to agree with Craig on this one - it's working for me. In fact, I ALWAYS check a link before posting it, simply because things change so often on the net. Of course just because a link works &quot;now&quot; doesn't mean it will when you read this <s>.

Rick
 
It wasn't working earlier when Steve pointed it out - perhaps Craig's server was down or his ISP off line.



Regards

Griff
Keep [Smile]ing
 
I also have experienced problems getting to Mr. Berntson's site. HTTP 404 - Error File Not Found or I will get the Go Daddy main page (which I am getting this afternoon). However, usually if I am persistent and patient it will usually come back online and then I can get in.

Slighthaze = NULL
 
Is this a dynamic DNS type of thing - the site is great, in case anyone wants to know!


Regards

Griff
Keep [Smile]ing
 
wtotten,
I believe there are no hardware changes. Shall anyway checkup with our network admin and revert on this.

This problem has been persistent from day one.
Only, there is no pattern to it. Would work for a long time and then suddenly crash.
I've always been deleting the tags and recreating the index. This fixes the index for a few months and then the corruption happens again.
Regards,
Rajesh
 
Jrajesh:

Here's another thought; I have run into this problem/solution 3 times. The scenario was in a Compaq server using third-party (non-Compaq) RAM. It's a longshot, but ....

Bill
 
I found the issues with my site. My domain name registration had expired and I was not notified of this. I have reregistered it. It should be available no later than 48 hours.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports&quot;
 
wTotten,
Nope. The RAM thingy is also ok. I checked with our network guys.

RGBean,
Shall cross-check the list as in the article.

Craig, Nice article this.

wTotten, RGBean, Craig:
Thanks all. This is one of the most helpful forums. Very proud to be a member.

Cheers,
Rajesh
 
Set the way back meter to early nineties:
Novell tried to speed up client access where they would actually cache file and record locks on the client, in the client32 buffers.
they called it opportunistic locking.
Its off in current client versions.

MS never really implemented client app record locking correctly. In fact the Windows Server 2003 (SMB) code hasnt changed since they bought it from 3com 3OPEN/ LAN Manager days (OS/2).

Fox figured out how to do its own record locking and also its own buffering. Thats why indexes get corrupt alot.

Anyone else?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top