Oracle RMAN Backup & Recovery

ADVERTISEMENT

RMAN (Recovery Manager) is Oracle’s built-in tool for performing efficient backups and recoveries. Whether you’re backing up a full database, recovering a lost datafile, or validating a backup, RMAN is the go-to utility for DBAs. These quick notes will help you revise all key concepts and commands used in Oracle backup and recovery.

1. What is RMAN and why is it used?

RMAN (Recovery Manager) is a tool from Oracle used to back up, restore, and recover databases. It handles both physical backups and advanced recovery operations automatically.

2. What are the different types of Oracle backups?

  • Full Backup
  • Incremental Backup (Level 0, Level 1)
  • Archived Redo Log Backup
  • Control File and SPFILE Backup

3. What is the difference between physical and logical backups?

  • Physical Backup: Backups of datafiles, control files, and redo logs (RMAN does this).
  • Logical Backup: Exports of tables or schemas using expdp/impdp.

4. What is a consistent vs inconsistent backup?

  • Consistent Backup: Taken after clean shutdown (no active changes).
  • Inconsistent Backup: Taken while the database is open (requires redo during recovery).

5. What is the difference between hot and cold backup?

  • Hot Backup: Taken while the database is open.
  • Cold Backup: Taken when the database is shut down normally.

6. What is an RMAN full backup?

A full backup includes all data blocks in the database, regardless of changes. It doesn’t impact incremental backups.

7. What is an incremental backup in RMAN?

Backs up only the blocks that changed since the last Level 0 or Level 1 backup.

8. What is cumulative vs differential incremental backup?

  • Differential: Changes since last backup of the same level.
  • Cumulative: Changes since the last Level 0 backup.

9. What is block-level corruption detection?

RMAN checks blocks for corruption during backup and recovery, helping detect issues early.

10. How do you configure RMAN for automatic backups?

CONFIGURE CONTROLFILE AUTOBACKUP ON;

11. How do you perform a compressed or encrypted backup in RMAN?

Use options like:

BACKUP AS COMPRESSED BACKUPSET DATABASE;
BACKUP AS ENCRYPTED DATABASE;

12. How do you back up a full database using RMAN?

BACKUP DATABASE;

13. How do you back up specific tablespaces or datafiles?

BACKUP TABLESPACE users;
BACKUP DATAFILE 4;

14. How do you back up control file and SPFILE?

BACKUP CURRENT CONTROLFILE;
BACKUP SPFILE;

15. How do you back up archived logs?

BACKUP ARCHIVELOG ALL;

16. What is the use of CONFIGURE command in RMAN?

Used to set default RMAN settings like retention policy, channels, and backup destinations.

17. What are the types of recovery in Oracle?

  • Complete Recovery
  • Incomplete (Point-in-Time) Recovery
  • Block Media Recovery
  • Tablespace Point-in-Time Recovery (TSPITR)

18. How do you perform complete recovery using RMAN?

RESTORE DATABASE;
RECOVER DATABASE;

19. How do you perform point-in-time recovery?

Use SET UNTIL TIME or SCN before restore/recover:

RUN {
  SET UNTIL TIME 'SYSDATE-1';
  RESTORE DATABASE;
  RECOVER DATABASE;
}

20. What is TSPITR?

Restoring a single tablespace to a previous point without affecting the whole DB.

21. How do you recover from control file loss?

Restore from autobackup or backup location:

RESTORE CONTROLFILE FROM AUTOBACKUP;

22. How do you recover from datafile loss?

RESTORE DATAFILE 5;
RECOVER DATAFILE 5;

23. How to recover a lost redo log file?

If multiplexed, Oracle switches to the other copy. Otherwise, you may need incomplete recovery.

24. How to recover from block corruption using RMAN?

RECOVER BLOCK FOR DATAFILE 4 BLOCK 100;

25. What is the RMAN recovery catalog?

A separate schema/database storing RMAN metadata across backups and databases.

26. Difference between recovery catalog and control file metadata?

Control file stores recent metadata; catalog stores historical data across databases.

27. How to register a database in RMAN catalog?

RMAN> CONNECT CATALOG;
RMAN> REGISTER DATABASE;

28. What is CROSSCHECK in RMAN?

Verifies if backup files exist on disk/tape and updates RMAN records.

29. Purpose of DELETE OBSOLETE and DELETE EXPIRED?

  • DELETE OBSOLETE: Removes backups no longer needed by the retention policy.
  • DELETE EXPIRED: Deletes records of missing physical backup files.

30. How to list and validate backups in RMAN?

LIST BACKUP;
VALIDATE BACKUP;

31. How to configure RMAN retention policy?

CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

32. Difference between redundancy and recovery window?

  • Redundancy: Number of backup copies to retain.
  • Recovery Window: Number of days of recoverability to maintain.

33. How to automate RMAN backups?

Use cron, shell scripts, or DBMS_SCHEDULER.

34. Store RMAN backups on disk vs tape?

Disk is default; tape requires Media Management Layer (MML).

35. What is FRA (Fast Recovery Area)?

A centralized location for backups, archived logs, and flashback logs.

36. How to validate a backup?

VALIDATE BACKUPSET;

37. Common RMAN backup/restore issues?

  • Missing archive logs
  • Space issues in FRA
  • Backup set corruption
  • Incomplete catalog metadata

38. How to troubleshoot RMAN errors?

Check:

  • RMAN logs
  • V$RMAN_OUTPUT, V$RMAN_STATUS
  • Alert log

39. Useful logs/views to monitor RMAN?

  • Alert log
  • V$RMAN_BACKUP_JOB_DETAILS
  • V$BACKUP_SET
  • RC_BACKUP_SET (if using catalog)

40. What is RMAN duplication?

Used to clone a database using RMAN backups.

41. Difference between active and backup-based duplication?

  • Active: Copies directly over network without backup.
  • Backup-based: Uses existing RMAN backups.

42. How to restore a DB on a different server?

Transfer backups and use DUPLICATE TARGET DATABASE TO … with new paths.

43. What is incremental merge backup?

Merges Level 1 backups into Level 0 backup on disk—saves time during recovery.

44. What is multisection backup?

Backs up large files in parallel, increasing performance.

45. How is RMAN used in Oracle Data Guard?

RMAN supports standby database backups, restores, and synchronized recovery.

ADVERTISEMENT