天天看點

oracle 擴大日志檔案大小的方法

資料庫中的原有配置3個redolog檔案,大小1M,由于切換頻繁,想擴大大小,如何操作?

假設現有三個日志組,每個組内有一個成員,每個成員的大小為1MB,現在想把此三個日志組的成員大小都改為10MB

1、建立2個新的日志組

alter database add logfile group 4 ('D:\ORACLE\ORADATA\ORADB\REDO04_1.LOG') size 10M;

alter database add logfile group 5 ('D:\ORACLE\ORADATA\ORADB\REDO05_1.LOG') size 10M;

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;

8、到作業系統下删除原日志組4、5中的檔案

9、備份目前的最新的控制檔案

alter database backup controlfile to trace resetlogs