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
Happy to connect over video/audio/screen-share if need be.
No backups = No Restore / Recovery
. That's why backups are essential and very important. Even more important is to test the backups regularly by restoring them, because if the restore doesn't work, then you have to fix the backups. I would recommend contacting Oracle Support and/or asking for a certified Oracle consultant to have a look at your database instance. The more you try things, then worse it can get. Good luck.