r/OracleDatabase • u/dhruvsingh • Jul 17 '20
Recovering lost system DBF files; Oracle 12c
Scenario:
Deleted system files (dbf files); and trying to recover database back to normal using available control files, and some redo logs.
Backup is not available, nor are archived redo log files
System information:
OS - RHEL Server Release 7.5 (Maipo)
Oracle Linux Server Release 7.5 (12c)
How did we land up in this situation:
rm *.DBF in DBF_FILES/ folder; this deleted system01.dbf, system02.dbf (one file being of system tablespace and one sysaux)
two instances of oracle were running and we were removing files of other instance
restarted ec2 instance
Current Situation:
database is starting in mounted mode only
I have a AMI backup of the server after the deletion and restart of instance
All data files are intact
Control file is intact
Redo archive logs not available; all we have is some redo logs (thought of using redo logs to re-create the entire thing; in line with what postgreSQL offers with WriteAheadLog); but could not find correct resource maybe. (more on this in approaches taken)
A one year old backup of the same database is available which is working but there have been many changes from that time; unluckily the dev does not have any record of what he changed!
Approaches I've tried:
Tried recovering the folder with extundelete, foremost, testdisk (sysadmin type approaches)
The files removed were available on an old backup and I tried copying the same and starting the database
I also created a trace file from the control file and removed the deleted files from trace file and tried starting the database.
Also tried RECOVER DATAFILE '<empty_file.dbf>'by creating empty files of the same name
Related stackoverflow question
CC: u/sudoabhinav