SE 4.10 bcheck<文件名>、SE 2.10 bcheck<文件名.ext>以及其他bcheck异常

发布于 2024-09-10 21:18:39 字数 1915 浏览 6 评论 0原文

ISQL-SE 4.10.DD6 (DOS 6.22):

BCHECK  C-ISAM B-tree Checker version 4.10.DD6  

C-ISAM File: c:\dbfiles.dbs\*.*

ERROR: cannot open C-ISAM file

在 SE2.10 中,它可以对所有文件使用通配符 * .*,但在 SE4.10 中则不能。我有一个 SQL 脚本,我的用户定期运行该脚本来重组客户和交易表。然后我有一个 FIX.BAT DOS 脚本 [bcheck –y * .*] 作为我的用户的实用程序选项,以防任何表被搞砸。由于运行重组的用户现在将增加表版本号,例如:CUSTO102、110……现在我必须设计一种方法来从 .DBS 目录中删除 .DAT 扩展名并将其提供给 BCHECK。以前,我的重组总是会使用 CREATE TABLE customer IN “C:\DBFILES.DBS\CUSTOMER” 重新创建静态 CUSTOMER.DAT;但这造成了写入权限问题,并且必须恢复为 SE 的默认数据文件日志记录……

在 CUSTO102 上运行 BCHECK 之前,其 .IDX 文件大小为 22,089 字节,其 .DAT 大小为 882,832 字节。

在 CUSTO102 上运行 BCHECK 后,其 .IDX 大小增加到 122,561 字节,但是创建了一个新的 .IDY 文件,大小为 88,430 字节。.IDY

文件是什么?

C:\DBFILES.DBS> bcheck –y CUSTO102

BCHECK  C-ISAM B-tree Checker version 4.10.DD6  

C-ISAM File: c:\dbfiles.dbs\CUSTO102

Checking dictionary and file sizes.
Index file node size = 512
Current C-ISAM index file node size = 512
Checking data file records.
Checking indexes and key descriptions.
Index 1 = unique key  
    0 index node(s) used -- 1 index b-tree level(s) used
Index 2 = duplicates  (2,30,0) 
    42 index node(s) used -- 3 index b-tree level(s) used
Index 3 = unique key  (32,5,0) 
    29 index node(s) used -- 2 index b-tree level(s) used
Index 4 = duplicates  (242,4,2) 
    37 index node(s) used -- 2 index b-tree level(s) used
Index 5 = duplicates  (241,1,0) 
    36 index node(s) used -- 2 index b-tree level(s) used
Index 6 = duplicates  (46,4,2) 
    38 index node(s) used -- 2 index b-tree level(s) used
Checking data record and index node free lists.

ERROR: 177 missing index node pointer(s)
Fix index node free list ? yes

Recreating index node free list.
Recreating index 6.
Recreating index 5.
Recreating index 4.
Recreating index 3.
Recreating index 2.
Recreating index 1.
184 index node(s) used, 177 free -- 1083 data record(s) used, 0 free

ISQL-SE 4.10.DD6 (DOS 6.22):

BCHECK  C-ISAM B-tree Checker version 4.10.DD6  

C-ISAM File: c:\dbfiles.dbs\*.*

ERROR: cannot open C-ISAM file

In SE2.10 it worked with wilcards * .* for all files, but in SE4.10 it doesn’t. I have an SQL script which my users periodically run to reorg customer and transactions tables. Then I have a FIX.BAT DOS script [bcheck –y * .*] as a utility option for my users in case any tables get screwed up. Since users running the reorg will now increment the table version number, example: CUSTO102, 110, … now I’m going to have to devise a way to strip the .DAT extensions from the .DBS dir and feed it to BCHECK. Before, my reorg would always re-create a static CUSTOMER.DAT with CREATE TABLE customer IN “C:\DBFILES.DBS\CUSTOMER”; but that created the write permission problem and had to revert back to SE’s default datafile journaling…

Before running BCHECK on CUSTO102, its .IDX file size was 22,089 bytes and its .DAT size is 882,832 bytes.

After running BCHECK on CUSTO102, its .IDX size increased to 122,561 bytes, however a new .IDY file was created with 88,430 bytes..

What's a .IDY file ???

