无法从Ora2pg

时间:2018-08-29 09:03:02

标签: oracle database-migration postgresql-10 ora2pg

我试图将一个简单的模式从oracle迁移到PostgreSQL,该模式包含表和行,触发器和序列。他们都使用ora2pg成功迁移。 这是该过程的进度:

[root@localhost ora2pg]# ora2pg
[=========>               ] 2/5 tables (40.0%) scanning table EMPLOYEE_AUDIT_INS[==============>          ] 3/5 tables (60.0%) scanning table EMPLOYEE_AUDIT_INS[===================>     ] 4/5 tables (80.0%) scanning table EMPLOYEE_AUDIT_UPD[========================>] 5/5 tables (100.0%) scanning table TEST_SEQUENCE    [========================>] 5/5 tables (100.0%) end of scanning.            
[====>                    ] 1/5 tables (20.0%) scanning table EMPLOYEE_AUDIT_INS[====>                    ] 1/5 tables (20.0%) scanning table EMPLOYEE_AUDIT_INS[====>                    ] 1/5 tables (20.0%) scanning table EMPLOYEE_AUDIT_UPD[====>                    ] 1/5 tables (20.0%) scanning table TEST_SEQUENCE     [>                        ] 0/5 tables (0.0%) end of scanning.             
[===================>     ] 4/5 tables (80.0%) exporting EMPLOYEE_AUDIT_INSERT_S[========================>] 5/5 tables (100.0%) exporting EMPLOYEES             [========================>] 5/5 tables (100.0%) end of table export.
[========================>] 0/0 packages (100.0%) end of output.    
[========================>] 4/4 rows (100.0%) Table EMPLOYEES (4 recs/sec)
[======>                  ]  4/14 total rows (28.6%) - (0 sec., avg: 4 recs/sec).
[======>                  ]  4/14 rows (28.6%) on total estimated data (1 sec., [========================>] 4/4 rows (100.0%) Table EMPLOYEE_AUDIT_INSERT (4 recs/sec)          
[=============>           ]  8/14 total rows (57.1%) - (0 sec., avg: 8 recs/sec).     
[=============>           ]  8/14 rows (57.1%) on total estimated data (1 sec., [========================>] 4/4 rows (100.0%) Table EMPLOYEE_AUDIT_INSERT_SIMPLE (4 recs/sec)   
[====================>    ] 12/14 total rows (85.7%) - (0 sec., avg: 12 recs/sec).           
[====================>    ] 12/14 rows (85.7%) on total estimated data (1 sec., [========================>] 0/0 rows (100.0%) Table EMPLOYEE_AUDIT_UPDATE (0 recs/sec)           
[====================>    ] 12/14 total rows (85.7%) - (0 sec., avg: 12 recs/sec).    
[====================>    ] 12/14 rows (85.7%) on total estimated data (1 sec., [========================>] 2/2 rows (100.0%) Table TEST_SEQUENCE (2 recs/sec)                   
[========================>] 14/14 total rows (100.0%) - (0 sec., avg: 14 recs/sec).
[========================>] 14/14 rows (100.0%) on total estimated data (1 sec., avg: 14 recs/sec)
[========================>] 0/0 views (100.0%) end of output.                                     
[========================>] 1/1 sequences (100.0%) end of output.      
[========================>] 2/2 triggers (100.0%) end of output.            
[========================>] 0/0 functions (100.0%) end of functions export.
[========================>] 0/0 procedures (100.0%) end of procedures export.
[========================>] 0/0 types (100.0%) end of output.                
[========================>] 0/0 partitions (100.0%) end of output.

当我尝试使用psql执行.sql文件时,结果始终显示只能创建序列:

abcdtest=# \i /etc/ora2pg/schema_abcd_with_2triggers_1sequence/abcd_schema__usergrant0_insertconfig_fileperfunction1_disablesequence0.sql 
...
psql.bin:/etc/ora2pg/schema_abcd_with_2triggers_1sequence/abcd_schema__usergrant0_insertconfig_fileperfunction1_disablesequence0.sql:88: NOTICE:  relation "numbering" does not exist, skipping
ALTER SEQUENCE
COMMIT

其他一切都很好。 我检查了.sql文件,唯一包含序列的行仅是更改序列,而不是创建序列:

ALTER SEQUENCE IF EXISTS numbering RESTART WITH 3;
COMMIT;

我在这里做错了什么?我应该怎么做才能从Oracle迁移序列?预先感谢!

0 个答案:

没有答案