BACKUP DATABASE RECOVERY
- Recover is of 2 types
- Complete recovery – recovering database till the point of failure. No data loss
- Incomplete recovery – recovering to a certain time or scn. Has data loss
- We will perform complete recovery if we lost only data files.
- We will perform incomplete recovery if we lost either redo log files, control files or archive log files.
- Recovery process involves two phases
- RESTORE – copying a file from backup location to original location as that file is lost now
- RECOVER – applying archive logs and redo logs to bring the file SCN in par with latest SCN
STEPS for recovering table space
STEPS for recovering a single datafile
STEPS for recovering system tablespace
STEPS for recovering database (we will perform this when we lost more than 50% of datafiles)
STEPS to recover controlfile in a noarchivelog mode database
STEPS to recover redolog file in archivelog mode
- Create new redolog files at OS level (location and size will be taken from controlfile) if not already existing.
- Resets the log seq number (LSN) to 1, 2, 3 etc for the created files.
- Whenever database is opened with resetlogs option, we will say database entered into new incarnation. If database is in new incarnation, the backups which were taken till now are no more useful. So, whenever we perform an incomplete recovery we need to take full backup of database immediately.