1.查询当前的日志设置情况
sys@ora10g> col MEMBER for a40
sys@ora10g> select * From v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- -------------------- ---------------------------------------- ---
1 ONLINE /u01/app/oracle/oradata/ORA10G/redo01.log NO
2 ONLINE /u01/app/oracle/oradata/ORA10G/redo02.log NO
3 ONLINE /u01/app/oracle/oradata/ORA10G/redo03.log NO
sys@ora10g> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
1 1 13690 52428800 1 NO CURRENT 192645086 10-FEB-09
2 1 13689 52428800 1 YES INACTIVE 192633926 10-FEB-09
3 1 13688 52428800 1 YES INACTIVE 192614912 10-FEB-09
2.添加两个临时日志组
sys@ora10g> alter database add logfile group 4 ('/u01/app/oracle/oradata/ORA10G/redo04.log') size 200M;
sys@ora10g> alter database add logfile group 5 ('/u01/app/oracle/oradata/ORA10G/redo05.log') size 200M;
3.将当前使用的Online Redo Log切换到新增的Redo log group上
sys@ora10g> alter system switch logfile;
sys@ora10g> alter system switch logfile;
4.检查是否已经切换到新增的Online Redo log group上:
sys@ora10g> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
1 1 13695 52428800 1 YES INACTIVE 192653667 10-FEB-09
2 1 13694 52428800 1 YES INACTIVE 192653616 10-FEB-09
3 1 13693 52428800 1 YES INACTIVE 192653593 10-FEB-09
4 1 13696 209715200 1 NO CURRENT 192653673 10-FEB-09
5 1 13692 209715200 1 YES INACTIVE 192653549 10-FEB-09
3.删除原来的Online Redo Logs。
sys@ora10g> alter database drop logfile group 1;
sys@ora10g> alter database drop logfile group 2;
sys@ora10g> alter database drop logfile group 3;
4.操作系统下删除原日志组1、2、3中的文件
5.通过添加新的redo文件修改redo的大小
sys@ora10g> alter database add logfile group 1 ('/u01/app/oracle/oradata/ORA10G/redo01_01.log','/u01/app/oracle/oradata/ORA10G/redo01_02.log') size 200M;
sys@ora10g> alter database add logfile group 2 ('/u01/app/oracle/oradata/ORA10G/redo02_01.log','/u01/app/oracle/oradata/ORA10G/redo02_02.log') size 200M;
sys@ora10g> alter database add logfile group 3 ('/u01/app/oracle/oradata/ORA10G/redo03_01.log','/u01/app/oracle/oradata/ORA10G/redo03_02.log') size 200M;
6.将目前使用的Online Redo Log切换到刚刚新增的Redo log group
sys@ora10g> alter system switch logfile;
sys@ora10g> alter system switch logfile;
sys@ora10g> alter system switch logfile;
7.刪除过度时期的Online Redo Logs。
sys@ora10g> alter database drop logfile group 4;
sys@ora10g> alter database drop logfile group 5;
8.操作系统下删除原日志组4、5中的文件
9.检查调整后的的結果:
sys@ora10g> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
------ ------- ---------- ---------- -------- --- --------- ------------- ----------
1 1 503599 104857600 1 YES INACTIVE 2625981960 31-MAY-07
2 1 503600 104857600 1 YES INACTIVE 2626024767 31-MAY-07
3 1 503601 104857600 1 NO CURRENT 2625936142 31-MAY-07
10.记得调整后Control file备份下來, 并Reset Log。
sys@ora10g> alter database backup controlfile to trace resetlogs;
调整Online Redo Logs大小(Resizing Oracle Online Redo Logs)
最新推荐文章于 2024-02-20 16:25:57 发布