oracle 数据泵在 Windows 10 上导入 ORA-39002 和 ORA-39070、ORA-29283 和其他

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/50906667/
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-19 03:31:21  来源:igfitidea点击:

oracle data pump import ORA-39002 with ORA-39070, ORA-29283 and others on Windows 10

oracleoracle12cdatapump

提问by

I am using data pump to perform an import on 4 .dmp files and keep on receiving the set of errors as below:

我正在使用数据泵对 4 个 .dmp 文件执行导入并继续接收如下错误集:

ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation

I am new to oracle and cannot find a helpful solution.

我是 oracle 的新手,找不到有用的解决方案。

I am performing the import as in here, although I'm using oracle 12c.

尽管我使用的是 oracle 12c,但我正在执行此处的导入。

The command I run in the windows command like looks like this:

我在 windows 命令中运行的命令如下所示:

impdp user/pass@db_name directory=DUMP_DIR dimpfile="file_name.dmp" schemas=schema_name content=all parallel=4

DUMP_DIR is created in oracle and appropriate privs were granted.

DUMP_DIR 在 oracle 中创建并授予适当的权限。

I also ran this command with

我也运行了这个命令

... logfile=file_name.log

added at the end but I'm not sure if the log file was created or where it was saved.

添加在最后,但我不确定日志文件是否已创建或保存在何处。

I have found this- it's about exactly the same set of errors but on export and on linux. At the end of the answer there's a sentence 'If we are on a Windows machine, then we need to make sure that both the listener and the database have been started with the exact same username.' Is this useful in case of import? If yes - what does it mean exactly?

我发现了这一点- 它是关于完全相同的一组错误,但在导出和 linux 上。在答案的末尾有一句话“如果我们在 Windows 机器上,那么我们需要确保侦听器和数据库都已使用完全相同的用户名启动。” 这在导入的情况下有用吗?如果是 - 这究竟是什么意思?

回答by kfinity

There's a great short answer here, which is basically "The database isn't able to write to the log file location."

这里有一个很好的简短回答,基本上是“数据库无法写入日志文件位置”。

The link above suggests a simple test to troubleshoot the issue.

上面的链接建议进行一个简单的测试来解决问题。

declare
  f utl_file.file_type;
begin
  f := utl_file.fopen ('DUMP_DIR', 'test.txt', 'w');
  utl_file.put_line(f, 'test');
  utl_file.fclose(f);
end;
/

If this fails, Oracle can't write to that directory at all, probably because of Windows file permissions. Check which Windows user(s) the Oracle services are running as, and change the folder permissions to allow them write access.

如果失败,Oracle 根本无法写入该目录,可能是因为 Windows 文件权限。检查 Oracle 服务以哪些 Windows 用户身份运行,并更改文件夹权限以允许他们进行写访问。

If that worked, it's a problem specific to impdp. You might try changing your command string - one option might be to specifically write your log file to a different Oracle directory, e.g. logfile=DATA_PUMP_DIR:file_name.log.

如果那行得通,那就是impdp特有的问题。您可以尝试更改您的命令字符串 - 一种选择可能是将您的日志文件专门写入不同的 Oracle 目录,例如logfile=DATA_PUMP_DIR:file_name.log.

If none of these options work, you can also disable the logfile completely by using NOLOGFILE=Y, but you'll have to monitor the impdp output on your console, because it won't get saved anywhere else.

如果这些选项都不起作用,您也可以使用 完全禁用日志文件NOLOGFILE=Y,但您必须在控制台上监视 impdp 输出,因为它不会保存在其他任何地方。

回答by Susil Parida

The problem You have is Your Oracle is not able to write to DIRECTORY (DUMP_DIR) you specified. In Windows 10, It behaves unpredictably. Solution

遇到的问题是您的 Oracle 无法写入您指定的 DIRECTORY (DUMP_DIR)。在 Windows 10 中,它的行为不可预测。解决方案

  1. Create another Oracle directory with preferably in C:\Users\Public\ folder, where you are 100% sure access would not be issue. CREATE OR REPLACE DIRECTORY DUMP_DIR_2 AS 'C:\Users\Public\<name>
  2. Give Grants GRANT READ, WRITE ON DIRECTORY DUMP_DIR_2 TO schema_name;

  3. Copy your dump file to newly created folder.

  4. Fire your import command
  1. 创建另一个 Oracle 目录,最好在 C:\Users\Public\ 文件夹中,您 100% 确定访问不会出现问题。 CREATE OR REPLACE DIRECTORY DUMP_DIR_2 AS 'C:\Users\Public\<name>
  2. 给予资助 GRANT READ, WRITE ON DIRECTORY DUMP_DIR_2 TO schema_name;

  3. 将您的转储文件复制到新创建的文件夹中。

  4. 启动您的导入命令