Ora2Pg is a free tool used to migrate an Oracle database to a PostgreSQL compatible schema. It connects your Oracle database, scan it automatically and extracts its structure or data, it then generates SQL scripts that you can load into PostgreSQL.
In conditions where an Oracle Sequence is about to CYCLE (meaning that the very next value will cycle), the Oracle metadata is stored in such a way where the last value is show as one more than the MAXVALUE. When this ocurs ora2pg is increasing the MAXVALUE by 1 which in essence makes the sequence dissimilar from the source and depending on the datatype the sequence is being used by, could cause failure.
Oracle Code
CREATE SEQUENCE test_sequence START WITH 100 INCREMENT BY 1 CYCLE CACHE 20 MINVALUE 1 MAXVALUE 99;
In conditions where an Oracle Sequence is about to CYCLE (meaning that the very next value will cycle), the Oracle metadata is stored in such a way where the last value is show as one more than the MAXVALUE. When this ocurs ora2pg is increasing the MAXVALUE by 1 which in essence makes the sequence dissimilar from the source and depending on the datatype the sequence is being used by, could cause failure.
Oracle Code
CREATE SEQUENCE test_sequence START WITH 100 INCREMENT BY 1 CYCLE CACHE 20 MINVALUE 1 MAXVALUE 99;
Resulting code from ora2pg
CREATE SEQUENCE test_sequence INCREMENT 1 MINVALUE 1 MAXVALUE 100 START 100 CACHE 20 CYCLE;