Oracle to MySql character set problem

Dear Gurus,
My database is Oracle 11g R2 (11.2.0.1.0) on Sun Solaris 10. To get data from mysql database for reporting purpose, I used DG4ODBC and followed strictly the OMSC note "Detailed Overview of Connecting Oracle to MySQL Using DG4ODBC Database Link [ID 1320645.1]. Here are main configuration steps:
- Check DG4ODBC 32/64-bit
- Install and configure ODBC Driver Manager unixodbc-2.2.14
- Install and configure MyODBC 5.1.8
- Configure tnsnames.ora and listener.ora
- Create db links
Oracle character set is AL32UTF8
MySQL charactoer set is uft8
$ODBC_HOME/etc/odbc.ini
[ODBC Data Sources]
myodbc5 = MyODBC 5.1 Driver DSN
[myodbc5]
Driver = /opt/mysql/myodbc5/lib/libmyodbc5.so
Description = Connector/ODBC 5.1 Driver DSN
SERVER = <mysql server ip>
PORT = 3306
USER = <mysql_user>
PASSWORD = ****
DATABASE = <mysql db name>
OPTION = 0
TRACE = OFF
$ORACLE_HOME/hs/admin/initmyodbc5.ora
# HS init parameters
HS_FDS_CONNECT_INFO=myodbc5 # Data source name in odbc.ini
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_SHAREABLE_NAME=/opt/unixodbc-2.2.14/lib/libodbc.so
HS_FDS_SUPPORT_STATISTICS=FALSE
HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P1
# ODBC env variables
set ODBCINI=$ODBC_HOME/etc/odbc.ini
My issue is I can query data from mysql database tables but the output is incorrect in character type columns (VARCHAR columns). It just shows the first character in such columns. I tried to read through some OMSC notes but none is useful. If you experienced on such issues, please share your idea / help me resolve it.
Thanks much in advance,
Hieu

S. Wolicki, Oracle wrote:
I have little experience with MySQL and ODBC Gateway, but this setting looks weird to me: HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P1. Why do you configure WE8ISO8859P1 when both databases are Unicode UTF-8. Shouldn't the setting be AMERICAN_AMERICA.AL32UTF8 instead?
-- SergiuszIf I set HS_LANGUAGE=AMERICAN_AMERICA.AL32UTF8 or without the HS_LANGUAGE setting, the following error will happen.
SQL> select count(*) from "nicenum_reserve"@ussd;
select count(*) from "nicenum_reserve"@ussd
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
I followed the metalink note "Error Ora-28500 and Sqlstate I Issuing Selects From a Unicode Oracle RDBMS With Dg4odbc To Mysql or SQL*Server [ID 756186.1]" to resolve the above error. The note guides to set HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P1 and resolved the above error.
The following are the output from original database (MySql) and Oracle via SQLPLUS and TOAD.
On MySQL database (Sorry because of the output format)
SQL> select ID, source_msisdn, target_msisdn, comment from nicenum_reserve where ID=91;
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ID | source_msisdn | target_msisdn | comment |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 91 | 841998444408 | 84996444188 | Close reservation becasue of swap activity |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
SQLRowCount returns 1
1 rows fetched
Via Sqlplus on Oracle server:
SQL> select "ID","source_msisdn","target_msisdn","comment" from "nicenum_reserve"@ussd where "ID"=91;
ID
source_msisdn
target_msisdn
comment
91
8 4 1 9 9 8 4 4 4 4 0 8
8 4 9 9 6 4 4 4 1 8 8
C l o s e r e s e r v a t i o n b e c a s u e o f s w a p a c t i v i
t y
Via TOAD connected to Oracle server:
ID source_msisdn target_msisdn comment
91     8     8     C
It's likely this issue related to character set settings but I don't know how to set it properly.
Brgds,
Hieu

