關於redo log的修改與重建

來源:互聯網
上載者:User

有時隨著業務的發展需要對redo log日誌進行重新規劃。比如現有的日誌有三組,每組一個成員,並且每個成員大小為50M,那麼對於生產庫顯然不合理。我們則需要根據業務資料進行相應的調整。一般情況下我們建議每組有兩個成員就夠了,一個檔案大小不超過2G,操作步驟如下:

1、建立日誌組:

alter database add logfile group 1

 ('/opt/Oracle/redo01a.log',

 '/opt/oracle/redo01b.log')

 size 2G;

2、建立幾組日誌組後,我們需要將之前不用的日誌組給切換成INACTIVE狀態,文法:

alter system switch logfile;

如果想刪除的日誌組狀態一直是active狀態,可以用

 alter system checkpoint;

這樣active就會變成inactive了

3、刪除日誌組

alter database drop logfile group n;

4、這個只是邏輯刪除,還需要去磁碟中把沒用的物理檔案給刪除了

相關文章

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.