假設現有三個日誌組,每個組內有一個成員,每個成員的大小為1MB,現在想把此三個日誌組的成員大小都改為10MB 。
1、建立2個新的日誌組
alter database add logfile group 4 ('D:\Oracle\ORADATA\ORADB\REDO04_1.LOG') size 1024k;
alter database add logfile group 5 ('D:\ORACLE\ORADATA\ORADB\REDO05_1.LOG') size 1024k;
2、切換當前日誌到新的日誌組
alter system switch logfile;
alter system switch logfile;
3、刪除舊的日誌組
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
4、作業系統下刪除原日誌組1、2、3中的檔案
5、重建日誌組1、2、3
alter database add logfile group 1 ('D:\ORACLE\ORADATA\ORADB\REDO01_1.LOG') size 10M;
alter database add logfile group 2 ('D:\ORACLE\ORADATA\ORADB\REDO02_1.LOG') size 10M;
alter database add logfile group 3 ('D:\ORACLE\ORADATA\ORADB\REDO03_1.LOG') size 10M;
6、切換日誌組
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
7、刪除中間過渡用的日誌組4、5
alter database drop logfile group 4;
alter database drop logfile group 5;
SQL> select * from v$log;
SQL> alter system switch logfile;
8、到作業系統下刪除原日誌組4、5中的檔案
9、備份當前的最新的控制檔案
SQL>; alter database backup controlfile to trace resetlogs
注意:如果為安全考慮每個group可以多加幾個檔案
10、向已有組添加重做日誌
SQL>alter database add logfile member 'e:\oracle\product\10.2.0\redo03c.log' to group 3;
11、刪除已有組的重做日誌
SQL>alter database drop logfile member 'e:\oracle\product\10.2.0\redo03c.log';
註:本文從多個網頁查詢資料整改,經正式生產環境操作。