| Lesson 2 | Introduction to Backup and Recovery |
| Objective | Understand the basic principles of Oracle database backup, restoration, and recovery. |
A backup is a copy of data, which can include critical database components such as the control file and datafiles. Backups safeguard against unexpected data loss and application errors. If the original data is lost, you can use the backup to reconstruct it.
Backups are divided into:
Physical backups are copies of physical database files. In contrast, logical backups contain data extracted using the Oracle Export utility and stored in a binary file. Logical backups can supplement physical backups. Physical backups can be created using the Oracle Recovery Manager (RMAN) utility or operating system utilities.
To restore a physical backup is to reconstruct it and make it available to the Oracle database server. To recover a restored datafile is to update it using redo records, which are records of changes made to the database after the backup was taken. If you use Recovery Manager (RMAN), you can also recover restored datafiles using incremental backups, which contain only blocks that changed after the last backup.
Oracle performs crash recovery and instance recovery automatically after an instance failure. Instance recovery involves two operations:
In contrast, media recovery requires manual intervention. Using SQL*Plus, you can issue the RECOVER or:
ALTER DATABASE RECOVER
statements to apply archived logs. If you use RMAN, you issue the recover command to apply archived redo logs or incremental backups to the datafiles.
The following figure illustrates the basic principle of backing up, restoring, and performing media recovery on a database:
Oracle database media recovery process using archived redo logs. Below is a step-by-step breakdown with a focus on the archived redo logs:
Timeline and Events
Database States
Archived Redo Logs – Core Role
Recovery Flow
Figure 2-1: Basic principle of backing up, restoring, and performing media recovery on a database.