最近在学习oracle11g的expdp逻辑备份数据库,遇到以下问题:
bash-4.1$ expdp yjj/123456 dumpfile=dir:yjj.dmp logfile=dir:yjj.log
Export: Release 12.1.0.2.0 - Production on Tue Apr 21 09:49:21 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing 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 536
ORA-29283: invalid file operation
在讲解错误原因以及 解决办法之前,先说一下expdp备份需要做的工作:
- 首先创建目录对象
SQL> create or replace directory dir as '/home/yjj/oraclebackup';
Directory created.
- 给目录对象赋予权限
SQL> grant read,write on directory dir to yjj;
Grant succeeded.
- 导出(直接在终端中运行)
bash-4.1$ expdp yjj/123456 dumpfile=dir:yjj.dmp logfile=dir:yjj.log
Export: Release 12.1.0.2.0 - Production on Tue Apr 21 09:51:01 2015
Copyright (c)