Guidance:RedoLog FilesYesOracle DatabaseA very important log file is also a distinctive feature. Redo log files record any operations on the database, such as using DML statements or DDL statements to change the data, or the database administrator to change the database structure.
It can be seen that when the data is accidentally deleted or modified, we can use the log file to restore it. When the routine fails or the media fails, you can also use log files to restore routines or media. Therefore, if we can manage redo log files, it is very important to ensure the security of database data.
Oracle redo log file management skills:
1. Properly Determine the storage location of redo log files
We know that when data in the database is lost or accidentally changed, the database administrator can use the redo log file to restore the database data. What should I do when an accident occurs in the database, such as physical damage to the hard disk or data loss?
First, we will think of using the database redo log to recover the data. However, when the redo log of the database is stored in the same hard disk as the database data file, it is obvious that when the hard disk is damaged, the data file and the log file will be stored in huangquan. At this time, even the Emperor Lao Tzu cannot save us.
Therefore, it is necessary to put the redo log file and the database data file on two different hard disks. In this case, if any hard disk is damaged, we can use the data of another hard disk to recover the loss. If the hard disk where the data file is stored is damaged, we can use the data redo log file stored on another hard disk to repair the file and recover the loss.
Eggs cannot be placed in the same basket. Therefore, do not redo log files or data files on the same hard disk. At that time, it was a very dangerous action.
In fact, this redo log file is similar to the backup file of the database. When backing up databases, we all know that remote backup is required. Unfortunately, many database administrators did not notice this during Oracle database management. As a result, it would be too late when a problem occurs. Therefore, for data redo log files, they must be stored in different regions like the database backup files.
Ii. Set the database archiving mode reasonably
Because the data redo log records all the changes to the database, when the database is frequently modified, such as those ERP systems that need to frequently modify the database, at this time, the redo log file of the database is huge. To facilitate log file management, by default, Oracle database has three redo log files during installation. When the first redo log file reaches a certain capacity, it will stop writing, and will switch to the second log file; when the second is full, it will switch to the third. When the third log is full, it is written to the first log file. Do I need to back up the original record when I write the redo log file to the original record? There are two processing modes based on different user needs. One is that automatic backup is not required for the database. This mode is called non-archive mode. When the redo log overwrites the original redo log file, if the database automatically backs up the original log files, this operation mode is called archive mode.
The database administrator has two options. What about archive mode or non-archive mode?
This requires enterprises to adopt different operation modes based on their requirements for data integrity. My suggestion is to adopt the archive mode. Because hard disks are very cheap now, we can spend less time in exchange for more complete database redo log files. I personally think this is very worthwhile for enterprises. ,
My current practice is to redo log files for at least one year. That is to say, after one year, you can rewrite the original log file. This is different from the industry where the enterprise is located and the degree of data security. If banks are different, they may require relogging for 10 or more years. You know, for them, any record may involve a lot of money.
Through the above learning, I believe that you have a general understanding of Oracle redo log file management skills. You can practice the skills described above in practice, this allows you to familiarize yourself with and master these skills.