Vietnamese characters are garbled after import

时间:2016-08-31 12:06:03

标签: oracle sqlplus

I exported a table in Oracle (which has Vietnamese text) from Dataserver A:

export NLS_LANG=AMERICAN_AMERICA.VN8VN3
exp system/123 BUFFER=64000 FILE=/tmp/export.dmp TABLES=(USERS.AREA) GRANTS=N INDEXES=NO ROWS=Y

And then, I try to import export.dmp to Dataserver B:

export NLS_LANG=AMERICAN_AMERICA.VN8VN3
imp system/123 BUFFER=64000 FILE=/tmp/export.dmp indexes=n grants=n constraints=n statistics=none ignore=y full=y

But, the field ID_ISSUE_PLACE was garbled.

enter image description here

And this is the screenshot which I operated in B. I used the same command to export two tables on A, but after I executed imp command on B,the result is like this! The field COMMENTS in table1 is correct, but the filed NAME in table2 is incorrect.

How to solve this problem? Screenshot.jpg

1 个答案:

答案 0 :(得分:0)

Assuming you are on Windows, and you are using SQL*Plus - it may be as simple as using the proper character set in the COMMAND window. In my case, I have the command $chcp 1252 in my glogin.sql, but from within the session you can do the same with host chcp 1252. This changes the "codepage" (character mapping) to 1252, Microsoft's name for the character set it uses for graphical programs.

For Vietnamese, perhaps the right codepage is not 1252. Take a look at http://www.oracle.com/technetwork/products/globalization/nls-lang-099431.html (and bookmark it for future reference); if I am reading it right, the correct codepage for Vietnamese is 1258.

So: Type host chcp 1258 at the SQL*Plus console and see if it helps. If it does, add $chcp 1258 to your glogin.sql.