Oracle Redo log File Management tips

Source: Internet
Author: User
Tags oracle database backup

The redo log file is a very important log file in the Oracle database and is a feature of its own. The redo log file records any operations to the database, such as using DML statements or DDL statements to make changes to the data, or database administrators making changes to the database structure that are recorded in the Redo log.

Visible, when the data is accidentally deleted or modified, we can use the re-log file for recovery; You can also use log files to implement routine recovery or media recovery when a routine fails or media failure occurs. So, if we can manage redo log files, it is very important to ensure the security of database data.

The following author talk about the management of Oracle database log files, some experience skills, perhaps, can give you in the Redo log file management to bring some enlightenment.

A reasonable determination of the location of the redo log files

We know that database administrators can use redo log files to restore database data when the data inside the database is lost or accidentally changed. What happens when the database is in an unexpected accident, such as physical damage to the hard disk and data loss?

The first thing we'll think of is to recover the data using the database redo log. But when the database redo log and database data files on the same hard drive, it is obvious that when the hard disk damage, the data file will be with the log file to the afterlife. At this time, even the Emperor Lao Tze can not save us.

So, at this point, we need to put the redo log file with the database data file on two different hard drives. At this point, if any one of the hard disk damage, we can rely on another hard disk data, to recover the loss. If the hard drive that holds the data file is damaged, we can restore the loss by using the data from the other hard disk to redo the log file.

Eggs can not be placed in the same basket, so redo log files and data files should not be placed on the same hard disk. It was a very dangerous action.

In fact, this redo log file is similar to the database backup file. When we back up the database, we all know that we need offsite backup. Unfortunately, many database administrators, in the Oracle database management, did not pay attention to this point, the results when there is a problem, it is too late. Therefore, for data redo log files, save, as the database backup files, offsite preservation.

Two, the reasonable set up the database mode of archiving

Because the data redo log will record all the changes in the database, so, when the database changes frequently, such as those ERP system needs to modify the database frequently, at this time, the database redo log file will be very large. To facilitate the management of log files, Oracle databases by default, there will be three redo log files when installed. When the first redo log file reaches a certain capacity, it stops writing and shifts to the second log file; When the second one is full, it turns to the third. When the third is full, it is written to the first log file. Do you need to back up the original records when you write redo log files to the original record? These two processing modes exist depending on the user's requirements. One is that no database is required for automatic backup, which is called a non-archival mode; And when the redo log overwrites the original redo log file, the database will automatically back up the original log file, this mode of operation is called the archive mode.

Now there are two choices in front of the database administrator. Select archive mode or non-archive mode?

This requires different modes of operation depending on the requirements of the enterprise for data integrity. The author's suggestion is to adopt the archiving mode. Because now the hard disk is very cheap, so we can spend a relatively small price, in exchange for a more complete database redo log files, personally think this for the enterprise, is very worthwhile. 、

The author's current practice is to redo log files for at least one year. That is, after a year, you can rewrite the original log file. This is mainly in line with the industry and the degree of security of the data is different. If banks are different, they may require a new journal to remain for a decade or even longer. You know, for them, any record might involve a lot of money.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.