确定现有 Oracle 数据库转储文件的 NLS_LANG 设置

发布于 2024-10-04 14:23:31 字数 417 浏览 11 评论 0原文

另一支团队向我们提供了一份转储文件,该团队在今年剩下的时间里都离开了。当我们尝试将转储导入到我们自己的数据库中时,我们收到以下错误:

IMP-00038: Could not convert to environment character set's handle

经过一些研究,我们推测源计算机和本地计算机的 NLS_LANG 设置不匹配。我们目前没有任何方法来检查源计算机上 NLS_LANG 的值是什么。

那么,我们手里只有一个转储文件,有没有办法找出导出时使用的 NLS_LANG 值呢?从表面上看,我们应该能够在运行导入客户端(imp)之前覆盖 NLS_LANG 环境变量。

另一件事是,转储是从 11g 实例完成的,而我们的 imp 版本是 10。我读到 imp 不向前兼容。这可能是这里的问题(而不是 NLS_LANG 不匹配)吗?

We were handed a dump file by another team who are gone away for the rest of the year. When we try to import the dump into our own database, we get the following error:

IMP-00038: Could not convert to environment character set's handle

Upon some research, our speculation is that we have a mismatch between the NLS_LANG setting of the source machine and our local machine. We currently don't have any means to check what the value of NLS_LANG is on the source machine.

So, having just a dump file in our hands, is there a way to figure out the NLS_LANG value with which the export was done? From the looks of it, we should be able to override the NLS_LANG environment variable before running the import client (imp).

Another thing is, the dump was done from an 11g instance and our imp version is 10. I read that imp is not forward compatible. Could this be the issue here (instead of the NLS_LANG mismatch)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

染柒℉ 2024-10-11 14:23:31

Ates,尝试 impdp - 有时这会有所帮助:-)

Ates, try impdp - sometimes that could help :-)

江湖正好 2024-10-11 14:23:31

unix 上最简单的方法是:

#>imp username/password file=test.dmp show=y

Import: Release 10.2.0.3.0 - Production on Fri Nov 26 08:38:47 2010

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


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

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

版本 exp/imp 是一个问题:
我通常使用V10导出程序并使其连接到V11数据库。
确保 dev10 的 oracle_home 中的 tnsnames.ora 中有 dev11 的别名。

hostname{oracle}# . oraenv
ORACLE_SID = [oracle] ? dev10
hostname{oracle}#
hostname{oracle}#>exp username/password@dev11 full=y dumpfile=dump.exp

easiest way on unix is:

#>imp username/password file=test.dmp show=y

Import: Release 10.2.0.3.0 - Production on Fri Nov 26 08:38:47 2010

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


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

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

Version exp/imp is a problem:
I usually use the V10 export program and make it connect to the V11 database.
Make sure you have a alias for dev11 in your tnsnames.ora in dev10's oracle_home.

hostname{oracle}# . oraenv
ORACLE_SID = [oracle] ? dev10
hostname{oracle}#
hostname{oracle}#>exp username/password@dev11 full=y dumpfile=dump.exp
要走干脆点 2024-10-11 14:23:31

尽管该文件是二进制乱码,但仍有一些人类可读的文本摘录。我在那里看到了以下字符串,我认为这回答了我的问题:

<CHARSET>AL32UTF8</CHARSET><NCHARSET>AL16UTF16</NCHARSET>
...
NLS_LANGUAGE='AMERICAN' NLS_TERRITORY='AMERICA'

Even though the file is a binary garble, there are some human-readable text excerpts. I saw the following strings in there, and I think this answers my question:

<CHARSET>AL32UTF8</CHARSET><NCHARSET>AL16UTF16</NCHARSET>
...
NLS_LANGUAGE='AMERICAN' NLS_TERRITORY='AMERICA'
烟若柳尘 2024-10-11 14:23:31

另一件事是,转储已完成
来自 11g 实例和我们的 imp
版本是 10。我读到 imp 不是
向前兼容。这可能是
问题在这里(而不是NLS_LANG
不匹配)?

A:你是对的;您无法导入使用给定 Oracle 客户端创建的转储文件,因为目标 Oracle 数据库的 Oracle 客户端较旧。

虽然不建议,但您可以使用较旧 Oracle 客户端(即 10g)导出较新源 Oracle 数据库(即 10g+),因为您正在使用相同的 Oracle 客户端版本导入目标 Oracle 数据库(即 10g)。

假设:源数据库的 Oracle 客户端版本与目标 Oracle 数据库版本相同或更高。请注意,混合工具Datapump (11g) 和imp (-10g) 导入实用程序不起作用。

有趣的链接使用不同的发行版和版本导出

Another thing is, the dump was done
from an 11g instance and our imp
version is 10. I read that imp is not
forward compatible. Could this be the
issue here (instead of the NLS_LANG
mismatch)?

A: You 're right; You cannot import a dump file created with a given Oracle Client, since the Oracle Client of your Target Oracle Database is older.

Although it is not recommended, you can export a newer Source Oracle Database (i.e. 10g+) with an older Oracle Client (i.e. 10g), since you are using the same Oracle Client version to import into your older Target oracle Database (i.e. 10g).

Assumption: The Oracle Client version of your Source Database is the same -or newer- as your Target Oracle Database version. Note that mixing tools Datapump (11g) and imp (-10g) import utility does not work.

Interessant link Using Different Releases and Versions of Export

铁轨上的流浪者 2024-10-11 14:23:31

也许它是使用 expdp 导出的......尝试 impdp ....这就是我在搜索谷歌时看到的,并且它确实对我解决了同样的问题。

Maybe it was exported using expdp....try impdp ....that is what I saw when searching google, and truly it worked for me for this same issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文