【Oracle】逻辑备份失败ORA-39002,39070,29283,06512

查看备份邮件的时候,发现逻辑导出失败,日志如下:

20111126-122901 admin:oracle@RAC1:

/home/oracle> cat /tmp/exp_dwd.sh.CRONTAB.LAST.log | more

****************************************************************

***You  login as oracle , Please ask somebody to  double check!***

****************************************************************

Export: Release 11.1.0.7.0 - 64bit Production on Wednesday, 23 November, 2011 20:45:02

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

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

cat: exp_dwd__EXP.backup.sh.out: No such file or directory

20111126-123031 admin:oracle@RAC1:

/home/oracle> cat /tmp/exp_dwdss.sh.CRONTAB.LAST.log | more

****************************************************************

***You  login as oracle , Please ask somebody to  double check!***

****************************************************************

Export: Release 11.1.0.7.0 - 64bit Production on Wednesday, 23 November, 2011 20:45:02

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

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

cat: exp_dwdss_dwd__EXP.backup.sh.out: No such file or directory

expdp 导出备份都出现一样的错误:ORA-39070: Unable to open the log file.显示打不开directory,怀疑和此directory指定的路径有关:

根据脚本查看备份directory路径:

expdp system/pwd  SCHEMAS=dwdss  filesize=8000m directory=mydp1   logfile=${EXPDP_LOG} parallel=8 .....

查看路径权限信息:

ops$admin@RAC1>SELECT directory_name, grantee, privilege

  2  FROM user_tab_privs t, all_directories d  

  3  WHERE t.table_name(+)=d.directory_name  

  4  ORDER BY 1,2,3;

DIRECTORY_NAME                 GRANTEE              PRIVILEGE

------------------------------ -------------------- ----------

BACKUP_DW

DIR_FOR_EXP_DW

DIR_FOR_EXP_DW_INS2

MYDP1               <-------没有相关权限信息

ops$admin@RAC1>exit

查看DIRECTORY_NAME, DIRECTORY_PATH

ops$admin@RAC1>select * from dba_directories;

OWNER           DIRECTORY_NAME            DIRECTORY_PATH

--------------- ------------------------- ------------------------------------------------------------

SYS             ORACLE_OCM_CONFIG_DIR     /opt/oracle/products/11.1.0/db_1/ccr/state

SYS             DATA_PUMP_DIR             /opt/oracle/products/11.1.0/db_1/rdbms/log/

SYS             DIR_FOR_EXP_DW_INS2       /home/oracle/products/11.1.0/dir_for_exp_dw_ins2

SYS             DIR_FOR_EXP_DW            /home/oracle/products/11.1.0/dir_for_exp_dw

SYS             MYDP1                     /netapp/asoftdw/backup <---- 

SYS             BACKUP_DW                 /netapp/dwnew/backup

SYS             EXPDP_TMP                 /home/oracle/expdp_tmp

SYS             BACKUP_DW_NEW             /netapp/dwnew/backup_newdw

8 rows selected.

ops$admin@RAC1>

ops$admin@RAC1>exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

admin@RAC1:/netapp/dwnew/backup>cd /netapp/asoftdw/backup

-bash: cd: /netapp/asoftdw/backup: 没有那个文件或目录

由于没有/netapp/asoftdw/backup 这个目录导致逻辑备份失败。

解决方法:

增加/netapp/asoftdw/backup 路径,或者建立新的directory 并修改脚本中关于directory=mydp1 

-------------------------------------------------------------------------

遇到这样错误还有如下情况,都是和directory相关的

1 系统的oracle 用户没有对directory的读写权限,所有oracle的进程包括expdp也不能对directory指定的目录进行读写。

解决方法:

检查directory所指定的目录的权限,并赋予正确的权限

2 对于rac系统,在执行expdp时使用tns连接名:

expdp system/xxxx@db directory=xxxxxxxxxx dumpfile=xxxxxxxx.dmp logfile= xxxxxxx.log schemas=xxxxxx

Export: Release 11.1.0.7.0 - 64bit Production on Tuesday, 08 March, 2011 11:16:2 0

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

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

原因:对于rac 系统TNS name 是一个负责均衡的连接字符串,当指定TNS name连接时,expdp程序可能指向另外一个没有对应目录或者目录不可共享的实例从而导致报错。

解决办法:对于rac 系统不要指定tns 名称

3 directory 对于的系统目录路径不存在,也就是我遇到的情况

遇到此类问题可以执行下面的语句,检查directory的权限和具体os对于路径

SET lines 80

COL grantee FORMAT a20

COL privilege FORMAT a10

SELECT directory_name, grantee, privilege

FROM user_tab_privs t, all_directories d  

WHERE t.table_name(+)=d.directory_name

      and d.directory_name='DIRECTORY_NAME'  

ORDER BY 1,2,3;

set linesize 120

col owner for a15

col DIRECTORY_path for a60

