孙铁良, 张群, 刘飞, 刘芸, 段然, 郭伟登, 石健. 一种在SCADA系统增加PostgreSQL支持的数据库开发[J]. 油气储运, 2017, 36(10): 1201-1205, 1211. DOI: 10.6047/j.issn.1000-8241.2017.10.017
引用本文: 孙铁良, 张群, 刘飞, 刘芸, 段然, 郭伟登, 石健. 一种在SCADA系统增加PostgreSQL支持的数据库开发[J]. 油气储运, 2017, 36(10): 1201-1205, 1211. DOI: 10.6047/j.issn.1000-8241.2017.10.017
SUN Tieliang, ZHANG Qun, LIU Fei, LIU Yun, DUAN Ran, GUO Weideng, SHI Jian. One database developed by adding PostgreSQL support into SCADA system[J]. Oil & Gas Storage and Transportation, 2017, 36(10): 1201-1205, 1211. DOI: 10.6047/j.issn.1000-8241.2017.10.017
Citation: SUN Tieliang, ZHANG Qun, LIU Fei, LIU Yun, DUAN Ran, GUO Weideng, SHI Jian. One database developed by adding PostgreSQL support into SCADA system[J]. Oil & Gas Storage and Transportation, 2017, 36(10): 1201-1205, 1211. DOI: 10.6047/j.issn.1000-8241.2017.10.017

一种在SCADA系统增加PostgreSQL支持的数据库开发

One database developed by adding PostgreSQL support into SCADA system

  • 摘要: 为了实现基于Oracle商用数据库开发的长输油气管道SCADA系统PCS(Pipeline Control System)软件对开源数据库PostgreSQL的支持和优化,对Oracle与PostgreSQL数据库的功能和语法结构进行了详细分析。在此基础上,提出采用PostgreSQL中表继承的方法,实现对Oracle表分区功能的替换;通过分析Oracle与PostgreSQL存储过程的语法差异,对PCS中的存储过程进行改造和优化处理;利用PostgreSQL对Python语言的扩展支持,实现存储过程对本地文件的直接读取功能;利用在PostgreSQL中创建新视图的方法,实现对Oracle同义词功能的替换;采用在PostgreSQL中创建一个对象数据表的方法,实现对Oracle目录对象功能的替换,并提出了一种软件架构方法,从而实现了PCS软件对Oracle与PostgreSQL两种数据库的支持。通过兼容性改造,成功实现了PCS对PostgreSQL数据库的完美支持和性能优化。

     

    Abstract: The PCS software of long-distance oil and gas pipeline SCADA system is developed on the basis of the commercial database Oracle. In order to guarantee its support on the open source database PostgreSQL and realize the optimization of PostgreSQL, the functions and syntax structures of Oracle and PostgreSQL databases were analyzed in detail in this paper. Then, it was proposed to replace the Oracle table partition function by using the table inheritance method of PostgreSQL. The stored procedure in PCS was modified and optimized by analyzing the syntax difference of stored procedure between Oracle and PostgreSQL. The direct reading of local files by the stored procedure was realized based on the extended support of PostgreSQL for Python language. The synonym function of Oracle was replaced by creating new views in PostgreSQL. The directory object function of Oracle was replaced by creating an object data table in PostgreSQL. A software architecture method was proposed to realize the support of PCS software for Oracle and PostgreSQL databases. Based on these modifications, the support of PCS for PostgreSQL database is successfully realized and the performance of PostgreSQL database is optimized.

     

/

返回文章
返回