Oracle 10g REDO log 重做日誌

來源:互聯網
上載者:User

1.概述

     Oracle 引入Redo log 的目的在於資料恢複

     相關的Oracle進程:重做日誌寫進程(LGWR)

     相關的資料字典 v$log,v$logfile

     作者許可權:sys ,system 許可權

2.查看重做日誌資訊

查看重做日誌組相關資訊

select * from v$log;

 狀態列(status)所顯示常用狀態的含義:

  •       inactive :表示執行個體恢複時不需要這組日誌。
  •        active:表示該組是活動的但不是當前組,執行個體恢複時需要這組日誌。
  •        current:表示該組日誌是當前組,該聯機重做日誌組是活動的。
  •        unused:表示該日誌組從未寫過,是重做日誌剛剛添加到狀態。查看重做日誌群組成員相關資訊

select * from v$logfile;


 

狀態列(status)所顯示常用狀態的含義:

  •        空白:表示該文正在使用。
  •        stale:表示該檔案中的內容是不完全的。
  •        invalid:表示該檔案是不可以被訪問的。
  •         deleted:表示該檔案已不在有用了。

3.工作日誌組的切換

4.添加重做日誌組

添加重做日誌組

SQL> alter database add logfile ('e:\oracle\product\redo4.log') size 4096k;

上面是建立重做日誌組時候的兩個小錯誤,我們不需要在建立的時候加上group 因為建立的時候Oracle會自動對新群組賦組號。
刪除重做日誌組

SQL> alter database drop logfile group 4;

Database altered

注意;關鍵字group 與組號4之間有個空格,當前工作的日誌組是無法刪除的,切換後可以刪除

4.重做日誌群組成員操作

向已有組添加重做日誌

SQL>alter database add logfile member 'e:\oracle\product\10.2.0\redo03c.log' to group 3;

刪除已有組的重做日誌

SQL>alter database drop logfile member 'e:\oracle\product\10.2.0\redo03c.log';

更改重做日誌後可以通過資料字典 v$log,v$logfile查看是否更改成功

相關文章

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.