Managing online redo logs

Source: Internet
Author: User

In database recovery, the most important structure is online redo logs, which contain two or more pre-batch files, store all operations performed on the database since the file is generated in these files. Each instance in the Oracle database has a related online redo log to protect the database against instance failures.

Online redo log files are filled with redo records. A redo record is also called a redo entry. It consists of a set of modification vectors. Each modification vector is used to describe the modifications made to each block in the database.

The online redo log of the database contains two or more online redo log files. Oracle requires at least two such files to ensure that one is always used for writing and the other is used for archiving. Lgwr (Oracle background process log writingProgram) Enter online redo log files cyclically. When the current online redo log file is filled up, lgwr starts to fill in the next online redo log file. When the last available online redo log file is filled up, lgwr returns to the first online redo log file and fills it in.

You can create online redo log files and online redo log file groups, and modify, cancel, and delete log files (groups). For more information about commands and parameters, see.

When lgwr stops writing data to an online redo log group and starts writing data to another online redo log file group, a log switching occurs. By default, Automatic Log switching is triggered when the current online redo log group is filled up. Of course, you can also force a log switch to change the current active group to an inactive group for operation and maintenance of this log group. Force log switching is implemented. You must have the alter system permission. If you have such permissions, you can use the alter System statement with the switch logfile clause to force log switching, for example, alter system switch logfile;

When you open the database, online redo log files may have been damaged, and the database activities may be stopped because the archive cannot be continued. In this case, you can use the alter database clear logfile statement to reinitialize online redo log files without shutting down the database. For example, alter database clear logfile group 3;

To view online redo log information, you can use the following view. V $ log, V $ logfile, and V $ log_history.

for example, select * from V $ logfile. The data displayed is as follows:
group # status type member
1 online D: /oracle9.11/oradata/USP/redo01.log
2 stale online D:/oracle9.11/oradata/USP/redo02.log
3 stale online D: /oracle9.11/oradata/USP/redo03.log
If the value of status is null, the current database is using this log file.

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.