expdp时出错:ORA-39070: Unable to open the log file.

[复制链接]
查看11 | 回复9 | 2005-12-23 16:28:18 | 显示全部楼层 |阅读模式
为什么会出这个错?
$ cat test.sh
date
expdp test/test@tstdb dumpfile=test_onetable.dmp directory=dumpdir tables=table1 logfile=n job_name=exptab parallel=4
date
$
$ . /home/oracle/test.sh
Fri Nov 10 11:20:35 EAT 2006
Export: Release 10.2.0.1.0 - 64bit Production on Friday, 10 November, 2006 11:20:35
Copyright (c) 2003, 2005, Oracle.All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining 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 475
ORA-29283: invalid file operation

Fri Nov 10 11:20:43 EAT 2006
回复

使用道具 举报

千问 | 2005-12-23 16:28:18 | 显示全部楼层
你的语法好像有问题,我在网上google了一下,希望能帮到你
LOGFILE
指定导出日志文件文件的名称,默认名称为export.log
回复

使用道具 举报

千问 | 2005-12-23 16:28:18 | 显示全部楼层
最初由 zhpsam 发布
[B]为什么会出这个错?
$ cat test.sh
date
expdp test/test@tstdb dumpfile=test_onetable.dmp directory=dumpdir tables=table1 logfile=n job_name=exptab parallel=4
date
$
$ . /home/oracle/test.sh
Fri Nov 10 11:20:35 EAT 2006
Export: Release 10.2.0.1.0 - 64bit Production on Friday, 10 November, 2006 11:20:35
Copyright (c) 2003, 2005, Oracle.All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining 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 475
ORA-29283: invalid file operation

Fri Nov 10 11:20:43 EAT 2006 [/B]

把logfile dumpfile路径写全。
去掉directory。
回复

使用道具 举报

千问 | 2005-12-23 16:28:18 | 显示全部楼层
呵呵,原因找到了:
QL> create or replace directory DUMPDIR
2as '/home/oracle/testdump/';
Directory created.
SQL> host ls /home/oracle/testdump
/home/oracle/testdump not found
回复

使用道具 举报

千问 | 2005-12-23 16:28:18 | 显示全部楼层
创建DIRECTORY时,oracle并不检查操作系统目录是否已经存在!
回复

使用道具 举报

千问 | 2005-12-23 16:28:18 | 显示全部楼层
就expdp,没必要整个directory。
写出绝对路径应该也不会太麻烦吧。
回复

使用道具 举报

千问 | 2005-12-23 16:28:18 | 显示全部楼层
执行EXPDP操作时出现ORA-29283: invalid file operation错误
SQL> create or replace directory DUMPDIR
2as '/home/oracle/testdump/';
Directory created.
$ cat test.sh
date
expdp test/test@tstdb dumpfile=test_onetable.dmp directory=dumpdir tables=table1 logfile=n job_name=exptab parallel=4
date
$
$ . /home/oracle/test.sh
Fri Nov 10 11:20:35 EAT 2006
Export: Release 10.2.0.1.0 - 64bit Production on Friday, 10 November, 2006 11:20:35
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining 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 475
ORA-29283: invalid file operation

Fri Nov 10 11:20:43 EAT 2006

在网上搜了半天,还在itpub上发了贴,半天都没有找到解决办法,只好决定自己再次
详细检查一下,结果发现是如下原因所致:
SQL> create or replace directory DUMPDIR
2as '/home/oracle/testdump/';
Directory created.
SQL> host ls /home/oracle/testdump
/home/oracle/testdump not found

创建文件夹/home/oracle/testdump 后,如上test.sh可以正确运行:
$ mkdir testdump
$ . /home/oracle/test.sh
Fri Nov 10 15:06:47 EAT 2006
Export: Release 10.2.0.1.0 - 64bit Production on Friday, 10 November, 2006 15:06:47
Copyright (c) 2003, 2005, Oracle.All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "test"."EXPTAB":test/********@iomtstdb dumpfile=ittest_onetable.dmp directory=dumpdir tables=product_attr_i_p_l logfile=test.log job_name=exptab parallel=4
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 80 MB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/COMMENT
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "test"."PRODUCT_ATTR_I_P_L"
66.67 MB 1937788 rows
Master table "test"."EXPTAB" successfully loaded/unloaded
******************************************************************************
Dump file set for test.EXPTAB is:
/home/oracle/testdump/ittest_onetable.dmp
Job "test"."EXPTAB" successfully completed at 15:07:19
Fri Nov 10 15:07:22 EAT 2006
$
删除文件夹/home/oracle/testdump 后,运行test.sh错误重现:

$ rmdir testdump
$ ls testdump
testdump not found
$ . /home/oracle/test.sh
Fri Nov 10 14:59:00 EAT 2006
Export: Release 10.2.0.1.0 - 64bit Production on Friday, 10 November, 2006 14:59:00
Copyright (c) 2003, 2005, Oracle.All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining 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 475
ORA-29283: invalid file operation
可见,在sqlplus中创建DIRECTORY时,oracle并不检查引用的操作系统文件夹是否已经
存在,应该仔细检查。
回复

使用道具 举报

千问 | 2005-12-23 16:28:18 | 显示全部楼层
最初由 zhpsam 发布
[B]执行EXPDP操作时出现ORA-29283: invalid file operation错误
SQL> create or replace directory DUMPDIR
2as '/home/oracle/testdump/';
Directory created.
$ cat test.sh
date
expdp test/test@tstdb dumpfile=test_onetable.dmp directory=dumpdir tables=table1 logfile=n job_name=exptab parallel=4
date
$
$ . /home/oracle/test.sh
Fri Nov 10 11:20:35 EAT 2006
Export: Release 10.2.0.1.0 - 64bit Production on Friday, 10 November, 2006 11:20:35
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining 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 475
ORA-29283: invalid file operation

Fri Nov 10 11:20:43 EAT 2006

在网上搜了半天,还在itpub上发了贴,半天都没有找到解决办法,只好决定自己再次
详细检查一下,结果发现是如下原因所致:
SQL> create or replace directory DUMPDIR
2as '/home/oracle/testdump/';
Directory created.
SQL> host ls /home/oracle/testdump
/home/oracle/testdump not found

创建文件夹/home/oracle/testdump 后,如上test.sh可以正确运行:
$ mkdir testdump
$ . /home/oracle/test.sh
Fri Nov 10 15:06:47 EAT 2006
Export: Release 10.2.0.1.0 - 64bit Production on Friday, 10 November, 2006 15:06:47
Copyright (c) 2003, 2005, Oracle.All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "test"."EXPTAB":test/********@iomtstdb dumpfile=ittest_onetable.dmp directory=dumpdir tables=product_attr_i_p_l logfile=test.log job_name=exptab parallel=4
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 80 MB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/COMMENT
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "test"."PRODUCT_ATTR_I_P_L"
66.67 MB 1937788 rows
Master table "test"."EXPTAB" successfully loaded/unloaded
******************************************************************************
Dump file set for test.EXPTAB is:
/home/oracle/testdump/ittest_onetable.dmp
Job "test"."EXPTAB" successfully completed at 15:07:19
Fri Nov 10 15:07:22 EAT 2006
$
删除文件夹/home/oracle/testdump 后,运行test.sh错误重现:

$ rmdir testdump
$ ls testdump
testdump not found
$ . /home/oracle/test.sh
Fri Nov 10 14:59:00 EAT 2006
Export: Release 10.2.0.1.0 - 64bit Production on Friday, 10 November, 2006 14:59:00
Copyright (c) 2003, 2005, Oracle.All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining 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 475
ORA-29283: invalid file operation
可见,在sqlplus中创建DIRECTORY时,oracle并不检查引用的操作系统文件夹是否已经
存在,应该仔细检查。 [/B]

可以理解为那只是在sqlplus里创建一个变量,并为它赋值而已.至于那个值是否合理,它不会帮你去检查.
回复

使用道具 举报

千问 | 2005-12-23 16:28:18 | 显示全部楼层
我也遇到同样的问题,用此方法已经解决了。谢谢!
回复

使用道具 举报

千问 | 2005-12-23 16:28:18 | 显示全部楼层
给力啊果然是
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行