指令使用ora2pg

时间:2019-04-18 08:50:27

标签: oracle postgresql ora2pg

我正在尝试使用ora2pg将oracle db迁移到postgres。仅出于测试目的,我在特定模式下创建表并运行ora2pg来生成.sql文件,并且我运行\ i .sql到postgres并可以正常工作,但情况有所变化。 我需要直接将.sql文件导入postgres数据库。就像说的那样,ora2pg.conf中有指令。

 **Define the following directive to send export directly to a PostgreSQL
 database. This will disable file output.**

 *PG_DSN          dbi:Pg:dbname=testdb;host=ip_address;port=port_no 
 PG_USER         postgres PG_PWD          postgres*

这部分配置是否满足我的上述要求。 我们需要运行ora2pg工具的postgres的远程连接工作正常。 当我跑步时

 ora2pg -d:
output>>

Ora2Pg version: 18.2
Trying to connect to database: *dbi:Oracle:host=host_address;sid=odb_sid;port=odb_port*
Isolation level: SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
Looking forward functions declaration in schema srschema.
Retrieving table information...
[1] Scanning table TEST_TBL (1 rows)...
Retrieving table information...
[1] Scanning table TEST_TBL (1 rows)...
Warning duplicate table TEST_TBL, maybe a SYNONYM ? Skipped.
Retrieving procedures information...
Retrieving functions information...
Dumping table TEST_TBL...
Trying to connect to database: 
dbi:Oracle:host=host_address;sid=odb_sid;port=odb_port
Isolation level: SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
Retrieving partitions information...
  

无法在未定义的值处调用方法“ do”

     

/usr/local/share/perl5/Ora2Pg.pm第5223行。由于以下原因而发出rollback()   没有DBD :: Oracle :: db句柄的显式disconnect()的销毁   (描述=(地址=(主机=主机地址)(协议= TCP)(端口= odb_端口))(连接数据=(SID = odb_sid)))   在/usr/local/share/perl5/Ora2Pg.pm 5223行。

运行ora2pg的服务器,postgres服务器连接正常。

0 个答案:

没有答案