更改RAC資料庫日誌檔案大小及數量 for ASM

spectre2發表於2011-04-15

更改RAC資料庫日誌檔案大小及數量 for ASM


檢視日誌和日誌檔案資訊:
select b.THREAD#,a.GROUP#,a.STATUS,a.MEMBER,b.BYTES/1024/1024,b.ARCHIVED,b.STATUS
from v$logfile a,v$log b where a.GROUP#=b.GROUP#;
查詢日誌狀態:
select group#,THREAD#,status,archived,bytes/1024/1024 from v$log;
1、每個節點各建立兩個新的日誌組
alter database add logfile thread 1 GROUP 5 size 200m;
alter database add logfile thread 1 group 6 size 200m;
alter database add logfile thread 2 group 7 size 200m;
alter database add logfile thread 2 group 8 size 200m;
2、切換日誌組(rac1和rac2):
alter system switch logfile;
切換多次日誌組後手工發起一個checkpint(rac1和rac2):
alter system checkpoint;
3、在日誌組不是active和current狀態時刪除掉日誌組,取決於磁碟的速度,速度慢的可能切換後很長時間狀態才改變,這個一定要確認好的。
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
alter database drop logfile group 4;
4、新增1,2,3,4日誌組
alter database add logfile thread 1 GROUP 1 size 200m;
alter database add logfile thread 1 group 2 size 200m;
alter database add logfile thread 2 group 3 size 200m;
alter database add logfile thread 2 group 4 size 200m;
5、多次切換日誌組
alter system switch logfile;
6、刪除中間過渡用的日誌組5、6、7、8
alter database drop logfile group 5;
alter database drop logfile group 6;
alter database drop logfile group 7;
alter database drop logfile group 8; 
7、新增一組日誌組
alter database add logfile thread 3 GROUP 5 size 200m;
alter database add logfile thread 3 GROUP 6 size 200m;
8、備份當前的最新的控制檔案
SQL> alter database backup controlfile to trace resetlogs;


問題解決。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14184018/viewspace-692550/,如需轉載,請註明出處,否則將追究法律責任。

相關文章