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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4279139/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 02:56:04  来源:igfitidea点击:

Determining the NLS_LANG setting for an existing Oracle database dump file

oracleimportdumpnls-lang

提问by Ates Goral

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.

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

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).

那么,我们手中只有一个转储文件,有没有办法找出完成导出的 NLS_LANG 值?从它的外观来看,我们应该能够在运行导入客户端 (imp) 之前覆盖 NLS_LANG 环境变量。

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)?

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

采纳答案by Rob van Laarhoven

easiest way on unix is:

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)

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.

版本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

回答by Stephan

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

Ates,试试impdp - 有时可能会有所帮助:-)

回答by Ates Goral

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'

回答by philippeko

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)?

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

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.

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

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

尽管不建议这样做,但您可以使用旧的Oracle 客户端(即 10g)导出较新的源 Oracle 数据库(即 10g+),因为您使用相同的 Oracle 客户端版本导入到较旧的目标 oracle 数据库(即 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.

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

Interessant link Using Different Releases and Versions of Export

使用不同版本和导出版本的Interessant 链接

回答by Forhad

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.

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