Scenario: To restore to a certain point in time (point in time recovery).
A full backup was made at 13:40. The emp1355 table was created at 13:55.
Enter some data (the constraints may have to be deleted)
for aa in 1..10 LOOP
insert into hr.emp1355 (employee_id, last_name, first_name, department_id, salary)
values (192100 + aa, ‘mehmet’, ‘Derviş’, 1, 112600 + aa);
end loop ;
when others then
Created the emp1400 table at 14:00
At 13:56 we want to execute a Point In Time Recovery.
- The database is shutdown and datafiles are deleted.
- There is the full backup that was made at 13:40.
- Datafiles will be restored from rman backup and then recovered from archivelogs that were generated between 13:40 and 13:56.
startup mount ;
restore database ;
recover database until time “to_date(’31/05/2011 13:56:00′,’DD/MM/YYYY HH24:MI:SS’)”;
alter database open resetlogs;
Restore is used to return to the moment that the backup was made.
Recover is then used to bring the archive logs to the last moment.
Name Null? Type
ORA-04043: object hr.emp1400 does not exist
Setting the database so that it is possible to recover to 3 days ago
Requires configuration. The backups don’t get deleted regardless of the number of backups that have been made.
Alternatively, we need the archive logs from the past 3 days.
The archive logs made by the backup process are what are used for recovery.