zoukankan      html  css  js  c++  java
  • oracle impdp/expdp 的权限问题

    直接运行 impdp base/reliance-123 network_link=dblink_dev schemas=base remap_schema=base:base
    系统报错:
    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,绝对是见很正确的事。

  • 相关阅读:
    iOS tableViewCell自适应高度 第三发类库
    iOS 用 SDWebImage 清理图片缓存
    iOS JsonModel 的使用
    Objective-C语法之KVO使用
    iOS开发之 用第三方类库实现轮播图
    OS开发UI篇—使用UItableview完成一个简单的QQ好友列表
    iOS tableView 静态单元格的实现
    iOS沙盒目录结构解析
    ios开发UI篇—使用纯代码自定义UItableviewcell实现一个简单的微博界面布局
    AFNetworking 3.0.4 的使用
  • 原文地址:https://www.cnblogs.com/maple42/p/3941558.html
Copyright © 2011-2022 走看看