字符集问题的初步探讨
时间:2007-12-23 来源:不详 作者:迈克DB
Connectedto:Oracle8iEnterpriseEditionRelease8.1.7.1.1-Production
WiththePartitioningoption
JServerRelease8.1.7.1.1-Production
IMP-00016:requiredcharactersetconversion(type1to852)notsupported
IMP-00000:Importterminatedunsuccessfully
在从导出文件US7ASCII到导入NLS_LANG设置为ZHS16GBK的过程中,不支持单Byte字符集向多Byte转换,报出以上错误。
6.导入Session字符集应该是导出字符集的超级,否则,专有的字符将难以正确转换。
7.当数据转换为导入Session字符集设置以后,假如导入Session字符集不同于导入数据库字符集,这时还需要最后一步转换,这要求导入数据库字符
集是导入session字符集的超级,否则某些专有字符将不能正常转换。
我们继续看上面的两个过程,这里有这样两个原则:
1.假如NLS_LANG的设置和数据库相同,那么数据(在传输过程中当然是2进制码)不经过转换就直接插入数据库中。
2.假如NLS_LANG的设置和数据库不同,那么数据需要转换后才能插入数据库中。
我们再回头来看上面的第一个例子:
:
ExportfilecreatedbyEXPORT:V08.01.07viaconventionalpath
importdoneinUS7ASCIIcharactersetandZHS16GBKNCHARcharacterset
copyright dedecms
importserverusesZHS16GBKcharacterset(possiblecharsetconversion)
exportserverusesUTF8NCHARcharacterset(possiblencharsetconversion)
..importingtable"TEST"2rowsimported
Importterminatedsuccessfullywithoutwarnings.
这时候经过第一步转换后的数据,US7ASCII到ZHS16GBK丢失首位,原样插入数据库,我们看到这时数据库中存放的就是错误的字符(在后面部分我们做了具体的转换):
E:ls2>sqlpluseygle/eygle
SQL*Plus:Release9.2.0.4.0-ProductiononFriNov700:35:392003
Copyright(c)1982,2002,OracleCorporation.Allrightsreserved.
Connectedto:
Oracle8iEnterpriseEditionRelease8.1.7.1.1-Production
WiththePartitioningoption
JServerRelease8.1.7.1.1-Production
SQL>select*fromtest;
NAME
--------------------
2bJT
test
在Oracle9i中,以上情况略有不同。
![](/images/arc_icon.gif)
文章评论
共有位Admini5网友发表了评论 查看完整内容