SSIS Flat File Import into Oracle failing despite DT_WSTR definitions - oracle

I am getting error messages about being unable to convert between unicode and non-unicode character sets when trying to import a flat file via SSIS.
My flat file is UTf-8 encoded according to Notepad++. The file contains characters such as the "microgram" character (µg) for example.
My flat file connection manager is set up to use 65001 (UTF8) and all my columns are set up on my flat file connection manager to be DT_WSTR, and the data previews OK in the flat file connection manager.
My database is Oracle 11g, using Microsoft Oracle OLEDB driver for Oracle.
I have tried VARCHAR2 and NVARCHAR dta types in Oracle, but when I connect my DT_WSTR (65001) columns to my Oracle tables, I get the unicode conversion error.
I have tried conversion steps in my SSIS packaged, to convert to DT_WSTR and DT_STR. Had some success with DT_STR, but I got my microgram symbol scrambled.
How hard should this be? I set up a 65001 text file connection, with DT_WSTR column types and I cannot for the life of me connect it to Oracle using VARCHAR2, NVARCHAR.
Any advice appreciated.
Stephen

Related

Datatype difference

We recently migrated database from sybase → AWS postgres using SCT/DMS. However we are finding the Sybase datatype CLOB is converted by SCT to text and DMS has migrated the CLOB content in Sybase to plain xml text in postgres.
appreciate any advise/insight on how we move forward on this.

migrating database from access 2003 to oracle Arabic characters are shown as question marks

UPDATE
as answer below shows that is error couse by JDBC so is there any
other suggestion to migrate access database to oracle database other
than using toad and the hard way to do it because trigger views
sequences wont be imported by that way so I have to create them by my
self??! :S
I am migrating database from access 2003 to oracle database 12c but Arabic characters are shown as question marks at the step where you connect to access database using SQL developers
I followed what you suggest at this answer and restart my pc but nothing changed
NOTE
when opening .mdb file from access Arabic characters shown right but when opening it from SQL developers I get question marks instead of arabic characters
is there anything else to do ?
I run that query as #krokodilko suggested and I get below result
select * from nls_database_parameters where parameter like '%CHAR%'
NLS_NCHAR_CONV_EXCP FALSE
NLS_NUMERIC_CHARACTERS .,
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_CHARACTERSET AR8MSWIN1256
select * from nls_session_parameters where parameter like '%LANG%';
NLS_LANGUAGE ENGLISH
NLS_DATE_LANGUAGE ENGLISH
by the way when I open another Oracle schema Arabic characters show correctly dose access has special encoding ?
Unfortunately, this looks like a problem with JDBC-ODBC Bridge. It does not work properly with the Access ODBC driver when text includes Unicode characters.
See other questions regarding MS Access over JDBC-ODBC Bridge like this:
Reading Unicode characters from an Access database via JDBC-ODBC.
There is also proposed solution which may work for general Java-to-MSAccess connection using pure Java JDBC driver (UCanAccess):
Manipulating an Access database from Java without ODBC
But, your question is about using SQL Developer for migration, so, it is not a solution for you, since SQL Developer supports only limited number of JDBC drivers. Not UCanAccess.
Hard-way is better than no-way.

Import dmp file created in Oracle 11g (WE8ISO8859P1) to Oracle 11g XE database (AL32UTF8)

