SQL*Plus: Release 9.2.0.4.0 - Production on 星期六 11月 1 22:51:59 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
连接到: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production
SQL> select sysdate from dual;
SYSDATE ---------- 01-11月-03
已选择 1 行。
SQL> exit 从Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production中断开
E:\>set NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
E:\>sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Sat Nov 1 22:52:24 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production
Import: Release 8.1.7.1.1 - Production on Fri Nov 7 00:59:22 2003
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connected to: Oracle8i Enterprise Edition Release 8.1.7.1.1 - Production With the Partitioning option JServer Release 8.1.7.1.1 - Production
这时导入,在DMP文件和NLS_LANG之间不需要进行字符集转换。
Export file created by EXPORT:V08.01.07 via conventional path import done in US7ASCII character set and ZHS16GBK NCHAR character set import server uses ZHS16GBK character set (possible charset conversion) export server uses UTF8 NCHAR character set (possible ncharset conversion) . . importing table "TEST" 2 rows imported Import terminated successfully without warnings.
5.对于多Byte字符集的导入(如:UTF8) 需要设置导入Session字符集和导出字符集相同 否则就会遇到:IMP-16 "Required character set conversion (type %lu to %lu) not supported" 错误。 : E:\nls2>set NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
6.导入Session字符集应该是导出字符集的超级,否则,专有的字符将难以正确转换。 7.当数据转换为导入Session字符集设置以后,如果导入Session字符集不同于导入数据库字符集,这时还需要最后一步转换,这要求导入数据库字符 集是导入session字符集的超级,否则某些专有字符将不能正常转换。 我们继续看上面的两个过程,这里有这样两个原则: 1.如果NLS_LANG的设置和数据库相同,那么数据(在传输过程中当然是2进制码)不经过转换就直接插入数据库中。 2.如果NLS_LANG的设置和数据库不同,那么数据需要转换后才能插入数据库中。 我们再回头来看上面的第一个例子: : Export file created by EXPORT:V08.01.07 via conventional path import done in US7ASCII character set and ZHS16GBK NCHAR character set import server uses ZHS16GBK character set (possible charset conversion) export server uses UTF8 NCHAR character set (possible ncharset conversion) . . importing table "TEST" 2 rows imported Import terminated successfully without warnings.