Archive log in Oracle)

Source: Internet
Author: User

In Oracle, data is generally stored in data files, but one of the biggest differences between the database and Oracle is that the database can be restored when data errors occur. This is our common redo file function in Oracle. The redo log is divided into two parts: Online redo log files and archiving log files.

Here, we will not detail online redo logs, but archive logs ). After all, the size of online redo logs is limited. When all logs are full, there are two options. The first one is to erase the previous online redo logs from scratch and continue writing, the second is to back up the previous online redo logs first, and then write a new online redo file for the erased logs. Online redo logs of such backups are archived logs. If the database uses this archive log generation mode, it is the archivelog mode. If the archive log is not generated, it is the non-archivelog mode ).

What are the benefits of archiving logs. For example, after backing up a data record in March 1st day of this month and 10 days later, hundreds of online redo logs are generated in these 10 days. Suddenly, one of the data disks has a problem and cannot be used, so how should I do it.

If you do not use archive logs, there will actually be only a few of the latest online redo logs on the disk. Otherwise, I can only delete all the tablespaces occupied by the problematic data disk. However, if an error occurs on the disk involved in the system tablespace, you can only use the second method. The second method is to take out the data backed up on the first day and restore it. The data for the 10 days between the 1st and 10th is lost. If it is a key system, such as a securities and financial system, it is necessary for you to lose money and die.

However, if you have archived logs, your redo logs for the past 10 days will be stored. Then, the DBA first restores the backup data on the first day, then, redo logs of the past 10 days are used for data operation replay, so that the latest database can be completely restored without any consequence.

During software development, due to the limited configuration of the test server, especially the limited disk space, the size of the redo file may be limited, and the system may be set to noarchivelog mode. However, in the actual production environment, archivelog mode must be used. Otherwise, it would be too late to cry if something goes wrong.

Some may be afraid of performance loss caused by archiving logs. In fact, this is completely worrying. Archiving logs is just a backup, which actually consumes more disk space. In the current software system, the cost of hard disk storage capacity is low to the point that can be ignored, and the most important thing is the security of the database. The DBA's task is to ensure data security. If security cannot be ensured at all, what is the use of minimal performance improvement.

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.