Manage online redo logs

zhaozj2021-02-16  146

In the database recovery operation, the most important structure is online redo log, which contains two or more pre-batch files, all of these files store all operations for the database. Each instance in the Oracle database has a related online redo log, the purpose is to protect the database to prevent unventites fail.

The online redo log file is filled with heavy records. The redo record is also called a redo entry, which consists of a set of modified vectors, where each modified vector is used to describe a modification made to each block in the database.

The database's online redo log contains two or more online redo log files. Oracle requires at least two such files to make sure that one of which has been used for writing and the other for archiving. LGWR (Oracle Backstage Process Log Writer) is filled in the online redo log file in a loop. When the current online redo log file is filled, the LGWR will begin to fill in the next online redo log file. When the last available online redo log file is also filled, the LGWR returns to the first online redo log file and fill in, so loop.

You can create online redo log files and online redo log file groups, and you can modify, cancel, and delete log files (groups), specific commands, and parameters See the relevant information.

When the LGWR stops writing to another online redo log group, log switching is generated when writing to another online redo log file. By default, automatic log switching will occur when the current online redo log group is filled. Of course, you can also enforce log switching to make the current activity group become an inactive group to implement operational maintenance of the log group. Implementation forced log switching, you must have ALTER SYSTEM permissions. If there is such permissions, you can use the ALTER System statement with the Switch logfile clause to force the log switch, such as Alter System Switch logfile;

When turning on the database, the online redo log file may have been damaged and the activities of the database cannot be continued. In this case, you can use the ALTER DATABASE CLOGFILE statement without closing the database, reinitialize the online redo log file. Such as Alter Database Clear Logfile Group 3;

You can use the following view below to view the online redo log information. V $ log, V $ logfile, V $ log_history.

Such as select * from v $ logfile, the display data is as follows: Group # status type member 1 online d: /oacle9.11/oradata/usp/resp/redo02.log 3 Stale Online D: /oracle9.11/oradata/usp/redo03.log where status is empty record Description The current database is using the log file.

转载请注明原文地址:https://www.9cbs.com/read-9024.html

New Post(0)