Similar Messages

  • Oracle to Mysql character set conversion problem!!! PLZ IGNORE

    Hi Experts,
    I have created a database link from Oracle 10g to Mysql 5.
    I have installed Oracle Gateway 11g for this purpose.
    When i retreive the data from sql plus the text is displayed as question marks.
    Oracle 10g Database character set is WE8MSWIN1252
    Mysql character set --->latin1
    Character set of ODBC connector for mysql is  latin7
    Character set in the parameter file of HS folder is WE8MSWIN1252When i retrieve data from sql developer the text is fine(as i think it directly takes the character set of target) but
    when i login from sqlplus i get question marks!
    I have another post in Heterogeneous Connectivity forum
    Re: Oracle to Mysql character set conversion problem!!! PLZ HELP
    Kindly update your comments there,
    @@@@@@@@@@@@@@2
    Appreciate your help,
    regards
    Edited by: user10243788 on Apr 21, 2010 3:25 AM

    It is OK to post a globalization-related question in this forum in addition to the forum pertaining to the main technology. Not all experts follow all possible forums on OTN. Of course, you should cross-link the posts to let people merge the answers.
    Regarding the problem itself, make sure that SQL*Plus has the right NLS_LANG setting in the environment. On Windows, in the Command Prompt:
    C:\> set NLS_LANG=.WE8PC850
    C:\> sqlplus ...On Unix:
    $ setenv NLS_LANG .WE8ISO8859P1   (or NLS_LANG=.WE8ISO8859P1; export NLS_LANG)
    $ sqlplus ...-- Sergiusz

  • Oracle to Mysql character set conversion problem!!! PLZ HELP

    Hi Experts,
    I have created a database link from Oracle 10g to Mysql 5.
    I have installed Oracle Gateway 11g for this purpose.
    When i retreive the data from sql plus the text is displayed as question marks.
    Oracle 10g Database character set is WE8MSWIN1252
    Mysql character set --->latin1
    Character set of ODBC connector for mysql is  latin7
    Character set in the parameter file of HS folder is WE8MSWIN1252When i retrieve data from sql developer the text is fine(as i think it directly takes the character set of target) but
    when i login from sqlplus i get question marks!
    Appreciate your help,
    regards

    thank you for replying damorgan,
    my previous two threads in the "heterogeneous Connectivity" forum were for different issues, one was to enquire as to how i could connect from oracle to mysql(which i have marked as answered), the other is for error when i get when i tried accessing data(which i am still facing on my office machine ).
    I followed the steps from these two threads and was able to successfully connect to mysql on my personal PC at home, but faced some problem with text not displayed so i created this thread.
    I had created another thread similar to this in the globalisation support as i was facing issue with the character sets in a heterogenous setup, so wasen't clear as to which forum would be suitable for this issue.
    My apologies to everyone if this has offended you.

  • Oracle 8i us7ascii character set problem - help required urgent.

    Hi frnds,
    I have a oracle 8i database server installed on sun solaris os. The database character set is us7ascii. In one of the tables TIFF images are stored in a long column. I m trying to fetch these images using oracle 9i client and visual basic(oracle ODBC drivers). But i m unable to do so. I can not fetch special characters.
    Is it because of the character set problem? but when i run my code on the server itself, i m able to fetch the images. I tried to fetch the images using oracle 8 i client on windows XP machine but could not do so. Are there any special settings that i have to do on the client side?

    Indeed, it's an ODBC issue. Read this statement from Oracle:
    From ODBC 8.1.7.2.0 drivers onwards it's NOT possible any more to
    "disable" Characterset conversion by specifying for the NLS_LANG
    the same characterset as the database characterset. There is now
    ALWAYS a check to see if a codepoint is valid for that characterset.
    Typically you will encounter problems if you upgrade an environment
    that has NO NLS_LANG set on the client (or US7ASCII) and the database
    was also US7ASCII. This incorrect setup allowed you to store characters
    like èçàé in an US7ASCII database, with the new 8i drivers this is not possible
    any more.
    Basic problem is the 'wrong' characterset US7ASCII in the database. As long as no characterset conversion happens (that's the case on the unix server), special characters are no problem.
    Werner

  • Oracle character set problem - help reqed urgent !!

    Hello frnds,
    I have a oracle 8i database server installed on sun solaris os. The database character set is us7ascii. In one of the tables TIFF images are stored in a long column. I m trying to fetch these images using oracle 9i client and visual basic(oracle ODBC drivers). But i m unable to do so. I can not fetch special characters.
    Is it because of the character set problem? but when i run my code on the server itself, i m able to fetch the images. I tried to fetch the images using oracle 8 i client on windows XP machine but could not do so. Are there any special settings that i have to do on the client side?

    i run my code on the server itself, i m able to fetch
    the images. I tried to fetch the images using oracle
    8 i client on windows XP machine but could not do so.You able to fetch the image , So it is not because of the character set.
    First thing you need to consider is that use certified combination of OS , client and database server only. Check Certify - Oracle's Certification Matrices
    Virag

  • Backup failure due to Character set problem

    Hi,
    I am manually running a COLD backup script in Windows NT environment and all the logs has been captured below:
    Recovery Manager: Release 8.1.6.0.0 - Production
    RMAN-06005: connected to target database: db1 (DBID=754030292)
    RMAN-06009: using target database controlfile instead of recovery catalog
    RMAN> shutdown immediate;
    2> startup mount;
    3> RUN {
    4> ALLOCATE CHANNEL disk1 TYPE disk;
    5> BACKUP DATABASE TAG 'db1_db_full' FORMAT 'e:\backup\db1\db1_backup';
    6> copy current controlfile to 'e:\backup\db1\Control_db1.ctl';
    7> }
    8>
    RMAN-06405: database closed
    RMAN-06404: database dismounted
    RMAN-06402: Oracle instance shut down
    RMAN-06193: connected to target database (not started)
    RMAN-06196: Oracle instance started
    RMAN-06199: database mounted
    Total System Global Area 934143244 bytes
    Fixed Size 70924 bytes
    Variable Size 260554752 bytes
    Database Buffers 673439744 bytes
    Redo Buffers 77824 bytes
    RMAN-03022: compiling command: allocate
    RMAN-03023: executing command: allocate
    RMAN-08030: allocated channel: disk1
    RMAN-08500: channel disk1: sid=13 devtype=DISK
    RMAN-03022: compiling command: backup
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure during compilation of command
    RMAN-03013: command type: backup
    RMAN-06003: ORACLE error from target database: ORA-06550: line 1, column 166:
    PLS-00553: character set name is not recognized
    ORA-06550: line 0, column 0:
    PL/SQL: Compilation unit analysis terminated
    RMAN-06031: could not translate database keyword
    Recovery Manager complete.
    As the above log shown, I cannot do any backup command in the RUN bracket and it complains that the character set is not recognized.
    This set of error happens when I have create six other Oracle databases in my NT box. Before that, I can manually run the backup with no problem and a backupset has been generated.
    If you have come across this problem and have solutions of it. That will be great.
    Thanks !!
    null

    kk001 wrote:
    Hi ,
    The export Backup failing due to character set problem
    . . exporting table ravidlx
    EXP-00008: ORACLE error 6552 encountered
    ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-553: character set name is not recognized
    P
    Please suggest how to set character set
    I don't know what you have.
    I don't know what you do.
    I don't know what you see.
    It is really, Really, REALLY difficult to fix a problem that can not be seen.
    use COPY & PASTE so we can see what you do & how Oracle responds.
    do as below so we can know complete Oracle version & OS name.
    Post via COPY & PASTE complete results of
    SELECT * from v$version;

  • Using translate function to correct character set problem....

    I have a table(TBL_STOCK) on Oracle XE.
    Rows come from sql server 2005 with a trigger on sql server table via the linked server.
    But there is a character set problem with some character like İ,Ş,Ğ.
    They change to Ý,Þ,Ð. in Oracle.
    How can i correct these ? Do you suggest the TRANSLATE function ?
    What do u think, if i create an After Insert trigger on Oracle table(TBL_STOCK) and convert these character using the Translate function when they inserted from sql server.
    Anyone have any other ideas that can be more efficient. Any thoughts appreciated.
    Thanks in advance.
    Adam
    PS:The NLS_CHARACTERSET of Oracle is AL32UTF8.

    It is sql server 2005 and Collation is SQL_Latin1_General_CP1_CI_AS

  • How to Import Database user in oracle which have character set AL32UTF8?

    Hello All,
    I want export one database user which have character set in WE8MSWIN1252 and I want to Import that Database user in oracle which have character set AL32UTF8 without changing character set.
    is there any argument in import command??
    thanks

    There's no problem, export and import will take care of character set conversions, the only problem is AL32UTF8 is a variable size character set, if 'ñ' uses 1 byte in WE8MSWIN1252, in AL32UTF8 it will use 2 bytes, so it's recommended to pre-create the tables with "char" instead of "byte": create table xxx ( col1 varchar2(100 char), ... )
    Enrique

  • EXPORT Backup failing due to character set problem

    Hi ,
    The export Backup failing due to character set problem
    . . exporting table ravidlx
    EXP-00008: ORACLE error 6552 encountered
    ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-553: character set name is not recognized
    P
    Please suggest how to set character set
    Regards,
    kk
    Edited by: kk001 on Aug 29, 2011 7:22 PM

    kk001 wrote:
    Hi ,
    The export Backup failing due to character set problem
    . . exporting table ravidlx
    EXP-00008: ORACLE error 6552 encountered
    ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-553: character set name is not recognized
    P
    Please suggest how to set character set
    I don't know what you have.
    I don't know what you do.
    I don't know what you see.
    It is really, Really, REALLY difficult to fix a problem that can not be seen.
    use COPY & PASTE so we can see what you do & how Oracle responds.
    do as below so we can know complete Oracle version & OS name.
    Post via COPY & PASTE complete results of
    SELECT * from v$version;

  • Oracle XE and character set

    Hello all,
    I installed Oracle XE on RHEL 4 Linux and I found out that database character set is AL32UTF8. Does anyone know why oracle choose this character set? Maybe because of NLS_LANG env variable? Is it possible to change it to EE8ISO8859P2? Since database is still empty I can drop it and crate new database.
    Do you think it is possible to set some env variables and do new oracle xe instalation including database with iso charset?
    I want to have EE8ISO8859P2 charset because of doing exp/imp from another oracle iso db to oracle xe and it is much easier to do this without charset conversion.
    Any help will be appreciated.
    regards,
    Miha

    When you download XE, you have a choice - take the 'western european' character set download, or the 'unicode' download.
    No other choices.
    Join us over in the XE forum where people have discussed this and found workarounds. Info about finding that forum at Re: Oracle XE Installation failed

  • Agent control character set problem

    Hi,
    here's my problem :
    i've got the grid that's running on a RHES4 with an agent. On another RHES4, i've got 10g databases that run and another agent.
    The repository database is configured like this :
    nsl_language = AMERICAN
    nls_territory = AMERICA
    character set = AL32UTF8
    all the uploads from the agent on the RHES4 where the grid is installed are ok.
    On the other server, as soon as there's an UTF8 character in a xml file (like " é " ou " ' "), the upload fails and the agent stops.
    in the logs, it s clear it comes from this. I've deleted all the occurences of UTF8 characters in the xml file and restarted the upload and it's ok...
    I've tested different configurations but without success.
    Any clue ?
    Alivetu

    Thanks for the reply,
    NLS LANG is set on the 2 machines with FRENCHFRANCE.WE8ISO8859P15
    I've added the line '<?xml version="1.0" encoding="ISO-8859-1"?>' at the beginning of the xml file that doesn't work and made a 'emctl upload'....it has passed and the agent has stopped arrived to another UTF8 xml file...
    So, it really is a character set problem but where to set it ???
    Alivetu

  • Character Setting Problem ( mysql + tomcat )

    Hi all;
    I am using mysql dbms and tomcat web server(servlet). But in my web page, the characters are shown broken. I set the character set of the mysql database. They are shown well in the dbms console. And also I set the html code with appropriate character set in the meta tags. Do I need to make any extra setting? Perhaps in the tomcat or anywhere else? What is the problem here?

    assumes:
    1. using jsp to display the db data
    2. db encoding is ISO-8859-1
    3. jsp encoding is utf-8
    for the very first line of the jsp file:
    <%@ page pageEncoding="utf-8" %>before displaying the data:
    String str = <data from db>
    str = new String(str.getBytes("ISO-8859-1"), "UTF-8");

  • Character Set problem when using Microsoft Microsoft ODBC for Oracle

    Hi, all
    I am using:
    OS: Windows 7 x64 (client and server)
    DB: Oracle 11g
    ODAC: v. 11.2.0.3.20 32-bit
    Connection string: "Driver={Microsoft ODBC for Oracle};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.221)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=geopoisk)));User Id=uid;Password=pwd;"
    DB NLS_CHARACTERSET: CL8MSWIN1251
    DB NLS_LANGUAGE: AMERICAN
    DB NLS_TERRITORY: AMERICA
    Client NLS_LANG: UKRAINIAN_UKRAINE.CL8MSWIN1251
    When I am trying to access the server through ADO the character set of the values becomes corrupted or wrong. The value should be "Месторождение", but shows "?????????????" instead. When I am trying to connect through Visual Studio 2005 and Oracle client the results of the queries are shown in the right way.

    Thanks for the answer. Can you please show me, how would the connection string would look like if I`ll replace my Microsoft ODBC with Oracle one? Thanks alot.

  • Greek Character Set Problem

    Dear All,
    We are currently working on Oracle 8i to 9i migration and unicode implementation of an application SampleDB. We encountered an issue (described below) while the data migration.
    Issue:
    We have a database in oracle8i with
    NLS_LANGUAGE AMERICAN
    NLS_CHARACTERSET WE8ISO8859P1
    NLS_NCHAR_CHARACTERSET WE8ISO8859P1
    The character set WE8ISO8859P1 does not support GREEK language. The user inserts/modifies records in this database from the front-end. The front end installed in the client machine has the following setting:
    Control Panel->Regional settings ->Advanced ->Language for non-unicode programs = Greek
    Oracle client installed in English
    Greek characters have been inserted/ updated into this database and retrieved and displayed correctly by the GUI.
    Note: Greek data has been inserted into WE8ISO8859P1 database which does not support Greek characters.
    Hence the actual data that is stored in the database are not Greek. Only while displaying, they are getting converted into Greek characters due to the settings in the client machine.
    Requirement: Migrate the database to Oracle 9i - Unicode.
    While migration, we need to eliminate any data discrepancy and make sure the data in the Unicode database is in Greek.
    Can any one suggest us a method to do the migration to avoid the above mentioned problem?
    Further, can any one tell us a way to verify what characters get stored in the database and help us identify if they are real Greek characters

    The character set WE8ISO8859P1 does not support GREEK language.If you want to support Greek characters (or 'math' symbols), look at the EL8... char sets.
    Control Panel->Regional settings ->Advanced
    ->Language for non-unicode programs = Greek
    Oracle client installed in EnglishThis is dependent on the app and Windows. What is the NLS_LANG value in this Oracle home? NLS_LANG should be adjusted to fit the application.
    Note: Greek data has been inserted into WE8ISO8859P1
    database which does not support Greek characters.
    Hence the actual data that is stored in the database
    are not Greek. Only while displaying, they are
    getting converted into Greek characters due to the
    settings in the client machine.Maybe character data does not get converted, but still shown as greek.
    Further, can any one tell us a way to verify what
    characters get stored in the database and help us
    identify if they are real Greek charactersIn the case of character data, what you really store depends on the db and the character values. You can use dump or some other PL function to look at the values.
    There's a Database Globalization Support Guide for 9.2 that might be useful.

  • Foreign character set problem

    Hi Sergiusz, it looks like you are a character set guru. Maybe you would know how to solve my problem? I've got a working application under oracle xe, apache and embedded listener. I would like to switch to a new APEX listener with tomcat but there is a problem with a foreign character set. Existing pages with such characters are displayed correctly but if I type them in into an input filed they are not showing up correctly on the next page. This is done without even saving information in a database. I type in text in one field which is a source of an item on another page. These are character settings in my database.
    SQL> select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET';
    VALUE
    AL32UTF8
    SQL> select value from nls_database_parameters where parameter = 'NLS_NCHAR_CHARACTERSET';
    VALUE
    AL16UTF16
    Thanks,
    Art

    Hi Sergiusz, thank you for your help. After setting a URIEncoding to UTF-8 and some further research I was able to fix my problem. Here is the entire solution in case someone else needs it.
    1.) Change $CATALINA_HOME/conf/server.xml and add
    URIEncoding=UTF-8
    <Connector port="8090" protocol="HTTP/1.1"
    connectionTimeout="20000"
    redirectPort="8443" URIEncoding="UTF-8"/>
    2.) Copy $CATALINA_HOME/webapps/examples/WEB-INF/classes/filters/SetCharacterEncoding.class => $CATALINA_HOME/webapps/apex/WEB-INF/classes/filters
    3.) Add the following into $CATALINA_HOME/webapps/apex/WEB-INF/web.xml file after the last </servlet-mapping> tag.
    <filter>
    <filter-name>Set Character Encoding</filter-name>
    <filter-class>filters.SetCharacterEncodingFilter</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF8</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    Thanks,
    Art

Maybe you are looking for

  • Embedded fonts in PDF

    Hello we need to embed our own font "Frutiger" in our AdobeForms. I installed fonts (TTF) in the Adobe Directory already and edited XFA.XCI File already but Fonts are not embedded. I attached a screenshot of the File and the TTF Font. Any ideas why t

  • Count and range columns based on amount of time

    I'm doing SSRS and I have a table that has two different datetime columns called TranTime and AppTime. What I want to do is take the difference in time between those tables and do some counting based on that difference calculated.  For example, if th

  • Required suggestion on BPEL Flows Logging

    Hi, i am working on a BPEL Project.I need some suggestion on logging part of the BPEL flows.As per the requirement, we have to configure transaction logging and error logging for every partner link call. I found some possible ways of logging: 1. log

  • Rg: How to upload Partner Functions in vendor master

    Hi All, I am doing LSMW batch input for vendor master. Since the client has different address for a single vendor, we use partner functions. So two lsmw are used, one for the different address and the lifnr is system generated. another lsme for the o

  • Can't update the songs in a 7th Gen. iPod nano! Help!

    Okay, I've been having problems with my 7th Gen iPod nano and I'm getting tired of this. A few days ago, I had a virus in my computer (the iPod wasn't hooked up at the time), and I had to restore everything in my computer. I downloaded iTunes again a