相信大家都对字符集有相当的了解了,废话就不多说了!直接步入正题:这里主要是测试含有 汉字的数据从ZHS16GBK的数据库导入到字符集为AL32UTF8
数据库. 如有我没想到的其他情况,请大家提建议,我继续完善测试实验。
测试环境:
目标库:英杰的rac测试库 由
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
sys@rac1>select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------
AMERICAN_AMERICA.AL32UTF8
yang@rac1>select * from nls_database_parameters;
PARAMETER VALUE
------------------------- ----------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET AL32UTF8
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.2.0.1.0
20 rows selected.
源库:
Release 11.1.0.6.0 - Production on Friday, 11 March, 2011 21:11:49
Conneted to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
源库的nls_ 信息:
sys@ORACL> select * from nls_database_parameters;
PARAMETER VALUE
------------------------- --------------------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET ZHS16GBK
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.1.0.6.0
测试步骤:这里主要是测试含有 汉字的数据从ZHS16GBK 导入到 AL32UTF8 .
在源库创建含有汉字的表:
yang@ORACL> create table chart ( val varchar2(20));
表已创建。
======创建英文字符数据
yang@ORACL> insert into chart
2 select dbms_random.string('l',15)
3 from dual
4 connect by level <50;
已创建49行。
======创建中文汉字数据
yang@ORACL> insert into chart
2 select '阿里云' as val from
3 dual connect by level <50;
已创建49行。
yang@ORACL> select * from chart;
VAL
--------------------
阿里云
已选择98行。
yang@ORACL> commit;
提交完成。
yang@ORACL> select dump('阿里云') from dual;
DUMP('阿里云')
-------------------------------------
Typ=96 Len=6: 176,162,192,239,212,198 ===三个 汉字 占用6个字节
===================导出操作===========
数据库. 如有我没想到的其他情况,请大家提建议,我继续完善测试实验。
测试环境:
目标库:英杰的rac测试库 由
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
sys@rac1>select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------
AMERICAN_AMERICA.AL32UTF8
yang@rac1>select * from nls_database_parameters;
PARAMETER VALUE
------------------------- ----------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET AL32UTF8
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.2.0.1.0
20 rows selected.
源库:
Release 11.1.0.6.0 - Production on Friday, 11 March, 2011 21:11:49
Conneted to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
源库的nls_ 信息:
sys@ORACL> select * from nls_database_parameters;
PARAMETER VALUE
------------------------- --------------------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET ZHS16GBK
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.1.0.6.0
测试步骤:这里主要是测试含有 汉字的数据从ZHS16GBK 导入到 AL32UTF8 .
在源库创建含有汉字的表:
yang@ORACL> create table chart ( val varchar2(20));
表已创建。
======创建英文字符数据
yang@ORACL> insert into chart
2 select dbms_random.string('l',15)
3 from dual
4 connect by level <50;
已创建49行。
======创建中文汉字数据
yang@ORACL> insert into chart
2 select '阿里云' as val from
3 dual connect by level <50;
已创建49行。
yang@ORACL> select * from chart;
VAL
--------------------
阿里云
已选择98行。
yang@ORACL> commit;
提交完成。
yang@ORACL> select dump('阿里云') from dual;
DUMP('阿里云')
-------------------------------------
Typ=96 Len=6: 176,162,192,239,212,198 ===三个 汉字 占用6个字节
===================导出操作===========