I am regularly given a dmp file that gets created using oracle v.11g (using the exp utility).
I used to import this file to the Western European edition of Oracle 10g XE.
The import would terminate successfully without warnings but there was an error log (alert_xe.log) that would contstantly increase in size because I was using the the 32 Bit Oracle Database on a 64 Bit Windows OS.
I have now installed 11g XE and I am trying to import the same dmp file but I am seeing the following in the import log file:
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
export client uses WE8ISO8859P1 character set (possible charset conversion)
and the import terminates with warnings as I have a lot of the following errors:
IMP-00019: row rejected due to ORACLE error 12899
IMP-00003: ORACLE error 12899 encountered
ORA-12899: value too large for column XXX (actual: 256, maximum: 255)
I understand that the cause of the problem is that the source database is using byte semantics and my new 11g XE database is using multibyte character set.
I have no control over the source database so I cannot change anything there.
Moreover I cant pre-create the tables with columns definitions using character length semantics over byte semantics (as indicated here for example Character set in Oracle 11g r2 XE) as somethimes the source database schema gets changed (columns might get added) and I am not notified so that breaks the import.
Is there a solution to this problem?
Is there any way to use WE8MSWIN1252 with Oracle 11g XE?
No, unfortunately you can't do it.
As it's stated in Oracle official documentation:
9 Oracle Database XE Character and Language Configurations
Oracle Database XE is available only in Universal character set and language configurations:
The database is created using Unicode(AL32UTF8) character set, which is suitable for global data in any language.
http://docs.oracle.com/cd/E17781_01/install.112/e18803/toc.htm#XEINW138
The only workaround is to preallocate the tables in advanced.
I had the same issue.
When I run this command
imp <username>/<password>#<hostname> file=<filename>.dmp log=<filename>.log
It was showing
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
export client uses AR8MSWIN1256 character set (possible charset conversion)
IMP-00031: Must specify FULL=Y or provide FROMUSER/TOUSER or TABLES arguments
IMP-00000: Import terminated unsuccessfully
That mean my oracle server is AL32UTF8 character set and export dump file client use AR8MSWIN1256 character set.
So I just changed the oracle character set to AR8MSWIN1256 by using following command.
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
ALTER DATABASE OPEN;
ALTER DATABASE CHARACTER SET INTERNAL_USE AR8ISO8859P6;
SHUTDOWN IMMEDIATE;
STARTUP;
Then run again
imp <username>/<password>#<hostname> file=<filename>.dmp log=<filename>.log FULL=Y
I hope this anwser will help someone
Same problem i was facing to transfer data from oracle 11g to oracle xe version. what steps i have used at that time shown below:
'CONN SYS/(YOUR sys user PASSWORD) AS SYSDBA
SHUTDOWN IMMEDIATE;
STARTUP restrict;
ALTER DATABASE CHARACTER SET INTERNAL_USE WE8MSWIN1252;
SHUTDOWN IMMEDIATE;
STARTUP;'
Once oracle get started try to import your .dmp file after recreating user.

Oracle encoding problems

There is aan Oracle database with regional encoding for Kazakh language. There is also a client, but it uses UTF encoding.
When i update db field in Kazakh through pl/sql developer or call update proc in web application, these special characters becomes '?'.
But if i locate ora18n java file in oracle sql developer folder and update field in Kazakh, everithing works well.
How can solve my problem? If you need any db or clinet conf, u are welcome!

How to copy data encrypted by dbms_obfuscation_toolkit.DESEncrypt

I have an Oracle (10.2.0.4) database table with a column which is encrypted by dbms_obfuscation_toolkit.DESEncrypt tool kit.
Some of our data has been messed up by it getting re-encrypted with another key.
I want to do some testing on this data to try and recover it. Therefore, I want to copy the data from our live system and into a test system.
I've tried simply exporting the data from SQL Developer (in various text based formats), but the "binary" nature of the encrypted data seems to break the file format.
I tried exp, but this reported errors (although I'm not sure if this is to do with the encrypted data or not).
How can I copy just this one table's data from one database to another?
Thanks.
The errors I got when exporting the table are below. I was doing this from my local machine connecting to a remote database:
c:\>exp <user>/<password>#<sid> FILE=export.dmp TABLES=(TABLE1)
Export: Release 11.1.0.6.0 - Production on Thu Oct 14 20:46:51 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P15 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table TABLE1
EXP-00008: ORACLE error 904 encountered
ORA-00904: "MAXSIZE": invalid identifier
I would try with a database link. If you can't create a database link, you could try the COPY command of SQL*Plus, although I'm not sure if it would work with encrypted columns (it looks like this command is deprecated in the newest releases).
If this fails, the best tool to export/import data from Oracle to Oracle would probably be Data Pump (included in the DB).
It turned out that my Windows test database had a slightly different character set encoding when compared to our live (unix) system - WE8ISO8859P1 -v- WE8ISO8859P15. I did a character set conversion on my test database, using the instructions here and then I was able to import the data.

Resources