Managing the archived logs
You can know about managing archived logs and also can go through some examples for the same through the information provided here.
When using online backup, you need to keep archived logs for as
long as they might be required for restoring a database, which depends
on your backup methodology and goals. This applies even if you have
configured one of the log archival options that “automates” log archiving,
you still must have a plan to delete old log files as they become
expendable so that your archive space does not get full. One key decision
that you must make is whether you want to recover your data up to
the most recent backup, or you want to recover data right up to the
time of the system failure. In case is a disk fails and you have to
restore a database from a backup, you must have the log files that
were taken during the backup. After the restore activity, the log
files are rolled forward to bring the database to a consistent state
that existed after the last backup. If you have saved all the log
files generated since the last backup, you can replay the logs right
to a time just before the crash. This helps reduce loss of updates
to the directory considerably. The next main factor is your backup
methodology and schedule. Consider the following examples:
- If you perform daily full online backups, then you must at least keep the log files that were active during the last backup operation. If you have saved all logs generated since the beginning of the last backup, then you would have all the data necessary to restore the database to the point in time immediately before an event, such as disk or system failure. Any log files archived before the last backup can be deleted to free disk space.
- If you perform a full online backup once a week and thereafter daily incremental backups in between, then you must at least save the logs that were active during the latest backup, full or incremental. Also, with this approach all the archived logs before the last full backup are no longer needed and can be deleted.
- If you perform a full online backup once a week and thereafter daily incremental delta backups, then you need to save the logs that were active during the latest backup, full or delta. In order to restore data up to the point in time of the data loss, you must save all the logs since the last backup operation. Any log files archived before the last full backup can be deleted.