What is Backup and its types ?

What is Backup ?

A backup is a copy of data from your database that can be used to reconstruct that data

When/Why Backup is required ?

Backup helps to restore or recover a database when required.

Difference between Restore and Recover :

Restore – During media failure(means loss/corruption of datafiles and other files) just restore the last back up files.

Recover – Applying redologs to the database to roll it forward till the point of failure, typically using current redo log files and online redolog file.

Backup plays an important role during the following scenarios :

  • Media Failures
    Disk drive/disk controller failure
    Deletion or Corruption of Database file)
  • Instance Crash
    Usually fixed when the database is startup by automatic recovery from online redo logs and undo data.
  • Application / User failures
    Accidentally dropped the table or index
    Deleted or modified the data in tables

Common types of Backup

Physical and Logical Backup

Physical backups are backups of the physical files used in storing and recovering your database, such as control files, datafiles, and archived redo logs. Ultimately, every physical backup is a copy of files storing database information to some other location, whether on disk or some offline storage such as tape.

Logical backups contain logical data (for example, tables or stored procedures) exported from a database with an Oracle export utility and stored in a binary file, for later re-importing into a database using the corresponding Oracle import utility.

Hot (online) and Cold (Closed / Offline) Backup

Hot (online) Backup

A backup of one or more data files taken while a database is open and the data files are online. When you make a user-managed backup while the database is open, you must put the tablespaces in backup mode by issuing an ALTER TABLESPACE BEGIN BACKUP command. (You can also use ALTER DATABASE BEGIN BACKUP to put all tablespaces in your database into backup mode in one step.)

You should not put tablespaces in backup mode when performing backups with RMAN but the database should be in ARCHIVELOG mode.

Cold (Closed / Offline) Backup

A backup of one or more database files taken while the database is closed. Typically, closed backups are whole database backups. If you closed the database consistently, then all the files in the backup are consistent. Otherwise, the backups are inconsistent.

Incremental Backup vs Full Backup

Incremental Backup

An RMAN backup in which only modified blocks are backed up. Incremental backups are classified by level. A level 0 incremental backup performs the same function as a full backup in that they both back up all blocks that have ever been used. The difference is that a full backup does not affect blocks backed up by subsequent incremental backups, whereas an incremental backup does affect blocks backed up by subsequent incremental backups.

Incremental backups at level 1 back up only blocks that have changed since previous incremental backups. Blocks that have not changed are not backed up. An incremental backup can be either a differential incremental backup or a cumulative incremental backup.

  • Differential incremental backup

A type of incremental backup that backs up all blocks that have changed since the most recent backup at level 1 or level 0. For example, in a differential level 1 backup RMAN determines which level 1 or level 0 incremental backup is most recent and then backs up all blocks changed since that backup. Differential backups are the default type of incremental backup. When recovering using differential incremental backups, RMAN must apply all differential incremental level 1 backups since the restored data file backup.

  • Cumulative incremental backup

An incremental backup that backs up all the blocks changed since the most recent backup at level 0. When recovering with cumulative incremental backups, only the most recent cumulative incremental backup must be applied.

Full Backup

A non-incremental RMAN backup. The word “full” does not refer to how much of the database is backed up, but to the fact that the backup is not incremental. Consequently, you can make a full backup of one data file.

Leave a Reply