Unix Technical Forum

Converting database from US7ASCII to UTF8

This is a discussion on Converting database from US7ASCII to UTF8 within the Oracle Database forums, part of the Database Server Software category; --> I am on HP UNIX 11i using Oracle 9.2.0.5. I had a database in database character set US7ASCII. I ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-25-2008, 01:54 AM
dbaplusplus@hotmail.com
 
Posts: n/a
Default Converting database from US7ASCII to UTF8

I am on HP UNIX 11i using Oracle 9.2.0.5.

I had a database in database character set US7ASCII. I recently
converted it to database character set UTF8. Since I do not have any
nchar or nvarchar2 columns, national character set is irrelevant even
though it was UTF8 to begin with.

Export was done using NLS_LANG=AMERICAN_AMERICA.US7ASCII and same
setting was used for import.

During import some rows got rejected because column lengths of some
varchar2 column will not fit UTF8 chacater set. I know UTF8 needs more
bytes if character is outside of ASCII. My question is since I had
US7ASCII database to begin with, why my rows got rejected, since UTF8
is a superset
of US7ASCII.

Looking at failed rows generated during import, I did notice that some
rows had characters such as Ö (O with two .. on top), R with a
trademark on top of it. If my database character set was ASCII, how
this character was inserted in the first place. What is the meaning of
US7ASCII if my database had these characters.
All columns with error are varchar2 columns.

Appreciate your insight.

Thanks a lot.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-25-2008, 01:56 AM
dbaplusplus@hotmail.com
 
Posts: n/a
Default Re: Converting database from US7ASCII to UTF8


dbaplusplus@hotmail.com wrote:
> I am on HP UNIX 11i using Oracle 9.2.0.5.
>
> I had a database in database character set US7ASCII. I recently
> converted it to database character set UTF8. Since I do not have any
> nchar or nvarchar2 columns, national character set is irrelevant even
> though it was UTF8 to begin with.
>
> Export was done using NLS_LANG=AMERICAN_AMERICA.US7ASCII and same
> setting was used for import.
>
> During import some rows got rejected because column lengths of some
> varchar2 column will not fit UTF8 chacater set. I know UTF8 needs more
> bytes if character is outside of ASCII. My question is since I had
> US7ASCII database to begin with, why my rows got rejected, since UTF8
> is a superset
> of US7ASCII.
>
> Looking at failed rows generated during import, I did notice that some
> rows had characters such as Ö (O with two .. on top), R with a
> trademark on top of it. If my database character set was ASCII, how
> this character was inserted in the first place. What is the meaning of
> US7ASCII if my database had these characters.
> All columns with error are varchar2 columns.
>
> Appreciate your insight.
>
> Thanks a lot.



Does any one hae insight in this? Apprecaite your answer.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-25-2008, 01:56 AM
Joel Garry
 
Posts: n/a
Default Re: Converting database from US7ASCII to UTF8

The database can store 8 bit characters, even if you are using a 7 bit
ASCII characterset, if the tool you use to insert the characters allows
it, which most do.

exp/imp "helpfully" handles translations between character sets. So,
if you tell it that it exported a 7 bit set, and is importing into an 8
bit set, it will likely truncate that extra bit.

See
http://groups.google.com/group/comp....e=source&hl=en
and look at the docs about NLS and character set conversion on
metalink, as well as search asktom.oracle.com for "exp imp characterset
conversion" (without the quotes). You basically want to fool oracle
into not doing the conversion.

jg
--
@home.com is bogus.
http://www.signonsandiego.com/uniont...b10zubkis.html

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-25-2008, 01:56 AM
dbaplusplus@hotmail.com
 
Posts: n/a
Default Re: Converting database from US7ASCII to UTF8

Thanks a lot, that must be it.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:00 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com