A log switch occurs when LGWR stops writing to one redo log group and starts
writing to another. By default, a log switch occurs automatically when the current redo log file group fills.
You can force a log switch to make the currently active group inactive and available for
redo log maintenance operations. For example, you want to drop the currently active
group, but are not able to do so until the group is inactive. You may also wish to force
a log switch if the currently active group needs to be archived at a specific time before
the members of the group are completely filled. This option is useful in configurations
with large redo log files that take a long time to fill.
To force a log switch, you must have the ALTER SYSTEM privilege. Use the ALTER
SYSTEM statement with the SWITCH LOGFILE clause.
The following statement forces a log switch:
手工日志切换:ALTER SYSTEM SWITCH LOGFILE;
-------------------------------------------------------
当这当前日志组满了的时候,日志切换自动发生了。默认,无须人工干预。
必要的时候,手动切换日志,使用当前激活的日志组发生切换,而变成非激活的日志组,当变成非激活的日志组的时候,即状态为inactive.就可以对状态为inactive的日志组进行操作了。列如,删除操作(drop)等。还有一个原因是当前日志组需要在规定的时间要进行归档,但是当前日志组还没有满,不能自动切换,因此手动切换,从而及时归档。因为状态为active的日志组,Oracle是不允许操作的。
阅读(1474) | 评论(0) | 转发(0) |