darold / ora2pg

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.
http://www.ora2pg.com/
GNU General Public License v3.0
1.03k stars 343 forks source link

Have a question for my error. #816

Closed CHO-Hoon-Yeon closed 5 years ago

CHO-Hoon-Yeon commented 5 years ago

Hi there, i've question for this Ora2pg.

when i use this one, there is an error occurs now. Error name is
Wide character in subroutine entry at C:/Strawberry/perl/site/lib/Ora2Pg.pm line 14581. DBD::Pg::st execute failed: ERROR: 繝ェ繝ャ繝シ繧キ繝ァ繝ウ"u_t_in_out_stock_info"縺ッ 蟄伜惠縺励∪縺帙s LINE 1: INSERT INTO u_t_in_out_stock_info (business_cd,in_outstock... ^ at C:/Strawberry/perl/site/lib/Ora2Pg.pm line 14581. Wide character in print at C:/Strawberry/perl/site/lib/Ora2Pg.pm line 13666. FATAL: ERROR: 繝ェ繝ャ繝シ繧キ繝ァ繝ウ"u_t_in_out_stock_info"縺ッ蟄伜惠縺励∪縺帙s LINE 1: INSERT INTO u_t_in_out_stock_info (business_cd,in_outstock...

I can't find what's wrong.

and encoding is

Current encoding settings that will be used by Ora2pg: Oracle NLS_LANG AMERICAN_AMERICA.AL32UTF8 Oracle NLS_NCHAR AL32UTF8 Oracle NLS_TIMESTAMP_FORMAT YYYY-MM-DD HH24:MI:SS.FF6 Oracle NLS_DATE_FORMAT YYYY-MM-DD HH24:MI:SS PostgreSQL CLIENT_ENCODING UTF8 Perl output encoding'' Showing current Oracle encoding and possible PostgreSQL client encoding: Oracle NLS_LANG AMERICAN_AMERICA.AL32UTF8 Oracle NLS_NCHAR AL32UTF8 Oracle NLS_TIMESTAMP_FORMAT YYYY-MM-DD HH24:MI:SS.FF6 Oracle NLS_DATE_FORMAT YYYY-MM-DD HH24:MI:SS PostgreSQL CLIENT_ENCODING

darold commented 5 years ago

The Windows terminal doesn't support unicode which make Perl fail to process UTF8, an other possibility is that you have non utf8 charactger in the database. However I recommend you to use Linux, I have very poor knowledge on Windows.

CHO-Hoon-Yeon commented 5 years ago

all right. and you say, i checked my postgresql, still client encoding is encoded by SJIS. Maybe this is problem.

CHO-Hoon-Yeon commented 5 years ago

hey buddy, i've another question. when i check my ERROR LOG, it says 'Sending COPY bulk output directly to PostgreSQL backend Wide character in subroutine entry at C:/Strawberry/perl/site/lib/Ora2Pg.pm line 14482. DBD::Pg::db do failed: ERROR: Relation"u_t_in_out_stock_info"can't find at C:/Strawberry/perl/site/lib/Ora2Pg.pm line 14482. Wide character in print at C:/Strawberry/perl/site/lib/Ora2Pg.pm line 13666.'

my question's 1st one is , Do i change something to solve Wide character in subroutine problem? and 2nd one is , am i must build relation to moving database?? thanks for helping newbie

darold commented 5 years ago

You can try to use NLS_LANG and CLIENT_ENCODING in ora2pg.conf with SJIS encoding. It seems that Oracle sent data that are not in strict utf8 encoding so for this table you can try other encoding that will support the extented characters that are not UTF8.

CHO-Hoon-Yeon commented 5 years ago

all right. i solved problem. when i see extracted logfile, that file's character is fine so thanks. and i have another question. i've made 1M amount of dummy data. when i use Ora2pg to send data, nothing happened on my PostgreSQL. am i should change my configure file??

CHO-Hoon-Yeon commented 5 years ago

and log is [2019-10-03 10:41:19] Isolation level: SET TRANSACTION ISOLATION LEVEL SERIALIZABLE [2019-10-03 10:41:19] Retrieving table information... [2019-10-03 10:41:20] [1] Scanning table TEST.U_T_IN_OUT_STOCK_INFO (1 rows)... [2019-10-03 10:41:20] Trying to connect to database: dbi:Oracle:host=localhost;sid=orcl;port=1521 [2019-10-03 10:41:20] Isolation level: SET TRANSACTION ISOLATION LEVEL SERIALIZABLE [2019-10-03 10:41:20] Retrieving partitions information... [2019-10-03 10:41:21] Looking how to retrieve data from TEST.U_T_IN_OUT_STOCK_INFO... [2019-10-03 10:41:21] DEGUG: Query sent to Oracle: SELECT "BUSINESS_CD","IN_OUT_STOCK_NO","IN_OUT_STOCK_SEQ","BRANCH_NO","CORRECTION_SEQ","MASTER_STANDARD_DATE","CORRECTION_FLAG","ORIGIN_IN_STOCK_NO","ORIGIN_IN_STOCK_SEQ","CENTER_CD","IN_OUT_STOCK_DATE","IN_OUT_STOCK_CLASS","IN_OUT_STOCK_FLAG","LOCATION_CD","BAILOR_CD","ITEM_MANAGEMENT_NO","IN_UNIT","OUT_UNIT","TEMPERATURE_CD","BASIS_FLAG","BASIS_DATE","OUT_STOCK_DEADLINE","CASE_INPUT_NUMBER","IN_STOCK_NUMBER","IN_STOCK_REGULATE_NUMBER","LIMIT_FLAG","LIMIT_IN_STOCK_NUMBER","LIMIT_OUT_STOCK_NUMBER","OUT_STOCK_NUMBER","OUT_STOCK_REGULATE_NUMBER","LOT","REF","REMARKS","TOTAL_WEIGHT","AMOUNT","ENTRY_FLAG","DISTRIBUTION_BASIS_DATE","LATEST_BASIS_DATE","CUT_OFF_FLAG","CUF_OFF_COUNT","CUT_OFF_USER","DELIVERY_CUST_CD","ARRIVAL_CENTER_CD","DELIVERY_CUST_FLAG","TRANSFER_TYPE","OUT_FIX_SCHEDULED_DATE","DELIVERY_DATE","STOCK_MATCH_DATE","STOCK_PLAN_NO","STOCK_PLAN_SEQ","SLIP_NO","SLIP_SEQ","REMARKS_1","REAMRKS_2","REMARKS_3","REASON_CD","IN_OUT_STOCK_FIX_FLAG","IN_OUT_STOCK_FIX_DATE","IN_OUT_STOCK_FIX_USER","CURRENT_STOCK_UPDATE_FLAG","OMIT_FLAG","OMIT_DATE","INSERT_USER_CD","INSERT_DATE","RECORD_USER_CD","RECORD_DATE" FROM "TEST"."U_T_IN_OUT_STOCK_INFO" a [2019-10-03 10:41:21] Fetching all data from TEST.U_T_IN_OUT_STOCK_INFO tuples... and this is all.

CHO-Hoon-Yeon commented 5 years ago

sorry, never mind about my problem. i solved.