• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

12cpdbexpdpuseDATA_PUMP_DIRmeetORA-39145

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

 

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

 

原因如下:

 If none of the previous three conditions yields a directory object and you are a privileged user (i.e. uses who have the EXP_FULL_DATABASE role and IMP_FULL_DATABASE role), then Data Pump attempts to use the value of the default server-based directory object, DATA_PUMP_DIR. 
It is important to understand that Data Pump does not create the DATA_PUMP_DIR directory object; it merely attempts to use its value when a privileged user has not provided a directory object using any of the mechanisms previously described. This default directory object must first be created by a DBA. Do not confuse this with the client-based environment variable of the same name.
Example to create all files in the directory DATA_PUMP_DI

 

DATA_PUMP_DIR  目录需要有EXP_FULL_DATABASE role and IMP_FULL_DATABASE  role ,而12c pdb 下的system 用户没有该roll:

 

在cdb 下 system: PRIVILEGE 列为空,

 SET lines 80
 COL grantee FORMAT a20
 COL privilege FORMAT a10
 SELECT directory_name, grantee, privilege,DIRECTORY_PATH
FROM user_tab_privs t, all_directories d
 WHERE t.table_name(+)=d.directory_name
 ORDER BY 1,2,3;


DIRECTORY_NAME
--------------------------------------------------------------------------------
GRANTEE PRIVILEGE
-------------------- ----------
DIRECTORY_PATH
--------------------------------------------------------------------------------
DATAPUMP

/centrproddblog/dump

DATA_PUMP_DIR

/opt/oracle12c/admin/centrprod/dpdump/

 

OPATCH_INST_DIR

/opt/oracle12c/product/12.1/OPatch

OPATCH_LOG_DIR


/opt/oracle12c/product/12.1/QOpatch

OPATCH_SCRIPT_DIR

/opt/oracle12c/product/12.1/QOpatch

 

XSDDIR

/opt/oracle12c/product/12.1/rdbms/xml/schema


8 rows selected.

SQL> SQL>

 

在pdb 下 system: 即便给了读写权限给system, 仍然没有IMP_FULL_DATABASE   rool;

SQL> /

DIRECTORY_NAME
--------------------------------------------------------------------------------
GRANTEE PRIVILEGE
-------------------- ----------
DIRECTORY_PATH
--------------------------------------------------------------------------------

DATA_PUMP_DIR
SYSTEM READ
/opt/oracle12c/admin/centrprod/dpdump/

DATA_PUMP_DIR
SYSTEM WRITE
/opt/oracle12c/admin/centrprod/dpdump/

OPATCH_INST_DIR

/opt/oracle12c/product/12.1/OPatch

OPATCH_LOG_DIR

/opt/oracle12c/product/12.1/QOpatch

OPATCH_SCRIPT_DIR

/opt/oracle12c/product/12.1/QOpatch

 

 

 

解决办法:

1.pdb 下手工创建directory datapump :

create or replace directory datapump as '/centruatdblog/dump';
grant read,write on directory datapump to public;

 

2 使用 datapump  替代 DATA_PUMP_DIR

Solution for user SCOTT: as described in 5.3. user SCOTT can set the environment variable DATA_PUMP_DIR to MY_DIR:

C:\> set DATA_PUMP_DIR=MY_DIR
C:\> expdp scott/tiger@my_db_alias DUMPFILE=expdp_s.dmp LOGFILE=expdp_s.log SCHEMAS=scott

 

refer:

Export/Import DataPump Parameter DIRECTORY - How to Specify a Directory (文档 ID 266875.1)


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C#-datagridview设置列宽发布时间:2022-07-13
下一篇:
C#串口操作类,包括串口读写操作发布时间:2022-07-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap