导入导出是我们常用的一个数据迁移及转化工具,因其导出文件具有平台无关性,所以在跨平台迁移中,最为常用。
在导出操作时,非常重要的是客户端的字符集设置,也就是客户端的NLS_LANG设置。
NLS_LANG参数由以下部分组成:
NLS_LANG=<Language>_<Territory>.<Clients Characterset>
NLS_LANG各部分含义如下:
LANGUAGE指定:
-Oracle消息使用的语言
-日期中月份和日显示
TERRITORY指定
-货币和数字格式
-地区和计算星期及日期的习惯
CHARACTERSET:
-控制客户端应用程序使用的字符集
通常设置或者等于客户端(如Windows)代码页
或者对于unicode应用设置为UTF8
在Windows上查看当前系统的代码页可以使用chcp命令:
E:\>chcp
活动的代码页: 936
代码页936也就是中文字符集 GBK,在Microsoft的官方站点上,我们可以遭到关于936代码页的具体编码规则,请参考以下链接:
http://www.microsoft.com/globaldev/reference/dbcs/936.htm
我们看一个简单的测试,来了解一下这几个参数的作用:
E:\>set NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
E:\>sqlplus "/ as sysdba"
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"
上一页 下一页






