What is archiving in oracle database?
The configuration of a database at the time of its creation is necessary in order to easily recover your data in case of any occurrence of system failure. Online redo log files are the ones that contain the complete record of any changes that were made to the primary data files. These online redo log files are stored in online redo log groups. It is important to have at least two online redo log groups for your database.
Once an online redo log files belonging to a group has been filled, the log writer process (LGWR) switches to a new group. This is for continuing the writing process of redo log records. The inactive group of online redo log files can be automatically saved by the Oracle database at one or multiple offline destinations. These destinations are collectively addressed as archived redo log or the archive log. This process of converting online redo log files into archived log is called Archiving.
The process of archiving can only be performed when the database is running in the ARCHIVELOG mode.Â
It is important to note that unless the group of online redo log files is archived, they cannot be reused by the log writer (LGWR). In case the LGWR switches to a new group and leaves the previous one inactive for some time. After that inactive group becomes readily available for immediate reuse by the LGWR process provided the database is running in NOARCHIVELOG mode.
A database instance failure could be avoided in NOARCHIVELOG mode however this mode does not protects the database from media failure. The most recent changes made to the database that is stored in the online redo log files are the only ones available for instance recovery. Therefore in order to restore the database operating in NOARCHIVELOG mode, you can only use the entire database backups that were taken while it was closed. Therefore it is essential that you frequently back-up the entire database when operating it in NOARCHIVELOG mode.
Advantages of Archiving.
The advantages of archiving online redo log files are:
- A database backup, with online and archived redo log files, ensures that you can recover all committed transactions in case of the failure of operating system or hardware.
- If you have a copy of the archived log files that were written while the database was being backed up then you can easily recover the database using that backup which was taken while the database was open and being used.
- You can perform online tablespace backups, and use these backups to restore a tablespace following media failure.
- You can keep a standby database current with its original database by continuously applying the original archived redo log files to the standby database.
The destination to which you want to archive the online redo log files must be decided beforehand. It is recommended by Oracle that archive log should be stored in such areas that are capable of fast recovery in order to simplify the operations of backup and recovery.
There is a difference between fast recovery area and database area.
The former is where the Oracle database stores and manages files related to backup and recovery. Whereas the latter is the location of the current database files that include – data files, control files and online redo log files.
You can also learn about installing Oracle database 12c on Windows here.
That’s all about archiving in Oracle database. Hope this blog was helpful to you. Kindly please share it on your social network & help me reach out to more people. Thanks & have a great day!