备份数据库的expdp语句_expdp 备份数据库

操作系统层面创建目录

[root@Oracle10g ~]# mkdir -p /home/oracle/db_back/

2. 修改目录的所属用户、所属组

[root@Oracle10g ~]#chown -R oracle:oinstall /home/oracle/db_back/

3. 给目录授予相应的权限

(用户对 该目录应该有  读+写+执行 的权限)

[root@Oracle10g ~]#chmod 700 /home/oracle/db_back/

4. oracle数据库层面创建目录

SQL>create directory ora_back as '/home/oracle/db_back/';

Directory created.

5.授予相应用户的执行权限

SQL> grant all on directory ora_back to system;

Grant succeeded.

6.授予用户 全库导出的权限

SQL> grant EXPORT FULL DATABASE  to system;

Grant succeeded.

7.查看执行 全库导出的脚本

[oracle@Oracle10g scripts]$ cat expdp.sh

#!/bin/bash

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export ORACLE_SID=orcl

expdp system/manager1  directory=ora_back dumpfile=$ORACLE_SID+`date +%Y+%m+%d+%H+%M+%S`.dmp  full=y logfile=$ORACLE_SID+`date +%Y+%m+%d+%H+%M+%S`.log

8. 以下附带 错误操作及 错误分析

错误操作1

[root@Oracle10g ~]# chmod 600 /home/oracle/db_back/

[oracle@Oracle10g scripts]$ sh expdp.sh

Export: Release 10.2.0.1.0 - 64bit Production on Tuesday, 02 December, 2014 16:05:46

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production

With the Partitioning, OLAP and Data Mining 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 475

ORA-29283: invalid file operatio

错误分析:

oracle用户对该目录只有 读+写  的权限

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值