oracle impdp/expdp 的权限问题
2016-01-08 13:26
1066 查看
直接运行 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/
系统报错:
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/
相关文章推荐
- 基于 Red Hat 的发行版 Oracle Linux 正式发布Oracle Linux 7.1
- Oracle Containers for J2EE远程安全漏洞(CVE-2014-0413)
- Oracle 10g R2不能使用EM的问题
- 表空间操作
- PreparedStatement中in子句的处理
- VMware下RedHat4.8_64位安装Oracle 10g RAC--简略脚本
- oracle sql日期比较
- 基于 Red Hat 的发行版 Oracle Linux 正式发布Oracle Linux 7.1
- OS block size和Oracle block size,查找OS Blocksize的方法
- oracle中创建数据库和表空间的几点总结
- 数据库自动备份脚本
- Windows7下获得System权限问题解决方法
- 用一整天的时间安装postgreSQL NTFS权限
- oracle的nvl函数的使用介绍
- 解决oracle用户连接失败的解决方法
- oracle的一些tips技巧
- Oracle 下的开发日积月累
- Oracle存储过程之数据库中获取数据实例
- Windows下ORACLE 10g完全卸载的方法分析