tft每日頭條

 > 生活

 > linux怎麼查看oracle數據庫狀态

linux怎麼查看oracle數據庫狀态

生活 更新时间:2025-01-18 08:26:33
概述

Oracle 的Online redo log 是為确保已經提交的事務不會丢失而建立的一個機制。 因為這種健全的機制,才能讓我們在數據庫crash時,恢複數據,保證數據不丢失。下面介紹一下Redo log的六種狀态(鍛煉下大家英文能力)。

linux怎麼查看oracle數據庫狀态(除了常見3種狀态)1


redo log六種狀态

1、CURRENT

The online redo log is active, that is, needed for instance recovery, and it is the log to which the database is currently writing. The redo log can be open orclosed.

2、ACTIVE

The online redo log is active and required for instance recovery, but is not the log to which the database is currently writing. It may be in use for blockrecovery, and may or may not be archived.Once perform "alter system checkpoint",the log will be change inactive.

3、INACTIVE

The log is no longer needed for instance recovery. It may be in use for media recovery,and may or may not be archived.

4、UNUSED

The online redo log has never been written to.

5、CLEARING

The log is being re-created as an empty log after an ALTER DATABASECLEAR LOGFILE statement. After the log is cleared, then the status changes to UNUSED.

6、CLEARING_CURRENT

Current log is being cleared of a closed thread. The log can stay in this status if there is some failure in the switch such as an I/O error writing thenew log header. . .

The ALTER DATABASE CLEAR LOGFILE statement can fail with an I/O error due to media failure when it is not possible to:

Relocate the redo log file onto alternative media by re-creating it under the currently configured redo log filename

Reuse the currently configured log filename to re-create the redo log file because the name itself is invalid or unusable (for example, due to media failure)


查看Redo log的狀态和具體文件

SQL> select group#,bytes/1024/1024||'M',status from v$log; SQL> select group#,member from v$logfile;

linux怎麼查看oracle數據庫狀态(除了常見3種狀态)2

linux怎麼查看oracle數據庫狀态(除了常見3種狀态)3


redo log一般用的比較多命令就上面兩條和對redo log調整方面的命令了,屬于必須掌握的内容。後面會分享更多devops和DBA方面的内容,感興趣的朋友可以關注一下~

linux怎麼查看oracle數據庫狀态(除了常見3種狀态)4

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关生活资讯推荐

热门生活资讯推荐

网友关注

Copyright 2023-2025 - www.tftnews.com All Rights Reserved