【问题标题】:Oracle export import issueOracle 导出导入问题
【发布时间】:2014-05-22 07:38:30
【问题描述】:

我想在具有不同字符集的数据库之间的数据导出/导入方面向您寻求帮助。我们从中导出的数据库是:

WE8ISO8859P1 / NCHAR AL16UTF16

要导入的数据库是:

UTF8 / UTF8

我尝试使用不同的 NLS_LANG 设置但没有成功(见下文)。在仅导入 cmets 时我没有收到任何错误,例如:

imp test/test@test file=mig_test.expdat log=imp.log

Import: Release 10.2.0.1.0 - Production on Thu May 22 08:54:36 2014

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


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

Export file created by EXPORT:V10.02.01 via conventional path
import done in WE8ISO8859P1 character set and UTF8 NCHAR character set
import server uses UTF8 character set (possible charset conversion)
export client uses UTF8 character set (possible charset conversion)
export server uses AL16UTF16 NCHAR character set (possible ncharset conversion)

没有导入任何内容。感谢您的评论。

【问题讨论】:

  • “没有导入任何内容”这一事实与字符集转换无关。并且 UTF8 是一个你应该避免的 oracle 字符集,它没有正确实现 UTF8 Unicode 集。

标签: oracle import oracle11g export


【解决方案1】:

第 1 步:导出

将 NLS_LANG 设置为 AMERICAN_AMERICA.WE8ISO8859P1 导出。 这将创建一个包含 WE8ISO8859P1 数据的导出文件。

第 2 步:导入

导入时将 NLS_LANG 设置为 AMERICAN_AMERICA.WE8MSWIN1252 数据库插入WE8MSWIN1252码,在将数据插入UTF8数据库的同时转换为UTF8。

导入时将 NLS_LANG 设置为 AMERICAN_AMERICA.UTF8 通过导入工具转换为UTF8,并在数据库中插入UTF8编码

有点跑题了 1

您使用的是旧的导入和导出工具。你真的应该使用数据泵(impdp,expdp)。与旧的导入/导出工具相比,它是一种更新、更快、更灵活的替代方案。 http://www.oracle-base.com/articles/10g/oracle-data-pump-10g.php

有点跑题2

请勿使用名为 UTF8 的字符集作为数据库字符集,除非需要与 8.1.7 及更早版本中的 Oracle 数据库客户端和服务器兼容,或者除非您的应用程序供应商明确要求。尽管名称非常相似,但 UTF8 并不是 Unicode 编码 UTF-8 的正确实现。如果在需要 UTF-8 处理的地方使用 UTF8 字符集,则可能会出现数据丢失和安全问题。对于 Web 相关数据尤其如此,例如 XML 和 URL 地址。

Oracle 推荐使用 AL32UTF8 作为数据库字符集。 AL32UTF8 是 Oracle 对 Unicode 标准的 UTF-8 编码的名称。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-04-14
    • 1970-01-01
    • 2012-05-18
    • 2012-05-24
    • 1970-01-01
    • 2011-05-08
    • 1970-01-01
    • 2018-07-06
    相关资源
    最近更新 更多