联系:手机/微信(+86 17813235971) QQ(107644445)
作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]
有客户联系我们,说win平台下的数据库,在由于空间紧张,在关闭数据库的情况下删除的两个数据文件,导致数据库无法正常访问很多业务表,需要对其进行恢复,查看alert日志发现大概操作,删除文件之后,启动数据库失败
Completed: alter database mount exclusive alter database open Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_dbw0_4060.trc: ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: data file 6: 'D:\DATASPACE\XXXXX.DBF' ORA-27041: unable to open file OSD-04002: 无法打开文件 O/S-Error: (OS 2) 系统找不到指定的文件。 Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_dbw0_4060.trc: ORA-01157: cannot identify/lock data file 38 - see DBWR trace file ORA-01110: data file 38: 'D:\DATASPACE\XXXXX24.DBF' ORA-27041: unable to open file OSD-04002: 无法打开文件 O/S-Error: (OS 2) 系统找不到指定的文件。 Tue Jun 27 14:50:28 2023 Checker run found 2 new persistent data failures
人工创建被删除文件,启动库报ORA-27047,OSD-04006等错误
Tue Jun 27 16:45:10 2023 ALTER DATABASE OPEN Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_dbw0_5456.trc: ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: data file 6: 'D:\DATASPACE\XXXXX.DBF' ORA-27047: unable to read the header block of file OSD-04006: ReadFile() 失败, 无法读取文件 O/S-Error: (OS 38) 已到文件结尾。
offline相关数据文件,启动库成功,但是job开始报错
Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_dbw0_5456.trc: ORA-01157: cannot identify/lock data file 38 - see DBWR trace file ORA-01110: data file 38: 'D:\DATASPACE\XXXXX24.DBF' ORA-27041: unable to open file OSD-04002: 无法打开文件 O/S-Error: (OS 2) 系统找不到指定的文件。 Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_648.trc: ORA-01157: 无法标识/锁定数据文件 6 - 请参阅 DBWR 跟踪文件 ORA-01110: 数据文件 6: 'D:\DATASPACE\XXXXX.DBF' ORA-1157 signalled during: ALTER DATABASE OPEN... Tue Jun 27 16:48:43 2023 alter database datafile 'D:\DATASPACE\XXXXX.DBF' offline drop Completed: alter database datafile 'D:\DATASPACE\XXXXX.DBF' offline drop Tue Jun 27 16:49:08 2023 alter database open Tue Jun 27 16:49:08 2023 Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_dbw0_5456.trc: ORA-01157: cannot identify/lock data file 38 - see DBWR trace file ORA-01110: data file 38: 'D:\DATASPACE\XXXXX24.DBF' ORA-27041: unable to open file OSD-04002: 无法打开文件 O/S-Error: (OS 2) 系统找不到指定的文件。 Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_3976.trc: ORA-01157: 无法标识/锁定数据文件 38 - 请参阅 DBWR 跟踪文件 ORA-01110: 数据文件 38: 'D:\DATASPACE\XXXXX24.DBF' ORA-1157 signalled during: alter database open... Tue Jun 27 16:49:08 2023 Checker run found 1 new persistent data failures Tue Jun 27 16:49:28 2023 alter database datafile 'D:\DATASPACE\XXXXX24.DBF' offline drop Completed: alter database datafile 'D:\DATASPACE\XXXXX24.DBF' offline drop alter database open Tue Jun 27 16:49:37 2023 Thread 1 opened at log sequence 145929 Current log# 3 seq# 145929 mem# 0: D:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOG Successful open of redo thread 1 MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set Tue Jun 27 16:49:37 2023 SMON: enabling cache recovery Successfully onlined Undo Tablespace 2. Verifying file header compatibility for 11g tablespace encryption.. Verifying 11g file header compatibility for tablespace encryption completed SMON: enabling tx recovery Database Characterset is ZHS16GBK No Resource Manager plan active Tue Jun 27 16:49:39 2023 replication_dependency_tracking turned off (no async multimaster replication found) Starting background process QMNC Tue Jun 27 16:49:40 2023 QMNC started with pid=21, OS id=6096 Completed: alter database open Tue Jun 27 16:49:43 2023 db_recovery_file_dest_size of 4096 MB is 0.00% used. This is a user-specified limit on the amount of space that will be used by this database for recovery-related files, and does not reflect the amount of space available in the underlying filesystem or ASM diskgroup. Tue Jun 27 16:49:44 2023 Starting background process CJQ0 Tue Jun 27 16:49:44 2023 CJQ0 started with pid=142, OS id=6036 Tue Jun 27 16:49:48 2023 Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_j007_5184.trc: ORA-12012: 自动执行作业 64 出错 ORA-00376: 此时无法读取文件 6 ORA-01110: 数据文件 6: 'D:\DATASPACE\XXXXX.DBF' ORA-06512: 在 "XIFENFEI.XXXXXXXX", line 2897 ORA-06512: 在 line 1 Tue Jun 27 16:51:52 2023 Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_j000_2548.trc: ORA-12012: 自动执行作业 64 出错 ORA-00376: 此时无法读取文件 6 ORA-01110: 数据文件 6: 'D:\DATASPACE\XXXXX.DBF' ORA-06512: 在 "XIFENFEI.XXXXXXXX", line 2897 ORA-06512: 在 line 1 Tue Jun 27 16:54:44 2023 Starting background process SMCO Tue Jun 27 16:54:44 2023 SMCO started with pid=42, OS id=908 Tue Jun 27 16:55:52 2023
接手现场之后,关闭数据库,使用操作系统层面反删除工具进行扫描恢复,发现其中一个文件(另外一个文件os层面无法恢复)
通过工具检测恢复出来的数据文件,损坏的几个block是文件头部不涉及业务数据,运气不错
另外一个数据文件,从os层面无法恢复,对于这种情况,只能基于底层的block层面进行恢复(恢复没有覆盖的block)
参考类似恢复案例:
win文件系统损坏oracle恢复
Oracle 数据文件大小为0kb或者文件丢失恢复
分享运气超级好的一次drop tablespace 数据恢复
恢复出来的两个数据文件,结合该编辑的其他数据文件通过dul工具恢复其中数据,最大程度抢救客户数据,减少损失.