ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【操作】调整Online Redo Logs大小(Resizing Oracle Online Redo Logs)

【操作】调整Online Redo Logs大小(Resizing Oracle Online Redo Logs)

原创 Linux操作系统 作者:secooler 时间:2009-02-25 14:28:32 0 删除 编辑
-- 2009-2-10 17:14
-- 调整Online Redo Logs大小(Resizing Oracle Online Redo Logs)

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;

-- The End --

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/519536/viewspace-557736/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle ACE 总监,阿里云MVP,北京大学理学硕士,恩墨学院创始人,教育专家,中国区 Cloudera 首位官方授权大数据讲师,金牌培训专家,BDA大数据联盟创始人,OCM联盟创始人,ACCUG创始人、ACOUG核心专家,Blogger。

注册时间:2008-03-16

  • 博文量
    797
  • 访问量
    8025242