Archivelog mode concepts | Oracle Hot backup and cold backup

We take complete physical backup of database by copying physical database files including datafiles, control files, password file and parameter file. Backup can be online backup or offline backup. In online backup, our database is in open stage and datafiles have different SCN. This type of backup is also known as hot backup as during the process of backup, database is open and user s can access and change data. In offline backup which also known as cold backup, all datafiles and control files have same SCN number. This type of backup is possible when database is closed by a clean shutdown.

When changes are made to datafiles, before these changes are written to datafies, redo entries for these changes are written to online redo log file. These redo entries can be used to re-build or re-store database changes. When a redo log file is full and archivelog mode of database is turned on, this redo log file is copied to offline destination known as archived redo log. The process of coping online redo log to archive redo log is called archiving. Redo log files work in circular fashion, it means redo log files are reused. For example, if our database has two redo log files, oracle uses second redo log file when first redo log file is full. When second redo log file is also full, oracle switches back to first redo log file. So if archiving is not turned on redo entries in redo log file are lost.

We need archive redo logs in flowing situations,

To take an online or hot backup, database archiving must be turned on because in online backup, datafiles have different SCN and data in data files in not consistent. When we restore an online backup, archived redo logs are applied to bring database in consistent stage.

Suppose we have taken a physical backup. After four hours of physical backup, few or all datafiles stop working due to media loss. We have a backup which is four hour old. We can only recover last four hours working only if automatic archiving is on.

Flashback database feature also requires that database archiving should be turned on.

To summarize, we can conclude that to protect our data and to ensure database recovery, archiving of database must be turned on.

Leave a Reply

Your email address will not be published. Required fields are marked *