kdbfchk questions

Post Reply
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

kdbfchk questions

Post by jkj2001 »

We've got what appears to be a messed up database. Even when running an innocuous command such as "select * from SYSINDEX", this appears:

005 Can't read 0x7012 bytes at 0xDFA in KDBF file /database/principalfa/tbldoc/S
YSINDEX.tbl: error 0: Unknown (Read past EOF) in the function read_rest_data
000 Could not open SYSINDEX in the function ddopen
000 Couldn't connect to . in the function SQLConnect


So, it would appear it's time for some kdbfchk. Only thing is, we're not sure what syntax to use to repair the tables with-- do we need to run the command for SYSINDEX as well as our own table? If so, what flags should we use? Thanks for the help.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

kdbfchk questions

Post by mark »

You only need to repair files that are corrupt (give errors).
kdbfchk is documented at http://www.thunderstone.com/site/texisman/node305.html

basically something like:

stop all database activity
mv SYSINDEX.tbl bad-SYSINDEX.tbl
kdbfchk -o SYSINDEX.tbl bad-SYSINDEX.tbl
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

kdbfchk questions

Post by Kai »

That's a lower-case -o, not upper case -O, in this case.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

kdbfchk questions

Post by mark »

oops. fixed.
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

kdbfchk questions

Post by jkj2001 »

This just happened again, on a separate database. Unfortunately, the fix listed above didn't seem to work. Here's what I get:

myserver>>kdbfchk -o SYSINDEX.tbl badSYSINDEX.tbl
Checking file badSYSINDEX.tbl:
Reading free tree and list
0% 50% 100%
-------------------------------------------------------------------------------
Scanning for orphaned free tree pages
0% 50% 100%
###############################################################################
Free tree and list appear intact
Repairing KDBF file
0% 50% 100%
###############################################################################
Bad block summary:
1 orphaned free block found
*** Corruption detected ***





This appears to be a problem on *all* the SYS tables. For instance:

myserver >>kdbfchk SYSUSERS.tbl
Checking file SYSUSERS.tbl:
Reading free tree and list
0% 50% 100%
-------------------------------------------------------------------------------
Scanning for orphaned free tree pages
0% 50% 100%
###############################################################################
Free tree and list appear intact
Scanning data blocks
0% 50% 100%
###############################################################################
Bad block summary:
1 data block deleted
1 free block pad inserted
*** Corruption detected ***


However, it's not a problem on any of our non-SYS tables in this database. Have you ever seen this before? Last time, we simply moved our tables to another directory and recreated the indexes, but it would be good to avoid this if at all possible. Thanks for the help.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

kdbfchk questions

Post by mark »

It appears to have fixed them ok. The orphan blocks will remain orphans and still be reported if you the fix again. We've not heard of that happening unless there's some problem with the disk or you're using singleuser mode when you're really not singleuser. What's your texis version and release (texis -version)?
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

kdbfchk questions

Post by jkj2001 »

Here's our texis version. I don't believe it's singleuser mode, but I don't know if this reveals that or not:

Texis Web Script (Vortex) Copyright (c) 1996-2001 Thunderstone - EPI, Inc.
Commercial Version 3.01.984591953 of Mar 14, 2001 (sparc-sun-solaris2.6)


If it's our disk causing this problem both times, why would only the SYS* tables be affected, and not our much larger, man-made tables?

FYI, after running kdbfchk -o on the SYSINDEX table and moving the "fixed" one back into place, we still get the same "Could not open SYSINDEX in the function ddopen" message when trying to select from it.

We've been fortunate in that only the SYS* tables have been affected thus far, as we can move our own tables to another directory, run addtable, and reindex. Again, if you've seen this before or have any ideas what might be happening, please share your theories (crazier the better), and thanks again.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

kdbfchk questions

Post by mark »

Singleuser mode would be set in your vortex scripts or c programs. You have to look at the code.

No particular ideas. If you open a ticket we can arrange to get one of your corrupted SYS files and see what happened to it.
Post Reply