forked from darold/ora2pg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangelog
6560 lines (6064 loc) · 342 KB
/
changelog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2022 10 08 - v23.2
This release fix several issues reported since past height months and
adds some new features and improvements.
* Add export of MySQL KEY and LINEAR KEY partitioning, translated as HASH
partitioning.
* Allow export of object with dollar sign is his name.
* Add export of CHECK constraints for MySQL >= 8.0.
* Add Functional/Expression indexes export from MYSQL.
* Add export of MySQL virtual column. Thanks to Shubham Dabriwala for the
* Remove scale and precision of a numeric if the scale is higher than the
precision. PostgreSQL does not support decimal/numeric attributes where
the scale is explicitly higher than the precision.
* Add command line option --drop_if_exists to add statement to drop objects
before creation if it exists. It corresponds to the DROP_IF_EXISTS
* Add option -C | --cdc_file to be able to change the name of the default file
used to store/read SCN per table during export. Default is TABLES_SCN.log in
the current directory. This is the file written by the --cdc_ready option.
* Add multiprocess to count rows in PostgreSQL tables (TEST_COUNT) using -P
command line option.
* Add support to PostgreSQL 14 procedure with out parameters.
* Set default PostgreSQL database target version to 14.
New configuration directives:
* Add configuration directive MVIEW_AS_TABLE and command line option
--mview_as_table to set which materialized view to export as table.
By default none. Value must be a list of materialized view name or
regexp separated by space or comma. If the object name is a materialized
view and the export type is TABLE, the view will be exported as a create
table statement. If export type is COPY or INSERT, the corresponding data
will be exported.
* Add configuration variable FDW_IMPORT_SCHEMA to rename the schema where
foreign tables for data migration will be created. If you use several
instances of ora2pg for data migration through the foreign data wrapper,
you might need to change the name of the schema for each instance.
Default: ora2pg_fdw_import
* Add TRANSFORM_VALUE configuration directive to apply an expression when
retrieving data from Oracle. For example:
TRANSFORM_VALUE CLOB_TABLE[CHARDATA:translate("CHARDATA", chr(0), ' ')]
to replace all Oracle char(0) in a string by a space character.
* Add EXCLUDE_COLUMNS configuration directive. Unlike MODIFY_STRUCT
that is used to redefine a table structure, this directive allow
to specify a list of columns per table that must be excluded from
the export. For example:
EXCLUDE_COLUMNS T1(nocol1,nocol2) T2(nocol1,nocol2)
* Add new configuration directive EXPORT_GTT to export Oracle Global Temporary
Table using syntax recognized by the pgtt extension. For more information see
https://github.com/darold/pgtt Default is to not export global temporary
table as they are not supported natively by PostgreSQL.
* Add new configuration option NO_EXCLUDED_TABLE. By default Ora2Pg exclude
from export some Oracle "garbage" tables that should never be part of an
export. This behavior generates a lot of REGEXP_LIKE expressions which are
slowing down the export when looking at tables. To disable this behavior
enable this directive, you will have to exclude or clean up later by
yourself the unwanted tables. The regexp used to exclude the table are
defined in the array @EXCLUDED_TABLES in lib/Ora2Pg.pm. Note this is behavior
is independent to the EXCLUDE configuration directive.
Backward compatibility:
* Force rewrite of all invalid date starting with zero year 0000 into 1970-01-01
when it is a default value and NULL for data. Old behavior was to only replace
0000-00-00 date.
* Until now there was a lot of untranslated call to TRUNC(date) because
Ora2Pg is unable to detect that the parameter is a date or a number.
The problem is that Oracle has TRUNC(number) too and Ora2Pg try to not
apply the transformation if there is a doubt. In most of the migration
have met very few TRUNC(number) so now all call to TRUNC()
will be converted to date_trunc(). There must be false positive rewrite
but this should be far less work than the actual situation.
Here is the full list of changes and acknowledgements:
- Fixed PostgreSQL "relation not found error" in _dump_fdw_table(), PostgreSQL
search_path was not being used. Thanks to James Schriever for the patch.
- Fix year and month quoting as reserved words when they are used as aliases.
Thanks to duursma for the report.
- Fix conversion of to_number(substr(...)) when PG substr() return empty
string where Oracle return NULL which make the conversion to numeric fail.
The fix using (nullif(substr(...), )::numeric) only concern TABLE export.
Thanks to Menelaos Perdikeas for the report.
- Add export of MySQL KEY and LINEAR KEY partitioning, now exported as HASH
partitioning. Thanks to Sanyam Singhal for the report.
- Remove $ sign from characters that require object name quoting.
- Fix export of objects with the $ sign in the name. Thanks to yano-rxa and
duursma for the report.
- Prevent translation of EXEC when used as alias. Thanks to Rui Pereira for
the report.
- Fix MySQL enum data type export with regression introduced by commit 24a476.
Thanks to Shivansh Gahlot for the report.
- Rename ORACLE_FDW_TRANSFORM to TRANSFORM_VALUE to apply in all case an
expression when retrieving data from Oracle. For example:
TRANSFORM_VALUE CLOB_TABLE[CHARDATA:translate("CHARDATA", chr(0), ' ')]
to replace all Oracle char(0) in a string by a space character.
- Fix add_month() translation failing with some use cases. Thanks to duursma
for the report.
- Add export of CHECK constraints for MySQL >= 8.0. Thanks to Rahul
Barigidad for the report.
- Fix MySQL unsigned numeric data type conversion. Thanks to Rahul Barigidad
for the report.
- Add Functional/Expression indexes fail while exporting from MYSQL. Thanks to
Shubham Dabriwala for the report.
- Fix export of descending indexes for MySQL. Thanks to Shubham Dabriwala for
the report.
- Force MySQL auto increment sequence to start at 1 when value is 0.
Thanks to Rahul Barigidad for the report.
- Fix conversion of MySQL decimal(p,s) to keep the original datatype
instead of use of real or double.
- Add export of MySQL virtual column. Thanks to Shubham Dabriwala for the
report.
- Fix export of MySQL function with return clause only. Thanks to Shubham
Dabriwala for the report.
- Remove scale and precision of a numeric if the scale is higher than the
precision. PostgreSQL does not support decimal/numeric attributes where
the scale is explicitly higher than the precision. Thanks to Rahul Barigidad
for the report.
- Fix export of comment for views. Thanks to gh-k-murata for the report.
- Add command line option --drop_if_exists to add statement to drop objects
before creation if tehy exists. It corresponds to the DROP_IF_EXISTS
configuration directive. Thanks to Yoni Sade for the feature request.
- Add option --mview_as_table to documentation.
- Add configuration directive MVIEW_AS_TABLE and command line option
--mview_as_table to set which materialized view to export as table.
By default none. Value must be a list of materialized view name or
regexp separated by space or comma. If the object name is a materialized
view and the export type is TABLE, the view will be exported as a create
table statement. If export type is COPY or INSERT, the corresponding data
will be exported.
- Disable EXPORT_GTT when export type is not TABLE. Thanks to gh-k-murata for
the report.
- Fix generated external servers wrongly placed in a schema. Thanks to duursma
for the report.
- Add configuration variable FDW_IMPORT_SCHEMA to rename the schema where
foreign tables for data migration will be created. If you use several
instances of ora2pg for data migration through the foreign data wrapper,
you might need to change the name of the schema for each instance. Default
to ora2pg_fdw_import. Thanks to James Schriever for the feature request.
- Fix wrong conversion of rownum clause when a subquery is used. Thanks to
Rui Pereira for the report.
- Escape comma and backslashes in BFILE data export. Thanks to duursma for
the patch.
- Fix possible infinite loop in Oracle outer join parsing. Thanks a lot to
yano-rxa for the report.
- Remove privileges default settings on views exported from SYNONYMs
- Add support for Rectangle geometry type. Thanks to duursma for the patch.
- Fix double replacement of IS NULL/IS NOT NULL when NULL_EQUAL_EMPTY is
enabled.
- Add CHECK not null only constraints to not null constraint count.
- Fix CHECK NOT NULL only constraints that was not exported by generating
NOT NULL constraints instead. They are exclude from the count of CHECK
constraint as suggested by Florent Jardin but a count difference persist
for NOT NULL constraints.
- Fix TYPE export when SCHEMA and PRESERVE_CASE have different values. Thanks
to Florent Jardin for the report.
- Fix custom exception replacement. Thanks to Rui Pereira for the report.
- Fix Collection and Polygon geometry INTERNAL export.
Thanks to duursma for the patch.
- Fix export of efile with parenthesis. Thanks to duursma for the report.
- Fix wrong column indices used in spatial index extraction. Thanks to duursma
for the report.
- Fix call of ST_GeomFromText() with WKT export. Thanks to duursma for the
report.
- Disable USE_LOB_LOCATOR with WKT geometry export type, ST_GeomFromText and
SDO_UTIL.TO_WKTGEOMETRY functions return a CLOB instead of a geometry.
Thanks to duursma for the report.
- Fix INTERNAL conversion uses the srid from the object instead of the
meta-data. Thanks to duursma for the report.
- Fix regression in data export when REPLACE_AS_BOOLEAN is set. Thanks to
Juri Berlanda for the report.
- Fix call to procedure using dblink. Thanks to Rui Pereira for the report.
- Keep untouched call to DBMS_OUTPUT functions if USE_ORAFCE is enabled.
Thanks to Sanyam Singhal for the report.
- Partial fix for MySQL subpartitioning export.
- Fix partitions export for MySQL. Thanks to Sanyam Singhal for the report.
- Fix generation of export_all.sh following the operating system.
- Add information of use of PARALLEL_TABLES with COPY, INSERT and TEST_DATA
actions. It is also useful with TEST, TEST_COUNT, and SHOW_TABLE if
--count_rows is used for real row count.
- Prevent calling real rows count twice with TEST action, and allow it for
the SHOW_TABLE action.
- Handle count errors when single process.
- Move row count wait for all child die to the right place
- Fix rewrite of nested replace() functions in CHECK constraint. Thanks to
Menelaos Perdikeas for the report.
- Fix call of procedures with out parameters when it is not declared in a
package. Thanks to taptarap for the report.
- Some minor code improvement. Thanks to Markus Elfring for the patch.
- Set encoding to read configuration file to utf8.
- Remove useless multiple semi-colon after END of a function.
- Fix conversion of regexp_replace() by always appending the 'g' modifier.
Thanks to Rui Pereira for the report.
- Fix synonym detection to avoid listing public synonym when no schema is
specified. Thanks to Dilan Salinda for the report.
- Fix regexp error with multi-line comment in default value declaration. Thanks
to taptarap for the report.
- Add missing sub-partition key in partitioned table primary key. Thanks to
downvoteit for the report.
- Replace all invalid date starting with zero year 0000- to 1970-01-01 when it
is a default value and NULL for data. Old behavior was to only replace
0000-00-00 date. Thanks to duursma for the report.
- Enclose \i path to data file beween quote to fix import of table with space
in their name.
- Add PARTITION to the list of reserved work and fix custom keywords list from
ORA_RESERVED_WORDS that was not applied. Thanks to markhooper99 for the
report.
- Add LOAD of pgtt extension before creating global temporary table with TABLE
:export. Thanks to duursma for the report.
- Fix case where package names should be lower cased. Thanks to Sergey Petrov
for the patch.
- Cover more case where ALTER ... OWNER TO should not be generated.
- Fix case where ALTER ... OWNER TO should not be generated when a view as
table definition was not exported.
- Fix sub-partition unique and primary keys that lacks columns part of the
partition key. Thanks to downvoteit for the report.
- Path for function_per_file are mixed case enabled now. Thanks to Sergey
Petrov for the patch.
- Fix AUTOINCREMENT script to set last value to sequences for serial an
identity column for PG version < 12. Thanks to Jaouad Bouras for the report.
- Fix detection of ENUM data type for MySQL
- Fix issue when exporting table with a geometry column. The search for
the SDO_GTYPE need a FROM clause with a FQDN table when the connection
user is not the same as the table schema. Thanks to Argo64 for the report.
- Rewrite numeric operation with ADD_MONTH(), LAST_DAY() and TRUNC() to use
interval. Thanks to duursma for the report.
- Fix rewrite of CONNECT BY in cursors and just after a BEGIN. Thanks to
taptarap for the report.
- Add partition keys to unique index on partitioned table. Thanks to
downvoteit for the report.
- Fix case where global variable are tested against NULL. Thanks to duursma
for the report.
- Fix remove of %ROWTYPE in function argument and returned data type. Add
regression test. Thanks to Eric Delanoe for the report.
- Fix case clause in autoincrement parameters. Thanks to jbouras for the
report.
- Fix typo in ORACLE_FDW_TRANSFORM example.
- Fix progress bar output in quiet mode. Thanks to Sanyam Singhal for the
report.
- Fix error Can't locate object method "gzclose" via package "IO::File".
Thanks to Sanyam Singhal for the report.
- Fix cases where translation of function with out parameter was not done
correctly.
- Fix translation of function with out parameter that returns a value. For
example the following Oracle function:
CREATE FUNCTION foo(a int, OUT b int)
RETURN boolean IS
BEGIN
b := a;
RETURN true;
END;
is now translated by adding an extra out parameter for the return value:
CREATE OR REPLACE FUNCTION foo (a integer, OUT b integer,
OUT extra_param boolean)
RETURNS record AS $body$
BEGIN
b := a;
extra_param := true;
RETURN;
END;
$body$ LANGUAGE PLPGSQL STABLE;
Thanks to Akhil Reddy for the report.
- Fix undefined database connection handle. Thanks to Alexander for the report
- Fix case preservation for row count in Oracle side with TEST_COUNT action..
Thanks to Veka for the report.
- Only generate the Powershell script when we are running on a Windows
operating system.
- Fix #1400 and generate PowerShell script "export_schema.ps1". Thanks to
moh-hassan for the report.
- Fix rewriting assignment of a global variable using SELECT INTO. Thanks to
duursma for the report.
- Fix partition export for MySQL. Thanks to Sanyam Singhal for the report.
- Apply WHERE clause to FDW data export.
- Fix useless ST geometry parsing. Thanks to jieguolove for the report.
- Replace backslash with slash in BFILE filename when destination data type is
text or efile.
- Fix RAW(16)/RAW(32) data export when MOFDIFY_TYPE is used on the column.
Thanks to Sergey Evseev for the report.
- Fix ST_SRID() call. Thanks to jieguolove for the report.
- Skip table data export when the table has no column defined. This was
generating a fatal error.
- Fix untranslated function returned data type when there was a comment just
after. The comment is removed. Thanks to taptarap for the report.
- Fix other fetching all-column-all-table properties for every table.
Thanks to Sergey Petrov for the report.
- Fix fetching all-column-all-table properties for every table. Thanks to
Sergey Petrov for the report.
- Remove any comments between RETURN and returned type to not break parsing.
Thanks to taptarap for the report.
- Fix global variables in the DECLARE section are not replaced if used with
a package name. Thanks to taptarap for the report.
- Remove renaming of dist configuration file under Windows OS. Thanks to
Julien Monticolo and ohamed Hassan for the report.
- Fix remaining data export query failure. Thanks to Sung Woo Chang for the
report.
- Fix data export, query to retrieve data was broken since change for GTT.
- Set function as VOLATILE when there is CALL in the body.
- Add support to PG14 procedure out parameters. Thanks to Rui Pereira for the
feature request.
- Fix missing parenthesis in index column expression with input file.
- Fix missing END keyword after embedded CASE clause in a package function.
Thanks to taptarap for the report.
- Fix conversion of dbms_lob.substr() where second and third parameters
must be inverted. Thanks to taptarap for the report.
- Fix an other case of wronf NOT NULL detection from input file.
- Fix detection of NOT NULL constraint in input file.
- Do not quit on error "Undefined subroutine &Ora2Pg::ReadLine", just
continue to be able to leverage an Oracle Wallet (SEPS) when no Oracle
user and password are provided. If you want to use the interactive mode
to type the username and password at command line you must install the
Perl package Term::ReadKey before. Thanks to Simon Pane for the report.
- Fix partitioning by LIST, only the first value of a list was exported.
Thanks to Sergey Grinko for the report.
- Fix quoting of DEFAULT NULL. Thanks to Veka for the report.
- Fix unwanted multiple CALL keywords. Thanks to taptarap for the report.
- Add assessment counter for FND_* packages.
- Fix LONG RAW export as bytea in COPY mode. Thanks to Helena Adiduyulmus for
the report.
- Add new configuration option NO_EXCLUDED_TABLE.
By default Ora2Pg exclude from export some Oracle "garbage" tables that
should never be part of an export. This behavior generates a lot of
REGEXP_LIKE expressions which are slowing down the export when looking at
tables. To disable this behavior enable this directive, you will have to
exclude or clean up later by yourself the unwanted tables. The regexp used
to exclude tables are defined in the array @EXCLUDED_TABLES in lib/Ora2Pg.pm
This behavior is independent to the EXCLUDE configuration directive. Thanks
to Peter Humaj for the feature request.
- Replace all remaining CURSORNAME%NOTFOUND with NOT FOUND
- Change translation to SYSDATE from LOCALTIMESTAMP to statement_timestamp()
in non PL/SQL code.
- Prevent append of SECURITY DEFINER when a procedure execute transaction
control statements (ex: COMMIT). When defined with this clause an error
is thrown. Thanks to Suman Michael for the report.
2022 02 10 - v23.1
This release fix several issues reported since past four months and
adds some new major features and improvements.
* Add use of greatest/least functions from new version of Orafce when
required to return NULL on NULL input like Oracle.
* ALLOW and EXCLUDE configuration values can now be read from a file.
Use -a filename or -e filename to specify the list of tables that need
to be filtered. This is useful if you have a lot of table to filter.
* Add possibility to use of System Change Number (SCN) for data export or
data validation by providing a specific SCN. It can be set at command
line using the -S or --scn option. You can give a specific SCN or if you
want to use the current SCN at first connection time set the value to
'current'. To use this last case the connection user must have the role
"SELECT ANY DICTIONARY" or "SELECT_CATALOG_ROLE", the current SCN is
looked at the v$database view.
Example of use:
ora2pg -c ora2pg.conf -t COPY --scn 16605281
This adds the following clause to the query used to retrieve data for example:
AS OF SCN 16605281
You can also use th --scn option to use the Oracle flashback capability by
specifying a timestamp expression instead of a SCN. For example:
ora2pg -c ora2pg.conf -t COPY --scn "TO_TIMESTAMP('2021-12-01 00:00:00', 'YYYY-MM-DD HH:MI:SS')"
This will add the following clause to the query used to retrieve data:
AS OF TIMESTAMP TO_TIMESTAMP('2021-12-01 00:00:00', 'YYYY-MM-DD HH:MI:SS')
or for example to only retrieve yesterday's data:
ora2pg -c ora2pg.conf -t COPY --scn "SYSDATE - 1"
* Add json output format to migration assessment. Thanks to Ted Yu for the patch.
* Add new TO_CHAR_NOTIMEZONE configuration directive to remove any timezone
information into the format part of the TO_CHAR() function. Disabled by default.
Thanks to Eric Delanoe for the report.
Note that the new default setting breaks backward compatibility, old behavior
was to always remove the timezone part.
* Add new configuration directive FORCE_IDENTITY_BIGINT. Usually identity
column must be bigint to correspond to an auto increment sequence so
Ora2Pg always force it to be a bigint. If, for any reason you want
Ora2Pg to respect the DATA_TYPE you have set for identity column then
disable this directive.
* Add command line option --lo_import. By default Ora2Pg imports Oracle BLOB
as bytea, the destination column is created
using the bytea data type. If you want to use large object instead of bytea,
just add the --blob_to_lo option to the ora2pg command. It will create the
destination column as data type Oid and will save the BLOB as a large object
using the lo_from_bytea() function. The Oid returned by the call to
lo_from_bytea() is inserted in the destination column instead of a bytea.
Because of the use of the function this option can only be used with actions
SHOW_COLUMN, TABLE and INSERT. Action COPY is not allowed.
If you want to use COPY or have huge size BLOB ( > 1GB) than can not be
imported using lo_from_bytea() you can add option --lo_import to the
ora2pg command. This will allow to import data in two passes:
1) Export data using COPY or INSERT will set the Oid destination column
for BLOB to value 0 and save the BLOB value into a dedicated file. It
will also create a Shell script to import the BLOB files into the
database using psql command \lo_import and to update the table Oid
column to the returned large object Oid. The script is named
lo_import-TABLENAME.sh
2) Execute all scripts lo_import-TABLENAME.sh after setting the
environment variables PGDATABASE and optionally PGHOST, PGPORT, PGUSER,
etc. if they do not correspond to the default values for libpq.
You might also execute manually a VACUUM FULL on the table to remove
the bloat created by the table update.
Limitation: the table must have a primary key, it is used to set the
WHERE clause to update the Oid column after the large object import.
Importing BLOB using this second method (--lo_import) is very slow so it
should be reserved to rows where the BLOB > 1GB for all other rows use
the option --blob_to_lo. To filter the rows you can use the WHERE
configuration directive in ora2pg.conf.
* Add command line option --cdc_ready to use current SCN per table when
exporting data and register them into a file named TABLES_SCN.log This
can be used for Change Data Capture (CDC) tools.
* Allow to export only invalid objects when EXPORT_INVALID is set to 2
* Disable per partition data export when a WHERE clause is define on the
partitioned table or that a global WHERE clause is defined.
Backward compatibility:
Ora2Pg used to removr any timezone information from the TO_CHAR() format
function. To recover this behavior set TO_CHAR_NOTIMEZONE to 1 in ora2pg.conf
Complete list of changes:
- Replace PERFORM by CALL when the stored procedure is a procedure. Thanks
to Rui Pereira for the report.
- Fix open cursor translation when using is in the query but not as keyword.
Thanks to taptarap for the report.
- Fix replacement of global variables in DECLARE section. Thanks to taptarap
for the report.
- Fix missing suffix in function name with autonomous transaction when export
schema was enabled and fix revoke and owner to wrapper function. Thanks to
Sergey Grinko for the report.
- Fix export of type declaration in packages without body. Thanks to Sergey
Grinko.
- Fix column name duplicates when exporting data of partition. Thanks to
Sergey Grinko for the report.
- Fix BLOB export with INSERT mode, call decode() was missing.
- Fix applying of DEFAULT_PARALLELISM_DEGREE hint that was not working
anymore for a long time. Thanks to Marcel Pils for the patch.
- Update documentation about PARALLEL_TABLES and view export. Thanks to
xinferum for the report.
- Fix unwanted quote escaping in global variable constant. Thanks to
sergey grinko for the report.
- Fix export of global variable when there is function in the default value.
- Fix end of statements in last merged PR.
- Add json output format to migration assessment. Thanks to Ted Yu for
the patch.
- Fix parsing of package when a comment follow the AS keyword. Thanks to
Eric Delanoe for the report.
- Adapt MAXVALUE for identity columns if the datatype has been changed to
integer.
- Fix a regression on data validation introduced with commit to fix data
export of virtual column.
- Fix Can't locate object method is_pk via package Ora2Pg error
- Exclude unique keys using expression to validate data.
- Fix ORDER BY clause for data validation.
- Fix error on open pragma when encoding is not set.
- Fix a regression in data export of virtual column. Thanks to Code-UV and
IgorM12 for the report.
- Fix a second regression with empty column name in target list to
retrieve data.
- Fix PG version to enable virtual column.
- Fix binmode when it is set to raw or locale to not call encoding() in
open pragma.
- Fix regression in export view as table. Thanks to Sebastian Albert for
the report.
- Update Copyright year.
- Quote tables names when necessary during TEST action.
- Fix undefined call to auto_set_encoding().
- Add test count of column per table and add output of the PG table struct
modified to be used with MODIFY_STRUCT.
- Fix handling of PRESERVE_CASE with update au sequences values
- Fix handling of PRESERVE_CASE with TEST_DATA
- Fix unwanted replacement of sysdate operation to epoch. Thanks to taptarap
for the report.
- Remove extra END clause at end of package function when a space or a
comment was present. Thanks to taptarap for the report.
- Fix missing import of module Encode. Thanks to Menelaos Perdikeas for
the report.
- Fix case where data type defined in function was not exported when
EXPORT_SCHEMA was enabled. Thanks to Eric Bourlon for the report.
- Fix missing EXECUTE on OPEN CURSOR statements. Thanks to taptarap for
the report.
- Fix missing declaration of min() function in Oracle.pm. Thanks to
nicscanna for the report.
- Fix SYSDATE subtract of seconds instead of days
- Fix PERFORM replacement in CTE. Thanks to taptarap for the report.
- Fix wrong stored procedure code conversion when use types named with
"default" and broken decode to case translation. Thanks to taptarap
for the report.
- Add missing import of FTS indexes in script import_all.sh. Thanks to
vijaynsheth for the report.
- Fix another procedure parsing with return. Thanks to Eric Bourlon for
the report.
- Fix case where parenthesis are not added to index creation.
- Add creation of the uuid extension when it is used.
- Add HTML report of tables and columns with name > 63 characters.
- Add report of DBMS_ERROR and Quartz Scheduler tables found.
- Add mark (date?) on columns of DATE data type in Oracle to check if
it should be translated into date instead of default timestamp.
- SHOW_COLUMN: mark column data type with (numeric?) when it is a NUMBER
without precision.
- SHOW_TABLE+SHOW_COLUMN: Add mark of tables and columns name > 63
characters
- Fix translation of TYPE ... AS TABLE OF ...
- Fix parsing of function call in check constraints. Thanks to Menelaos
Perdikeas for the report.
- Fix missing data export file for partitioned tables when TRUNCATE_TABLE
was disabled. Thanks to Menelaos Perdikeas for the report.
- Fix named parameter inserted in procedure call with inout parameters.
Thanks to Rui Pereira for the report.
- Fix unwanted quoting of index columns clause when there is an operation.
Thanks to Menelaos Perdikeas for the report.
- Move comment in procedure parameters before the BEGIN. Thanks to Eric
Bourlon for the report.
- Fix parsing of FOR CUSOR followed by a parenthesis. Thanks to Eric Bourlon
for the report.
- Fix parsing of TYPE ... IS REF CUSOR declaration in procedures. Thanks to
Eric Bourlon for the report.
- Add replacement of SDO_CS.TRANSFORM into ST_Transform. Thanks to mukesh3388
for the report.
- Add missing table namer to index renaming.
- Create a function for index renaming for code reuse.
- Fix support translation of type VARRAY from store procedure. Thanks to
Eric Bourlon for the report.
- Fix conversion of SQL%ROWCOUNT when part of a string concatenation. Thanks
to boubou191911 for the report.
- Remove other non alphanumeric character from index name. Thanks to Menelaos
Perdikeas for the report.
- Fix date formatting when error is logged with INSERT failure. Thanks to
xinjirufen for the report.
- Remove possible comma from index renaming.
- Fix drop of indexes with renaming when there is a function call. Thanks to
Menelaos Perdikeas for the report.
- Fix empty geometry type since the move of ORA2PG_SDO_GTYPE into
lib/Ora2Pg/Oracle.pm
- Move most of the Oracle specific code to a dedicated Perl library
lib/Ora2Pg/Oracle.pm with the same functions as lib/Ora2Pg/MySQL.pm
This will help to maintain and extend Ora2Pg to other RDMS. There is
still Oracle database related specific code in the main library but
it will be also moved later. There should not be any regression or
usage change with this huge patch.
- Fix translation of type with not null clause. Thanks to Yasir1811 for
the report.
2021 11 15 - v23.0
This release fix several issues reported since past five months and
adds some new major features and improvements.
* Add new option --blob_to_lo that can be used to export BLOB as large
objects. It can only be used with action SHOW_COLUMN, TABLE and INSERT.
When used with TABLE action, the BLOB column will be translated into oid
PostgreSQL data type. When used with the INSERT export action BLOB data
will be store as large object in the pg_largeobjects table and the oid
referencing this large object will be stored in the main table instead
of a bytea.
It is not possible to use oid with COPY because this feature use function
lo_from_bytea() that stores the large object in the external table and
returns the oid.
This feature works with or without the use of oracle_fdw to import the
data and option -J can be used to improve the speed of the INSERT import
provide that there is a numeric unique key on the table.
Thanks to rodiq for the feature request.
* Add command line option -W | --where clause to set the WHERE clauses to
apply to the Oracle query to retrieve data. It can be used multiple time.
It will override the WHERE configuration directive if there is a global
WHERE clause or the same table WHERE clause definition. Otherwise the
clause will be appended.
* Add data validation feature consisting in comparing data retrieved from a
foreign table pointing to the source Oracle table and a local PostgreSQL
table resulting from the data export. By default Ora2Pg will extract 10000
rows from both side, you can change this value using DATA_VALIDATION_ROWS.
When it is set to zero all rows of the tables will be compared.
Data validation requires that the table has a primary key or unique index
and that the key columns is not a LOB.
Due to differences in sort behavior between Oracle and PostgreSQL, if the
collation of unique key columns in PostgreSQL is not 'C', the sort order of
is different compared to Oracle. In this case the data validation will fail.
Ora2Pg will stop comparing two tables after 10 errors, result is dumped to
an output file named data_validation.log.
* Add DATA_VALIDATION_ORDERING configuration directive enabled by default.
Order of rows between both sides are different once the data have been
modified. In this case data must be ordered using a primary key or a
unique index, that mean that a table without such object can not be
compared. If the validation is done just after data import in mode single
process and without any data modification the validation can be done on all
tables without any ordering.
* Add DATA_VALIDATION_ERROR to stop validating data from a table after a
certain amount of row mismatch. Default is to stop after 10 rows
validation errors.
* Allow multiprocess for TEST_DATA action to validate data import. Use -P
or PARALLEL_TABLES to set the number of parallel tables checked. Output
is now done to a file named data_validation.log saved in the current
directory.
* Add replacement of UTL_RAW.CAST_TO_RAW with encode().
* Add rewrite of XMLTYPE() with xmlparse(DOCUMENT convert_from(..., 'utf-8')).
* Add VARCHAR_TO_TEXT configuration directive. By default VARCHAR2 without
size constraint are tranlated into text PG data type. If you want to use
varchar instead, disable this directive.
* Add detection of XML function for migration assessment cost.
* Add DBMS_RANDOM to the list of Oraclism handled by Orafce.
* Add support to mysql_fdw foreign data wrapper to export data
PostgreSQL tables. Thanks to Yoni Sade for the feature request.
* Allow to transform all NUMBER(*,scale) to an other data type by a
redefinition like NUMBER(*\,2):decimal in the DATA_TYPE configuration
directive. Thanks to Florent Jardin for the patch.
* Add information on how to use SSL encrypted connection to documentation.
* Add TEST_COUNT action to just report the row count diff between Oracle and
Backward compatibility changes:
- Add FORCE_PLSQL_ENCODING configuration directive. By default Ora2Pg
encode all functions code to ut8, this sometime can generate double
encoding. To change this behavior, disable this configuration directive.
Thanks to rynerisraid and lee-jongbeom for the report.
- Change behavior regarding RAW columns. Now RAW(16) and RAW(32) columns or
RAW columns with "SYS_GUID()" as default value are now automatically
translated into uuid. Data will be automatically migrated as PostgreSQL
uuid data type provided by the "uuid-ossp" extension. To recover the old
behavior to export data as bytea whatever is the precision, the following
must be set with DATA_TYPE configuration: RAW(16):bytea,RAW(32):bytea
Complete list of changes:
- Fix USE_LOB_LOCATOR handling.
- Fix data validation using oracle_fdw where zero after decimal is not strip
unlike with PG.
- Apply MODIFY_STRUCT redefinition to test actions
- Fix PG filter when DATA_VALIDATION_ORDERING is disabled
- Apply RAW to uuid transformation for data validation
- Apply boolean transformation for data validation
- Do not export data for virtual column for PG >= 13.
- Fix wrong replacement function with name including a regexp_* function in
his name. Thanks to Rui Pereira for the report.
- Remove comments in the from clause before rewrite outer join (+), the entire
FROM clause will be rewritten and we don't know where to restore.
- Fix export of columns information for data verification.
- Fix TEST_VIEW for row count returned by views to exclude views created in
extensions.
- Fix comment on procedures
- Fix translation of MySQL type UNSIGNED
- Fix test count of indexes for MySQL database.
- Fix test MySQL sequence count.
- Do not display error messages when user and db is first checked in the
import_all.sh script
- Fix ordering of check constraints
- Fix mysql table scan when table name is using reserved word. Thanks to
Stanley Sung for the report.
- Fix double BOTH keyword in TRIM function. Thanks to Rui Pereira for the
report.
- Fix aliases placed in a wrong way. Thanks to Rui Pereira for the report.
- Fix parsing of procedure broken on keyword RETURN. Thanks to Pavithra
Jayasankar.
- Fix case where default partition is taken as a value. Thanks to Karsten
Lenz for the report.
- Fix conversion of NUMBER without precision in PL/SQL code to respect
settings PG_NUMERIC_TYPE, PG_INTEGER_TYPE and DEFAULT_NUMERIC. Fix
translation of INTEGER/BINARY_INTEGER that was wrongly exported as
numeric. Thanks to Philippe Beaudoin for the report.
- Documentation fix. Thanks to mperdikeas for the patch.
- Fix case where SQL%ROWCOUNT was not replaced by GET DIAGNOSTIC. Thanks to
Awdotia Romanowna for the report.
- Fix quote of unique constraints name. Thanks to Veka for the report.
- Fix looking at package function metadata when there is a huge amount of
package.
- Fix error when trying to remove temporary files.
- Fix wrong translation of a call to a procedure with PRAGMA AUTONOMOUS
TRANSACTION through dblink. Thanks to Rui Pereira for the report.
- Remove schema name in front of index name. Thanks to Menelaos Perdikeas
for the report.
- Fix virtual column generated from an other column of the table (supported
in PG 12). Thanks to Veka for the report.
- Fix case of columns names in boolean transformation when oracle_fdw is used
to export data. Thanks to veka for the report.
- Remove extra parenthesis with sub query and TABLE function. Thanks to Rui
Pereira for the report.
- Fix WHERE clause not removed in ROWNUM replacement. Thanks to Rui Pereira
for the report.
- Exclude extensions tables from table test count. Thanks to Yoni Sade for the
report.
- Fix pg_attribute column adsrc removed in PG 12. Thank to Thorsten Hochreuter
for the patch.
- Fix unwanted aliases after row_number() over(). Thanks to Rui Pereira for
the report.
- Fix several spelling issues. Thanks to Florian Eckert for the patch.
- Fix wrong condition to import constraints in import_all.sh. Thanks to
Thorsten Hochreuter for the report.
- Fix BITMAP_AS_GIN detection. Thanks to Nishanth Bejgam for the patch.
- Fix parsing of views from file and add PASSWORD, KEY and REF to the list
of reserved keywords.
- Fix replacement of CURSOR ... IS when there is comment after IS.
- Fix comment in auto generated file global_variables.conf
- Fix XML data export that was transformed by the call to function
extract(/).getClobVal(), it is now replaced by a direct call to
getClobVal().
- Improve COPY FREEZE data export when FILE_PER_TABLE is enabled, the
transactions are now managed per individual file and not following
the main file. Thanks to Yoni Sade for the report.
- Fix addition to UNLOGGED keyword on foreign table when exporting
data using oracle_fdw. Thanks to Veka for the report.
- Fix FK error when using TRUNCATE before data export with oracle_fdw.
- Fix export of user defined type. Actually type definitions are extracted
from ALL_SOURCE which contain the original CREATE TYPE and eventually
all the ALTER TYPE commands. Previously those type as considered as not
supported by Ora2Pg.
- replace date(n) by timestamp.
- Always remove the fqdn SYS schema before functions call.
- Add report of GTT in SHOW_TABLE action.
- Fix empty partition values for Oracle 9i.
- Add creation of schema in user defined type export when EXPORT_SCHEMA is
enabled to fix an error when the schema has not already been created.
- Fix some wordings and exclude from export user defined type starting
with SYS_PLSQL_ found in a 9i export. It looks that they are internal
to PL/SQL code.
- Exclude DBMS_SQL from the DBMS count in migration assessment when
USE_ORAFCE is enabled.
- Handle case where indexes name include the schema at create time
- Fix PL/SQL numeric datatype conversion
2021 07 02 - v22.1
This is a maintenance release to extend the feature of data export through the
oracle_fdw PostgreSQL extension to migration that use the public schema and
do not preserve case.
There is also some other fixes:
- Fix compile_schema() call that breaks valid function based indexes by
adding compile_all => FALSE to DBMS_UTILITY.compile_schema().
Thanks to Pawel Fengler for the patch.
- Force foreign table for data export as readonly to avoid accidental
write if import schema is not cleaned.
- Fix data export to file not possible since last changes for oracle_fdw
export. Thanks to Niels Jespersen for the report.
2021 06 26 - v22.0
This release fix several issues reported since past three months and
adds some new features and improvements. I must thanks MigOps Inc who
hire me to drive Oracle to PostgreSQL migrations and to develop Ora2Pg.
It's been a long time that I was looking for such a company and it is
an amazing gift for the 20 years of Ora2Pg. All improvements and new
new features developed during my work at MigOps will be available in
the public GitHub repository, here are the new ones.
- Add export of data using oracle_fdw when FDW_SERVER is set and export
type is COPY or INSERT. Multi-process using -P or -J is fully supported
but option -j is useless in this case. Boolean transformation of some
columns or data type is also supported. Actually, expect that it works
just like data migration without oracle_fdw. This can improve the data
migration speed from 30 to 40% especially for BLOB export.
- Improve export performances with huge number of objects by avoiding join
between Oracle catalog tables.
- Set a maximum of assessment score for tables, indexes, sequences,
partitions, global temporary table and synonym following the number of
objects.
- Add detection of XML functions to the assessment cost.
- Allow to change the assessment cost unit value in the export_all.sh script
when ora2pg is used with options --init_project and --cost_unit_value.
- Remove pragma restrict_references from P/PSQL code, it is useless.
- Add the oracle schema to search_path in SQL files generated and improve
the migration assessment when USE_ORAFCE is enabled.
- Apply ALLOW and EXCLUDED filtered stored procedures at package extraction
level. Previous this patch there was no way to not export some package
functions or to exclude them from assessment.
- Add new tests to check sequences last values and number of identity columns
in both side.
- Apply ALLOW/EXCLUDE without object to table object by default in TEST
action.
New configuration directives:
- Add ORACLE_FDW_TRANSFORM configuration directive to apply a transformation
to a column when exporting data. Value must be a semicolon separated list of
TABLE[COLUMN_NAME, <replace code in SELECT target list>]
For example to replace string 'Oracle' by 'PostgreSQL' in a varchar2 column
use the following.
ERROR_LOG[DBMS_TYPE:regexp_replace("DBMS_TYPE",'Oracle','PostgreSQL')]
Thanks to MigOps for the patch.
- Add DROP_IF_EXISTS configuration directive to add a statement
"DROP <OBJECT> IF EXISTS" before creating the object. Can be
useful in an iterative work. Default is disabled. Thanks to
dherzhau for the feature request.
Backward compatibility:
There is a backward compatibility issue with old configuration files
where FDW_SERVER is set by default. This directive was not used when
exporting data, this is not the case anymore as it instruct Ora2Pg to
use the given foreign server to use oracle_fdw to migrate the data.
Here is the full list of changes and acknowledgements:
- Fix replacement of TO_CLOB() function, now it is just removed and the
parenthesis are kept. Thanks to Rui Pereira for the report.
- Fix incorrect detection of cursor on dynamic query. Thanks to Rui
Pereira for the report.
- Fix quoting column names with spaces and dots. Dots are replaced by
underscore. Thanks to Veka for the report.
- Fix one case where DEFINED_PKEY with PRESERVE_CASE was not handled
correctly. Thanks to Veka for the report.
- Fix quoting of reserved keywords in CREATE INDEX columns names. Thanks
to Veka for the report.
- Fix column name starting with number not quoted in COMMENT. Thanks to
Veka for the report.
- Fix addition of PERFORM on call to stored procedures not prefixed by
the package name. Thanks to Rui Pereira fo the report.
- Fix search of ora2pg_conf.dist under Windows instead of ora2pg.conf.dist
when --init_project is used. Thanks to Julien Monticolo for the report.
- Fix translation from file of check constraint when created on same column,
only the last one was exported. Also shortened the prefix for constraint
naming, ora2pg_ckey becomes o2pc, ora2pg_ukey is now o2pu and ora2pg_fkey
is renamed into o2pf. Thanks to anvithaprabhu8 for the report.
- Replace wildcard precision * for numeric by 38.
- Fix incomplete listagg() conversion. Thanks to avandras for the report.
- Fix potential problem in last_day conversion when USE_ORAFCE is off and
a number is added or subtracted to the last day. Thanks to atlterry for
the report.
- Do not apply utf8 conversion of comments to input files.
- Fix termination of last writer process when parallel and quiet mode are
used together. Thanks to David Harper for the patch.
- Remove precision in number of digit in timestamp microseconds when
setting NLS_TIMESTAMP_FORMAT at session startup. Now use:
ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS.FF'
instead of '.FF6'. This was possibly the cause of sporadic error:
ORA-03106: fatal two-task communication protocol error (DBD ERROR: OCIStmtFetch)
Default is precision 6 so it may not change anything. Thanks to
Abhijeet Bonde for the report.
- Fix call to deprecated MySQL spatial function when version is after 5.7.6.
Thanks to naveenjul29 for the report.
- Fix false positive detection for nested table with MySQL export.
- Fix sequence export read from file.
- Add PG_VERSION to the documentation. Thanks to xinjirufen for the report.
- Fix error report when preparing query to ALL_IND_COLUMNS IC. Thanks to
ganeshakorde for the report.
- ora2pg_scanner: Fix detection of service_name in DSN.
- Fix error raise_application_error() with named parameters.
- Fix replacement of out parameters in triggers.
- Change sequence export result storage to hash instead of array.
- Fix package export when there is a comment between PACKAGE BODY and the
name of the package.
- Fix Perl error "malformed utf-8 character in substitution" when there is
character not in utf8 in the comment or constants.
- Fix detection of MySQL FUNCTION vs PROCEDURE for version >= 5.5. Thanks
to naveenjul29 for the report.
- Exclude nested tables from the export as it is not supported and it
always generate an error. A warning is raised.
- Fix column case in check constraints when PRESERVE_CASE is enabled.
- Fix search_path in direct PG data export when PG_SCHEMA is set.
- Fix -Infinity insert for direct PG data export.
- Fix drop indexes when PRESERVE_CASE is enabled.
- Remove potential double affectation for function with out parameter.
- Create immutable to_char function when used in an index.
- Replace dmake by gmake on Windows installation instruction. Thanks to
Julien Monticolo for the report.
- Fix MySQL version conditions. Thanks to Christoph Berg for the report.
- Fix HASH partitioning for duplicate WITH clause.
- Fix tests when no schema are set to compare all objects in all schemes.
Thanks to gp4git and dlc75 for the report.
- Apply ALLOW/EXCLUDE without object to table object by default in TEST
action. Thanks to Yony Sade for the feature request.
- Add DROP_IF_EXISTS configuration directive. Thanks to dherzhau for the
feature request.
- Fix regression in removing %ROWTYPE from function parameters. Thanks to
Eric Delanoe for the report.
- Fix not adding default values to parameters when this is an OUT parameter.
Thanks to Eric Delanoe for the report.
- Fix ALL_DIRECTORIES call be using table name relative to USER_GRANTS.
Thanks to Yoni Sade for the report.
- Change all remaining call to static ALL_* tables to a call relative to
USER_GRANTS. Thanks to Yoni Sade for the report.
- Fix export or partitioned table with unsupported partitioning type
like PARTITION BY REFERENCE. The table is created without partition
and a warning it fired as well as the following message in the output
file as a comment: -- Unsupported partition type, please check
2021 04 01 - v21.1
This release fix several issues reported since past six months and
as usual adds some new features and improvements.
* Now that Orafce 3.15.0 has a definition for the REGEXP_* function,
makes the translation optional to USE_ORAFCE directive.
* Add set application name in connection to Oracle/MySql/PostgreSQL.
* Add translation of REGEXP_COUNT() and change assessment cost.
* Rewrite the way REGEXP_LIKE() is translated into regexp_match to
support modifiers. This rewrite also fix default behavior between
Oracle and PostgreSQL.
* Replace DBMS_LOB.GETLENGTH() by PostgreSQL octet_length() function.
* Add types correspondences for VARCHAR2 and NVARCHAR2 in DATA_TYPE
configuration directive.
* Add autodetection and support of geometry type, srid and dimension
for ArcGis geometries.
* Add conversion of default value in function parameters.
* Add -u | --unit option to ora2pg_scanner to be able to set the
migration cost unit value globally.
* Replace DBMS_LOB.SUBSTR() by SUBSTR()
* Remove TO_CLOB() it is useless, manual cast could be necessary.
* Replace IS JSON validation clause in CHECK constraints by
(CASE WHEN $1::json IS NULL THEN true ELSE true END)
When the code is invalid an error is fired.
* DISTINCT and UNIQUE are synonym on Oracle
Backward compatibility changes:
- Force a column to be bigint if this is an identity column. Thanks
to MigOps.com for the patch.
- Fix EMPTY_LOB_NULL, enable/disable was inverted, keeping default
to enabled. Take care that in old ora2pg.conf it is disabled so it
will break backward compatibility with old configuration.
- Replace NO_LOB_LOCATOR with USE_LOB_LOCATOR and NO_BLOB_EXPORT
with ENABLE_BLOB_EXPORT to avoid confusion with double negative
variable. Backward compatibility is preserved with a warning.
- SRID for SDO_GEOMETRY export is now taken from the value not forced
from the metadata table.
Here is the full list of changes and acknowledgements:
- Take Geometry SRID from the data and fallback to SRID defined in
metadata when not found. Thanks to Sebastian Albert for the report.
- Fix case where Ora2Pg temporary substitution of '' by placeholder
was not restored. Thanks to MigOps.com for the patch.
- Fix identity column export on unsupported Oracle 18c options.
Thanks to MigOps.com for the patch.
- Fix export of columns indexes created with single quote.
Thanks to MigOps.com for the patch.
- Fix replacement of keyword PROCEDURE by FUNCTION in constraints
constants definition. Thanks to marie-joechahine for the report.
- Replace IS JSON validation clause in CHECK constraints. Thanks to
marie-joechahine for the report and MigOps.com for the patch.
- Add support to ON OVERFLOW clause in LISTAGG replacement.
Thanks to MigOps.com for the patch.
- Fix incorrect handling of HAVING+GROUP BY rewriting.
Thanks to MigOps.com for the patch.
- Add replacement of TO_NCHAR by a cast to varchar. Thanks to
MigOps.com for the patch.
- Fix replacement of NOTFOUND when there is extra space or new line
in the WHEN EXIT clause. Thanks to MigOps.com for the patch.
- Fix a regression in NO_VIEW_ORDERING, it was not taken in account
anymore. Thanks to RonJojn2 for the report.
- Replace DATA_TYPE with DTD_IDENTIFIER in MySQL catalog queries for
version prior 5.5.0. Thanks to zejeanmi for the report.
- Fix import script to import sequences before tables. Thanks to
MigOps.com for the patch.
- Fix detail report of custom type in migration assessment. Thanks
to MigOps.com for the patch.
- Fix duplicate schema prefixed to SYNONYM. Thanks to dlc75 for the
reports.
- Replace NO_LOB_LOCATOR with USE_LOB_LOCATOR and NO_BLOB_EXPORT with
ENABLE_BLOB_EXPORT to avoid confusion with double negative variable.
Thanks to Rob Johnson for the report.
- Fix some missing replacements of NVL and rewrite !=-1 into != -1.
Thanks to MigOps.com for the patch.
- Fix ROWNUM followed by + or - operator and when no aliases are
provided. Thanks to MigOps.com for the patch.
- Add DBSFWUSER to the list of user/schema exclusion. Thanks to
MigOps.com for the patch.
- Fix regexp to not append subquery aliases on JOIN clause. Thanks
to Rui Pereira for the report.
- Handle PRESERVE_CASE and EXPORT_SCHEMA in sequence name. Thanks
to marie-joechahine for the report.
- Add CREATE SCHEMA statement to sequence export when EXPORT_SCHEMA
is enabled. Thanks to marie-joechahine for the report.
- Fix duplicate index name on subpartition. Thanks to Philippe
Beaudoin for the report.
- Exclude sequences used for IDENTITY column (ISEQ$$_). Thanks to
marie-joechahine for the report.
- Fix parsing from file of CREATE SEQUENCE. Thanks to Rui Pereira
for the report.
- In export_all.sh script use the database owner provided if it is a
superuser instead of postgres user. Thanks to jjune235 for the
feature request.
- Fix parsing of triggers when there is a CASE inside the code.
Thanks to Rui Pereira for the report.
- Add set application name in connection to Oracle/MySql/PostgreSQL.
Thanks to Yoni Sade for the patch.
- Fix double column alias when replacing ROWNUM. Thanks to Rui
Pereira for the report.
- Add translation of the REGEXP_COUNT function and change assessment
cost.
- Rewrite the way REGEXP_LIKE is translated into regexp_match to
support modifiers. This rewrite also fix default behavior between
Oracle and PostgreSQL. Thanks to otterrisk for the report.
- Add IS JSON to assessment. Thanks to marie-joe Chahine for the
report.
- Fix multi-columns RANGE partitioning. Thanks to Philippe Beaudoin
for the report.
- Improve reordering columns. Sort by fieldsize first, if same size
then it sorts by original position. Thanks to Sebastien Caunes for
the patch.
- Append partition's column to the primary key of the table as it
must be part of the PK on PostgreSQL. Thanks to xinjirufen for the