修改Oracle redo.log文件的大小
1.查看当前日志组成员:
SQL> select member from v$logfile;
MEMBER
------------------------------------------------------
C:\ORACLE\PRODUCT\10.2.0\ORADATA\FYDB\REDO01.LOG
C:\ORACLE\PRODUCT\10.2.0\ORADATA\FYDB\REDO02.LOG
C:\ORACLE\PRODUCT\10.2.0\ORADATA\FYDB\REDO03.LOG
2.查看当前日志组状态:
SQL> select group#,members,bytes/1024/1024,status from v$log;
GROUP# MEMBERS BYTES/1024/1024 STATUS
---------- ---------- --------------- ----------------
1 1 50 INACTIVE
2 1 50 INACTIVE
3 1 50 CURRENT
现有三个日志组,每个组内有一个成员,每个成员的大小为50MB,现在想把此三个日志组的成员大小都改为100MB ,步骤如下:
1、创建2个新的日志组
SQL> alter database add logfile group 4 ('C:\ORACLE\PRODUCT\10.2.0\ORADATA\FYDB\REDO04.LOG') size 100M;
SQL> alter database add logfile group 5 ('C:\ORACLE\PRODUCT\10.2.0\ORADATA\FYDB\REDO05.LOG') size 100M;
2、切换当前日志到新的日志组
SQL> alter system switch logfile;
SQL> alter system switch logfile;
SQL> select group#,members,bytes/1024/1024,status from v$log;
GROUP# MEMBERS BYTES/1024/1024 STATUS
---------- ---------- --------------- ----------------
1 1 50 ACTIVE
2 1 50 ACTIVE
3 1 50 ACTIVE
4 1 100 CURRENT
5 1 100 ACTIVE
3、删除旧的日志组
SQL> alter database drop logfile group 1;
SQL> alter database drop logfile group 2;
SQL> alter database drop logfile group 3;
4、操作系统下删除原日志组1、2、3中的文件REDO01.LOG、REDO02.LOG、REDO03.LOG。
5、重建日志组1、2、3
SQL> alter database add logfile group 1 ('C:\ORACLE\PRODUCT\10.2.0\ORADATA\FYDB\REDO01.LOG') size 100M;
SQL> alter database add logfile group 2 ('C:\ORACLE\PRODUCT\10.2.0\ORADATA\FYDB\REDO02.LOG') size 100M;
SQL> alter database add logfile group 3 ('C:\ORACLE\PRODUCT\10.2.0\ORADATA\FYDB\REDO03.LOG') size 100M;
6、切换日志组
SQL> alter system switch logfile;
SQL> alter system switch logfile;
7、删除中间过渡用的日志组4、5
SQL> alter database drop logfile group 4;
SQL> alter database drop logfile group 5;
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 UNUSED
2 UNUSED
3 UNUSED
4 INACTIVE
5 CURRENT
8、到操作系统下删除原日志组4、5中的文件
9、备份当前的最新的控制文件
SQL> conn / as sysdba
SQL> alter database backup controlfile to trace resetlogs;