将客户端设置为不同的字符集,演示导入/导出可能产生的乱码问题。为什么没有出现乱码

查看一下数据的字符集:

SQL> column value format a30

SQL> 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.2.0.1.0

已选择20行。

修改客户到的字符集为:set nls_lang=SIMPLIFIED CHINESE_CHINA.US7ASCII

C:\Users\Administrator>set nls_lang=SIMPLIFIED CHINESE_CHINA.US7ASCII

导出scott用户下的t1表的内容,内容如下:

SQL> select * from t1;

NAME

----------

王强

王三

王五

王扣扣

Exp

C:\Users\Administrator>exp scott/tiger file=d:t1.dmp tables=(t1)

Export: Release 11.2.0.1.0 - Production on ??? 6? 29 16:46:58 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

???: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, Oracle Label Security, OLAP, Data Mining,

Oracle Database Vault and Real Application Testing options

??? US7ASCII ???? AL16UTF16 NCHAR ???

????? ZHS16GBK ??? (????????)

??????????????...

. . ?????                              T1???           4 ?

EXP-00091: ?????????????

??????, ??????

Imp

C:\Users\Administrator>imp test/test file=d:t1.dmp full=y

Import: Release 11.2.0.1.0 - Production on ??? 6? 29 16:47:55 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

???: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, Oracle Label Security, OLAP, Data Mining,

Oracle Database Vault and Real Application Testing options

??????? EXPORT:V11.02.00 ???????

??: ????? SCOTT ??, ???????

???? US7ASCII ???? AL16UTF16 NCHAR ???????

??????? ZHS16GBK ??? (????????)

. ??? SCOTT ?????? TEST

. ??? SCOTT ?????? TEST

. . ?????                            "T1"???           4 ?

IMP-00003: ?? ORACLE ?? 1031

ORA-01031: ????

IMP-00000: ???????

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>sqlplus test/test

SQL*Plus: Release 11.2.0.1.0 Production on 星期六 6月 29 16:53:08 2013

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

连接到:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, Oracle Label Security, OLAP, Data Mining,

Oracle Database Vault and Real Application Testing options

SQL> select * from t1;

NAME

----------

王强

王三

王五

王扣扣


你可能感兴趣的:(客户端)