Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 11 to 20 of 22 total |
Corrupt a database table? |
Tue, Apr 21 2015 3:00 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Aaron
>Exception: ElevateDB Error #601 The table <table name> is corrupt (The index __PrimaryKey contains duplicate keys). From a post back in 2007 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- << Occasionally I'm getting the following error. There is no contraint or primary key on this table, what is causing this and how can I avoid this problem. >> Repair the table - most likely it is corrupted. There is an internal primary key on the RowID when you don't explicitly define one, and you should never run into duplicate RowID values unless the table/indexes have been corrupted. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Best way to handle this type of corruption is to verify the table at start up and if errors are found initiate a repair. I would also recommend adding a primary key (say an autoinc or a guid). If it happens frequently see if you can create a test case and send it to Tim. If its a rare event then you could handle it in the same way I do. My apps have a screen for verifying / repairing / optimising the tables. It needs to be run without anyone else on the system. It reads in the tables associated with the app and allows the users to select which are to be operated on. Roy Lambert |
Tue, Apr 21 2015 4:18 AM | Permanent Link |
Matthew Jones | Roy Lambert wrote:
> Best way to handle this type of corruption is to verify the table at > start up and if errors are found initiate a repair. This is what my services do automatically. One of the tables is really big, so takes ages (I think I automatically repair anyway), so it is only done if the GoodShutdown.txt is not present. If someone killed the service, then that isn't created so it gets a full check. -- Matthew Jones |
Tue, Apr 21 2015 6:08 AM | Permanent Link |
Aaron Christiansen | To clarify, because I haven't made myself clear. I am not looking for how to fix this problem, I worked that out months ago.
I want a test database or table that has this error so I can prove to myself it works and because implementing an untested fix is not confidence inspiring.. Thanks. |
Tue, Apr 21 2015 6:42 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Aaron
've never had the error you have but here's how I treat table repairs DeleteFile(TableList_Table.AsString + dm.TfrSession.LocalTableIndexExtension); Actioneer.Close; Actioneer.SQL.Text := 'REPAIR TABLE ' + TableList_Table.AsString; Progress.Initialise(0, 100, TableList_Table.AsString); Actioneer.ExecSQL; It works. I will stake Matthew's life on it. This is an even more extreme case than yours - no indices at all Roy Lambert |
Tue, Apr 21 2015 6:49 AM | Permanent Link |
Matthew Jones | Roy Lambert wrote:
> I will stake Matthew's life on it. Phew, I'm glad you did rather than me. 8-) I just checked, and my ElevateDB version of my database checker is basically: {$IFDEF EDB_LATER} {$ENDIF} I must grab your code and get that working... -- Matthew Jones |
Tue, Apr 21 2015 7:40 AM | Permanent Link |
Aaron Christiansen | Wow.
|
Tue, Apr 21 2015 7:52 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Matthew
Do you want the form - it allows for verify, repair & optimise? If so the best approach would be to use the .pas as a basis cos I'd have to ship you my homebrew components as well. I don't mind doing it but I seem to recall you've spent a lot of money on DevEx. Roy Lambert |
Tue, Apr 21 2015 8:49 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Aaron
>Wow. Why wow? DBISAM had a force index rebuild flag, in the early days (and possibly still now) ElevateDB didn't. What it did do well was recreate missing files up to and including the full table. Zapping the index file at the OS level simply guaranteed all indices being rebuilt. Roy Lambert |
Tue, Apr 21 2015 8:50 AM | Permanent Link |
Matthew Jones | Roy Lambert wrote:
> Do you want the form - it allows for verify, repair & optimise? > > If so the best approach would be to use the .pas as a basis cos I'd > have to ship you my homebrew components as well. I don't mind doing > it but I seem to recall you've spent a lot of money on DevEx. I'm happy with any leg up that you want to give me. If you have components, I'll work out how to replace or whatever. My code is all run at service startup anyway, so there is no UI, just logging. But I do think it would be a good thing to be shared generally, so thanks for anything you can put up. -- Matthew Jones |
Tue, Apr 21 2015 11:30 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Matthew
Of to the binaries it went Roy Lambert |
« Previous Page | Page 2 of 3 | Next Page » |
Jump to Page: 1 2 3 |
This web page was last updated on Wednesday, May 15, 2024 at 08:40 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |