删除数据文件

用户在rac环境当中添加数据文件时文件存放位置没有存放到asm磁盘组存放到文件系统上,上去处理时文件已处于offline状态,expdp导出某张表时报ORA-31693,ORA-01110错误导致某张表没有备份出来

查看需要恢复的数据文件

select * from v$recover_file

1 18 OFFLINE OFFLINE 18248608502 2021/12/29 11:31:38

asmcmd  cp /tmp/*.dbf  +DATADG/orcl/datafile/

SQL> recover datafile 18;
ORA-00279: change 18248608502 generated at 12/29/2021 11:31:38 needed for
thread 2
ORA-00289: suggestion : +FRADG
ORA-00280: change 18248608502 for thread 2 is in sequence #25490
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log '+FRADG'
ORA-17503: ksfdopn:2 Failed to open file +FRADG
ORA-15045: ASM file name '+FRADG' is not in reference form
ORA-00308: cannot open archived log '+FRADG'
ORA-17503: ksfdopn:2 Failed to open file +FRADG
ORA-15045: ASM file name '+FRADG' is not in reference form

recover时需要的归档日志不存在

查看归档日志

SQL> select min(sequence#) from v$archived_log a where THREAD#=2;
MIN(SEQUENCE#)
--------------
61073

25490远远比61073小,没有归档日志不能正常恢复数据文件,为导出时不报错从数据字典里删除数据文件

delete file$ where FILE#=18; commit;

重建控制文件

alter database backup controlfile to trace as '/home/oracle/1.ctl';

alter database open resetlogs;

 

posted @ 2023-05-17 15:21  刚好遇见Mysql  阅读(44)  评论(0)    收藏  举报