Oracle has the ability to create the script to repair the database. This is known as the Data Recovery Adviser (DRA). If you need to introduce your own corruption for testing purposes, you could research on the Internet for examples. The following example is how the DRA was used to restore a corrupted datafile.
I removed all backups before starting this scenario. This means that the recovery came from the redo and any archived logs. Cool! See the restoration from the redo section for more about this.
RMAN backup command detects a problem and it doesn't mention the word "corrupt".
Notice that the alert log has the same date time stamp as the RMAN session, which detected the problem.
Using RMAN, I start investigating to see what RMAN knows about the problem.
Using RMAN, I ask the DRA what I should do about this problem—this is known as the
advise failure
command.
The contents of the repair script are included below:
RMAN> # restore and recover datafile sql 'alter database...