最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

Oracle查看imp导出文件中字符集

来源:动视网 责编:小采 时间:2020-11-09 09:42:57
文档

Oracle查看imp导出文件中字符集

Oracle查看imp导出文件中字符集:我们在exp导入的时候,经常会有警告字符不一致的问题。下面来看看在imp/exp导入导出的时候,nls_lang这个参数到底应该怎么来配置。 Oracle推荐在执行exp的时候nls_lang配置与database nls_character一致,这样不会出现字符转换的问题,能提高exp的效率。
推荐度:
导读Oracle查看imp导出文件中字符集:我们在exp导入的时候,经常会有警告字符不一致的问题。下面来看看在imp/exp导入导出的时候,nls_lang这个参数到底应该怎么来配置。 Oracle推荐在执行exp的时候nls_lang配置与database nls_character一致,这样不会出现字符转换的问题,能提高exp的效率。


我们在exp导入的时候,经常会有警告字符不一致的问题。下面来看看在imp/exp导入导出的时候,nls_lang这个参数到底应该怎么来配置。 Oracle推荐在执行exp的时候nls_lang配置与database nls_character一致,这样不会出现字符转换的问题,能提高exp的效率。查看d

我们在exp导入的时候,经常会有警告字符不一致的问题。下面来看看在imp/exp导入导出的时候,nls_lang这个参数到底应该怎么来配置。

Oracle推荐在执行exp的时候nls_lang配置与database nls_character一致,这样不会出现字符转换的问题,能提高exp的效率。查看database nls_character

SQL> select value from nls_database_parameters where parameter='NLS_CHARACTERSET';

VALUE
------------------------------
ZHS16GBK
我们这里只做查看已经导出的exp文件的字符集。

$ echo $NLS_LANG

$
$ exp userid=scott/Oracle file='/tmp/scott.dmp' log='/tmp/scott.log'

Export: Release 11.2.0.3.0 - Production on Thu Aug 30 13:07:22 2012

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


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SCOTT
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SCOTT
About to export SCOTT's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SCOTT's tables via Conventional Path ...
. . exporting table BONUS 0 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table DEPT 4 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table EMP 14 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table SALGRADE 5 rows exported
EXP-00091: Exporting questionable statistics.
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully with warnings.
从上面提示可以看到database的字符集是ZHS16GBK,而我的client的nls_lang中的client字符集是US7ASCII。

下面是查看已经导出的/tmp/scott.dmp文件的字符集

$ imp userid=scott/Oracle file='/tmp/scott.dmp' show=yes

Import: Release 11.2.0.3.0 - Production on Thu Aug 30 13:07:58 2012

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


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses ZHS16GBK character set (possible charset conversion)
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses ZHS16GBK character set (possible charset conversion)

import done这行表示的client 的字符集是US7ASCII,导入导出端的字符集是相同的。

import server这行表示导入的数据库的字符集是ZHS16GBK,由于字符集不一样,所以会出现字符集的转换。

当exp client与imp client不一样的时候会出现下面的提示:

$ export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
$ echo $NLS_LANG
AMERICAN_AMERICA.ZHS16GBK
$ imp userid=scott/Oracle file='/tmp/scott.dmp' show=yes

Import: Release 11.2.0.3.0 - Production on Thu Aug 30 13:11:53 2012

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


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
export client uses US7ASCII character set (possible charset conversion)
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
export client uses US7ASCII character set (possible charset conversion)

export client这行表示导出client的字符集是US7ASCII。

更详细的见官方文档:NLS considerations in Import/Export - Frequently Asked Questions [ID 227332.1]

文档

Oracle查看imp导出文件中字符集

Oracle查看imp导出文件中字符集:我们在exp导入的时候,经常会有警告字符不一致的问题。下面来看看在imp/exp导入导出的时候,nls_lang这个参数到底应该怎么来配置。 Oracle推荐在执行exp的时候nls_lang配置与database nls_character一致,这样不会出现字符转换的问题,能提高exp的效率。
推荐度:
标签: 文件 查看 导出
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top