col DIRECTORY_NAME for a25

select * from dba_directories ;

时间: 2024-09-17 03:57:56

【Oracle】逻辑备份失败ORA-39002,39070,29283,06512的相关文章

oracle逻辑备份Export使用技巧

备份一个ORACLE数据库有三种标准方式: EXPORT(导出).脱机备份和联机备份.导出方式是数据库的逻辑备份,其他两种备份方式都是物理文件备份. 逻辑备份 ORACLE的EXPORT实用程序exp用来读取数据库(其中包括数据字典)和把输出写入一个叫作导出转储文件(export dump file)的二进制文件中.可以导出整个数据库.指定用户或指定表.在导出期间,可以选择是否导出与表相关的数据字典信息,如权限.索引和与其相关的约束条件.exp所写的文件包括完全重建全部被选对象所需的命令. 备份

Oracle逻辑备份知识简介

1.逻辑备份和物理备份区别 1)物理备份:备份数据文件以及控制文件,备份整个库的物理结构,主要用于media recover 2)逻辑备份:备份database里的对象的数据结构和数据,作为物理备份的辅助,不能用于media recover : 先主要用于对单个表的备份或数据迁移,但恢复时只能恢复到备份点. 2.exp的使用 (1)emp参数说明 C:\Users\cuug>exp -help Export: Release 10.2.0.1.0 - Production on 星期五 3月 2

ORACLE RMAN备份失败之ORA-19599

    近期的oracle数据库巡检中,一地市oracle数据库的rman备份出现失败如下: 查看数据库rman备份日志,日志提示归档中有坏块: 输入归档日志线程=1 序列=43530 RECID=35316 STAMP=949830743 通道 c4: 正在启动段 1 于 20-7月 -17 RMAN-03009: backup 命令 (c1 通道上, 在 07/20/2017 09:52:28 上) 失败ORA-19599: 块编号 8 已在 archived log E:\BACKUP\A

Oracle逻辑备份的应用案例

案例1: 误删除user及所有的对象,恢复 1)创建用户,并分配权限 06:14:01 SQL> create user scott identified by tiger default tablespace users ; User created. 06:15:55 SQL> grant connect ,resource to scott; Grant succeeded. 06:16:06 SQL> 2)导入备份 [oracle@work dat]$ imp system/or

Oracle逻辑备份的SH文件

完全备份的SH文件:exp_comp.sh rq=` date +"%m%d" ` su - oracle -c "exp system/manager full=y inctype=complete file=/oracle/export/db_comp$rq.dmp" 累计备份的SH文件:exp_cumu.sh rq=` date +"%m%d" ` su - oracle -c "exp system/ manager full=

Oracle数据库逻辑备份的SH文件的教程

正在看的ORACLE教程是:Oracle数据库逻辑备份的SH文件. 完全备份的SH文件:exp_comp.sh rq=` date +"%m%d" ` su - oracle -c "exp system/manager full=y inctype=complete file=/oracle/export/db_comp$rq.dmp" 累计备份的SH文件:exp_cumu.sh rq=` date +"%m%d" ` su - oracle

ORACLE数据库的逻辑备份

ORACLE数据库有两类备份方法.第一类为物理备份,该方法实现数据库的完整恢复,但数据库必须运行在归挡模式下(业务数据库在非归挡模式下运行),且需要极大的外部存储设备,例如磁带库:第二类备份方式为逻辑备份,业务数据库采用此种方式,此方法不需要数据库运行在归挡模式下,不但备份简单,而且可以不需要外部存储设备. 数据库逻辑备份方法 ORACLE数据库的逻辑备份分为三种模式:表备份.用户备份和完全备份. 表模式 备份某个用户模式下指定的对象(表).业务数据库通常采用这种备份方式. 若备份到本地文件,使

Oracle数据库逻辑备份的SH文件_oracle

正在看的ORACLE教程是:Oracle数据库逻辑备份的SH文件.完全备份的SH文件:exp_comp.sh rq=` date +"%m%d" ` su - oracle -c "exp system/manager full=y inctype=complete file=/oracle/export/db_comp$rq.dmp" 累计备份的SH文件:exp_cumu.sh rq=` date +"%m%d" ` su - oracle -

Oracle主备架构下的逻辑备份考虑

今天想到一个问题,如果有一个环境是一主一备架构,根据业务需要做逻辑备份,该怎么规划和考虑.数据库版本为10g,11g 这个问题如果在考虑性能的前提下,我觉得是蛮有意思的一个问题.    首先逻辑备份工具,是在物理备份(Data Guard也算一种)的基础上扩展,需要做逻辑备份,一定是业务场景有Data Guard支持不了的地方.需要做逻辑备份,那么逻辑备份工具就是一个重点,传统的exp工具也可以,在备库上使用真实一个绝佳的选择,如果数据量大,那么显然exp不是一个好的注意,那么放在主库,主库上做