RAC修改日志文件大小

修改日志文件大小,要确保每个节点至少有两组日志文件,步骤如下:

<pre name="code" class="html">/*数据库改变redo日志大小 由256m变为100m,由每个实例2组改为每个实例4组*/
select * from v$log;
select * from v$logfile;
--1.查看现有日志组信息
SQL> SELECT   v$logfile.group#, v$log.status,v$log.ARCHIVED, v$log.bytes/1024/1024 ,v$log.thread# FROM v$log, v$logfile WHERE v$log.group# = v$logfile.group# group by v$logfile.group#, v$log.status,v$log.ARCHIVED, v$log.bytes/1024 /1024 ,v$log.thread#;

    GROUP# STATUS           ARC V$LOG.BYTES/ 1024/1024     THREAD#
---------- ---------------- --- --------------------- ----------
         4 CURRENT           NO                     50          2
         2 INACTIVE         YES                    50          1
         1 CURRENT           NO                     50          1
         3 INACTIVE         YES                    50          2
SQL> col member format a60
SQL> SELECT group#,member FROM v$logfile;

    GROUP# MEMBER
---------- ------------------------------------------------------------
         2 +MYSHARE/orcl/onlinelog/group_2.264.889785653
         2 +MYSHARE/orcl/onlinelog/group_2.265.889785657
         1 +MYSHARE/orcl/onlinelog/group_1.262.889785645
         1 +MYSHARE/orcl/onlinelog/group_1.263.889785649
         3 +MYSHARE/orcl/onlinelog/group_3.268.889786003
         3 +MYSHARE/orcl/onlinelog/group_3.269.889786005
         4 +MYSHARE/orcl/onlinelog/group_4.270.889786009
         4 +MYSHARE/orcl/onlinelog/group_4.271.889786013
--2.每个实例有2组日志文件,先增加再删除,每个实例确保有两组日志文件
--首先执行一次完全检查点,确保日志已经提交
SQL> alter system checkpoint;

System altered.
--其次每个实例增加两个100m日志组,每组两个日志文件
SQL> select l.GROUP#,l.THREAD#,l.ARCHIVED,l.STATUS from v$log l;

    GROUP#    THREAD# ARC STATUS
---------- ---------- --- ----------------
         1          1 NO  CURRENT
         2          1 YES INACTIVE
         3          2 YES INACTIVE
         4          2 NO  CURRENT
--增加,ASM自动管理
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 5 ('+MYSHARE', '+MYSHARE') SIZE 100M;
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 6 ('+MYSHARE', '+MYSHARE') SIZE 100M;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 7 ('+MYSHARE', '+MYSHARE') SIZE 100M;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 8 ('+MYSHARE', '+MYSHARE') SIZE 100M;
--删除
ALTER DATABASE DROP LOGFILE  GROUP 1;
ALTER DATABASE DROP LOGFILE  GROUP 2;
ALTER DATABASE DROP LOGFILE  GROUP 3;
ALTER DATABASE DROP LOGFILE  GROUP 4;
--增加
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 1 ('+MYSHARE', '+MYSHARE') SIZE 100M;
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 2 ('+MYSHARE', '+MYSHARE') SIZE 100M;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 3 ('+MYSHARE', '+MYSHARE') SIZE 100M;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 4 ('+MYSHARE', '+MYSHARE') SIZE 100M;
--验证
SQL> SELECT   v$logfile.group#, v$log.status,v$log.ARCHIVED, v$log.bytes/1024/1024 ,v$log.thread# FROM v$log, v$logfile WHERE v$log.group# = v$logfile.group# group by v$logfile.group#, v$log.status,v$log.ARCHIVED, v$log.bytes/1024 /1024 ,v$log.thread#;

    GROUP# STATUS           ARC V$LOG.BYTES/ 1024/1024     THREAD#
---------- ---------------- --- --------------------- ----------
         1 UNUSED            YES                   100          1
         8 INACTIVE         YES                   100          2
         2 UNUSED            YES                   100          1
         4 UNUSED            YES                   100          2
         7 ACTIVE           YES                   100          2
         3 CURRENT           NO                    100          2
         5 CURRENT           NO                    100          1
         6 INACTIVE         YES                   100          1


  


 
 


你可能感兴趣的:(RAC,日志文件修改)