导入 Oracle 备份时出错

Errors on importing Oracle backup

我创建了一个目录:

SQL> create or replace directory dir as '/home/oracle12c/Desktop/latest_exp.dmp'; 我正在尝试 运行 导入,作为 sysdba:

impdp \'/as sysdba\' full=Y directory=dir dumpfile=importDump.dmp logfile=import.log;

我收到这些错误:

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics, and Real Application Testing options
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

据我的搜索结果来看,这与权限有关。 Oracle 用户应该拥有这些文件。 我尝试导入的文件的权限如下所示:

-rw-r--r-- 1 oracle12c root 2201247744 Feb 21 16:51 latest_exp.dmp

我的问题是什么,我该如何克服?文件的属主是oracle12时有问题吗?互联网上的一些解决方案说文件必须由尝试访问文件的用户所有,在我的例子中是 sysdba。但是我无法将我的文件的所有者更改为 sysdba,因为我的 Ubuntu.

上不存在该用户

此外,我们指定了 dumfile 和 logfile,但没有指定位置。它将在哪里创建这些位置?我假设它会在这里寻找它们:/u01/app/oracle/oradata/orcl$ 其中 orcl 是我的 SID

在 Google 和 Oracle Doc 的帮助下,我无法解决我的问题。

我 运行 宁 Ubuntu。

Oracle 目录对象应指向操作系统目录,而不是文件;而不是:

create or replace directory dir as '/home/oracle12c/Desktop/latest_exp.dmp'

应该是:

create or replace directory dir as '/home/oracle12c/Desktop'

转储文件应位于该目录中,默认情况下,日志和错误文件也会在那里创建。

目前您要求它在目录 /home/oracle12c/Desktop/latest_exp.dmp 下创建日志文件,即 /home/oracle12c/Desktop/latest_exp.dmp/import.log - 这显然不是有效的完整路径;并在该非目录下查找文件 importDump.dmp

你的命令行看起来好像有错误的名字:

impdp ... directory=dir dumpfile=latest_exp.dmp logfile=import.log