简体   繁体   English

从数据文件重新创建ddf文件(Pervasive SQL)

[英]Recreate ddf files from data files (Pervasive SQL)

I inherited a project that uses a pervasiveSQL database over the btrieve-Interface. 我继承了一个在btrieve-Interface上使用pervasiveSQL数据库的项目。 Over time there has been some copying around of the data files. 随着时间的流逝,已经有一些数据文件的复制。 As it seems btrieve does not really need the ddf files; 看来btrieve确实不需要ddf文件; it is happy with the data files alone, so the ddf-files were not always copied with them. 它只对数据文件感到满意,因此ddf文件并不总是与它们一起复制。 Over time this has led to the problem that on some installations the ddf files and the data files do not match (ie the ddf's data definition does not match the actual table structure). 随着时间的流逝,这会导致在某些安装中ddf文件和数据文件不匹配的问题(即ddf的数据定义与实际的表结构不匹配)。 This is no problem for the running version of the program, but becomes a maintenance problem, when something needs to be changed in the database structure. 对于程序的运行版本而言,这没有问题,但是当需要在数据库结构中进行某些更改时,这将成为维护问题。

So here's the question: Is there a way/tool to recreate the ddf files from the data files? 所以这是一个问题:是否有一种方法/工具可以从数据文件中重新创建ddf文件? To me that seems possible, because there seems to be structural information in the data files. 在我看来,这是可能的,因为数据文件中似乎包含结构信息。 I wouldnt mind if the recreated ddf's would loose the actual field and index names. 我不介意重新创建的ddf是否会丢失实际的字段和索引名称。

If that helps: There are no relations defined between the tables (there are foreign keys in the data, but the database is not told about them). 如果有帮助,请执行以下操作:在表之间没有定义任何关系(数据中有外键,但没有告知数据库有关它们的信息)。 So I actually only need fields and index definitions. 所以我实际上只需要字段和索引定义。

There is no generic tool to recreate the DDFs from the data files. 没有通用的工具可以从数据文件重新创建DDF。 You can use DDF Builder to recreate the table definitions based on data files but you will need to know the record layout. 您可以使用DDF Builder来基于数据文件重新创建表定义,但是您需要知道记录的布局。

Btrieve data files do not store field structure information. Btrieve数据文件不存储字段结构信息。 DDFs have that information and the application that generates the data files stores that information but the data files themselves do not store any field information. DDF具有该信息,并且生成数据文件的应用程序存储该信息,但是数据文件本身不存储任何字段信息。 The only thing metadata related in Btrieve files is index information. Btrieve文件中唯一相关的元数据是索引信息。

My suggestion would be to maintain the data files through the DDFs using CREATE TABLE / ALTER TABLE statements (or DTI/DTO) rather than making changes to the data files first and updating the DDFs second. 我的建议是使用CREATE TABLE / ALTER TABLE语句(或DTI / DTO)通过DDF维护数据文件,而不是先对数据文件进行更改然后再更新DDF。 By modifying the tables using ALTER TABLE statements, the DDFs and data files are always in sync. 通过使用ALTER TABLE语句修改表,DDF和数据文件始终保持同步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM