oracle impdp/expdp 的权限问题


直接运行 expdp scott/tiger
系统报错:
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39145: directory object parameter must be specified and non-null

网上说要把在 data_dump_dir 上的 read,write 的权限赋予scott。按照此说法做后,发现问题依然。
grant dba to scott 权限后,问题解决。

其实问题的核心不在于dba权限,而在于 EXP_FULL_DATABASE / IMP_FULL_DATABASE 角色

oracle的官方文档中早就有了此问题和原因(Oracle® Database Utilities):
The following is an example of using the default DATA_PUMP_DIR directory object available to privileged users. This example assumes that the EXP_FULL_DATABASE and IMP_FULL_DATABASE roles have been granted to the user hr. After the DATA_PUMP_DIR directory object has been created, a privileged user need not use the DIRECTORY parameter. Dump files, log files, and SQL files will be written to the path associated with DATA_PUMP_DIR.

SQL> CREATE DIRECTORY data_pump_dir AS '/usr/dba/dpumpfiles':

> expdp hr/hr DUMPFILE=emp.dmp LOGFILE=emp.log TABLES=hr.employees

The emp.dmp and emp.log files will be written to /usr/dba/dpumpfiles.

If the DATA_PUMP_DIR directory object had not first been created by a DBA, then the following error messages would have been displayed:

ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39087: directory name DATA_PUMP_DIR is invalid

Remember that the default DATA_PUMP_DIR directory object is not available to nonprivileged users. In the following example, user sh is a nonprivileged user. Therefore, because no directory object is specified, error messages are generated and the export is not performed.

> expdp sh/sh DUMPFILE=sales.dmp LOGFILE=sales.log TABLES=sh.sales
 
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39145: directory object parameter must be specified and non-null


Thomas Kyte建议的要从头到尾看 Oracle Concept Guide,绝对是见很正确的事。


原文地址:http://www.douban.com/note/37656300/


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值