摘要
数据迁移是指将源数据库表中的数据拷贝至目标数据库表的过程。文章设计了一种基于开放数据库互连(Open Database Connectivity,ODBC)接口规范在不同数据库表间进行数据迁移的方案。首先,通过分析数据库表创建脚本得到表结构信息。其次,根据表结构信息中的外键关系,确定数据表的先后迁移顺序,从而归纳表结构信息中的列数据类型信息。再次,设计统一接口的数据集用于存储迁移过程中的数据。最终,根据源数据表结构信息从源数据库中读取数据到数据集,并通过源数据表结构与目标数据表结构的映射关系和目标数据表结构信息,将数据集中的数据写入目标数据库。
Database data migration can be simply regarded as a process of copying the data in the source database table to the target database table. A scheme of data migration between different database tables based on Open Database Connectivity(ODBC) interface specification is designed. Firstly, the table structure information is obtained by analyzing the database tables and creating scripts. Secondly,according to the foreign key relationship in the table structure information, the sequence of data table migration is determined, so as to summarize the column data type information in the table structure information. Thirdly, the data set of the unified interface is designed to store the data in the migration process. Finally, read the data from the source database to the dataset according to the source table structure information, and write the data in the dataset to the target database through the mapping relationship between the source table structure and the target table structure and the target table structure information.
作者
黄斌
王锋
HUANG Bin;WANG Feng(No.30 Institute of CETC,Chengdu Sichuan 610000,China)
出处
《信息与电脑》
2022年第12期185-187,共3页
Information & Computer