system01.dbf,表空间丢失损坏,或者丢失异常处理
起库到mounted状态,显示找不到system.01.dbf文件
SQL> startup
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 541068368 bytes
Database Buffers 289406976 bytes
Redo Buffers 2371584 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/u01/app/oracle/oradata/PROD/system01.dbf'
恢复过程
#进入rman
rman target /
#找一下问题原因
RMAN> list failure;
using target database control file instead of recovery catalog
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
402 CRITICAL OPEN 28-NOV-22 System datafile 1: '/u01/app/oracle/oradata/PROD/system01.dbf' is missing
#从备份里恢复
RMAN> advise failure;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
402 CRITICAL OPEN 28-NOV-22 System datafile 1: '/u01/app/oracle/oradata/PROD/system01.dbf' is missing
analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
analyzing automatic repair options complete
Mandatory Manual Actions
========================
no manual actions available
Optional Manual Actions
=======================
1. If file /u01/app/oracle/oradata/PROD/system01.dbf was unintentionally renamed or moved, restore it
Automated Repair Options
========================
Option Repair Description
------ ------------------
1 Restore and recover datafile 1
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/prod/PROD/hm/reco_1593912594.hm
#执行脚本
RMAN> @/u01/app/oracle/diag/rdbms/prod/PROD/hm/reco_1593912594.hm
RMAN> # restore and recover datafile
2> restore datafile 1;
Starting restore at 28-NOV-22
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/PROD/system01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/db_PROD_20221128_0g1dtvc1_1_1.bak
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/db_PROD_20221128_0g1dtvc1_1_1.bak tag=TAG20221128T014225
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 28-NOV-22
RMAN> recover datafile 1;
Starting recover at 28-NOV-22
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 28-NOV-22
RMAN> sql 'alter database datafile 1 online';
sql statement: alter database datafile 1 online
RMAN> **end-of-file**
完成
验证
#正常开库
SQL> alter database open;
Database altered.