C:\DBFILES.DBS> bcheck –y CUSTO102

BCHECK  C-ISAM B-tree Checker version 4.10.DD6  

C-ISAM File: c:\dbfiles.dbs\CUSTO102

Checking dictionary and file sizes.
Index file node size = 512
Current C-ISAM index file node size = 512
Checking data file records.
Checking indexes and key descriptions.
Index 1 = unique key  
    0 index node(s) used -- 1 index b-tree level(s) used
Index 2 = duplicates  (2,30,0) 
    42 index node(s) used -- 3 index b-tree level(s) used
Index 3 = unique key  (32,5,0) 
    29 index node(s) used -- 2 index b-tree level(s) used
Index 4 = duplicates  (242,4,2) 
    37 index node(s) used -- 2 index b-tree level(s) used
Index 5 = duplicates  (241,1,0) 
    36 index node(s) used -- 2 index b-tree level(s) used
Index 6 = duplicates  (46,4,2) 
    38 index node(s) used -- 2 index b-tree level(s) used
Checking data record and index node free lists.

ERROR: 177 missing index node pointer(s)
Fix index node free list ? yes

Recreating index node free list.
Recreating index 6.
Recreating index 5.
Recreating index 4.
Recreating index 3.
Recreating index 2.
Recreating index 1.
184 index node(s) used, 177 free -- 1083 data record(s) used, 0 free

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凤舞天涯 2024-09-17 21:18:39

通配符的问题更有可能是用于运行 bcheck 的命令解释器的问题,而不是 bcheck 本身的问题。如果您给bcheck一个文件名列表(例如'abc def.dat def.idx'),那么它将处理C-ISAM文件对(abc.dat 、 abc.idx)、(def.dat、def.idx) 和 (def.dat、def.idx - 再次)。因为它抱怨无法打开 'c:\dbfiles.dbs\*.*',这意味着命令解释器没有扩展“*.*”位,或者

我希望它没有扩展成“.IDY” 。' 文件是重建表索引时使用的中间文件,我不知道为什么它没有被清理 - 也许该过程没有完成。

关于大小,我认为您的表大约有 55,000 行,大小为 368。每个字节(SE 可能会说 367;区别在于末尾的记录状态字节,“\0”表示已删除,“\n”表示当前) CHAR(5) 列(索引 3)上的唯一索引每个条目需要 9 个字节,或者每个索引节点需要大约 56 个键,对于大约 1000 个索引节点来说,重复索引的大小很难调整;您需要用于键值的空间以及用于重复项的 4 字节数字列表,所有这些都打包到 512 字节的页面中。 22 KB 的索引文件丢失了大量信息。修改后的索引文件大小合适。请注意,索引 1 是“ROWID”索引;它不占用任何空间。 (索引1也是为什么虽然SE创建的每个表都存储在C-ISAM文件中,但并非所有C-ISAM文件都一定与SE兼容的原因。)

The problem with the wild cards is more likely an issue with the command interpreter that was used to run bcheck than with bcheck itself. If you give bcheck a list of file names (such as 'abc def.dat def.idx', then it will process the C-ISAM file pairs (abc.dat, abc.idx), (def.dat, def.idx) and (def.dat, def.idx - again). Since it complained about being unable to open 'c:\dbfiles.dbs\*.*', it means that the command interpreter did not expand the '*.*' bit, or there was nothing for it to expand into.

I expect that the '.IDY' file is an intermediate used while rebuilding the indexes for the table. I do not know why it was not cleaned up - maybe the process did not complete.

About sizes, I think your table has about 55,000 rows of size 368 bytes each (SE might say 367; the difference is the record status byte at the end, which is either '\0' for deleted or '\n' for current). The unique index on the CHAR(5) column (index 3) requires 9 bytes per entry, or about 56 keys per index node, for about 1000 index nodes. The duplicate indexes are harder to size; you need space for the key value plus a list of 4-byte numbers for the duplicates, all packed into 512-byte pages. The 22 KB index file was missing a lot of information. The revised index file is about the right size. Note that index 1 is the 'ROWID' index; it does not occupy any space. (Index 1 is also why although every table created by SE is stored in a C-ISAM file, not all C-ISAM files are necessarily compatible with SE.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文