出现问题
[oracle@dbServer ~]$ impdp userbook/userBook@orcl directory=dump_dir dumpfile=book.dmp schemas=userbook 报以下错误: ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-39087: directory name DPDATA1 is invalid
查看问题信息
[oracle@dbServer ~]$ oerr ORA 39087 39087, 00000, "directory name %s is invalid" // *Cause: A corresponding directory object does not exist. // *Action: Correct the directory object parameter, or create a corresponding // directory object with the CREATE DIRECTORY command. [oracle@dbServer ~]$ oerr ORA 39070 39070, 00000, "Unable to open the log file." // *Cause: Errors were detecting while opening the log file. Subsequent // messages will detail the problems. // *Action: Fix the problems outlined in the secondary messages.
下面是问题分析解决的思路:
1.首先,检查directory是否已创建
select * from dba_directories;
结果是directory已经创建,这里没有问题。
2.然后,检查Linux服务器上是否已创建目录:
[oracle@hellooracle ~]$ ll /data/dump/ total 97780 -rw-r----- 1 oracle dba 323584 Nov 1 07:50 DDQNSCHEMA.DMP -rw-r--r-- 1 oracle dba 331776 Jan 17 21:24 book.dmp -rw-r--r-- 1 oracle dba 1839 Nov 1 07:50 export.log -rw-r----- 1 oracle dba 98529280 Oct 18 21:05 full.dmp -rw-r--r-- 1 oracle dba 2248 Jan 17 21:29 import.log -rw-r----- 1 oracle dba 425984 Oct 18 20:45 tablespacewt.dmp -rw-r----- 1 oracle dba 348160 Oct 18 19:02 wtschema.dmp -rw-r----- 1 oracle dba 159744 Oct 18 19:12 wttab.dmp
显然,目录已经创建。
3.检查是否未赋予directory的读写权限,
SELECT * FROM all_tab_privs WHERE table_name ='DUMP_DIR';
执行赋权限语句:
grant read,write on directory dump_dir to public;
再次执行导入语句进行验证:
[oracle@dbServer ~]$ impdp userbook/userBook@orcl directory=dump_dir dumpfile=book.dmp schemas=userbook
问题顺利解决,数据成功导入。
参考:http://blog.itpub.net/31394774/viewspace-2216742/