修改redo_logfile组成员和大小


1.SYS@ORCL>select GROUP#  ,BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log;

铁西网站制作公司哪家好,找创新互联!从网页设计、网站建设、微信开发、APP开发、自适应网站建设等网站项目制作,到程序开发,运营维护。创新互联于2013年开始到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联。

    GROUP#    SIZE_M STATUS          ARC                                     
 ---------- ---------- ---------------- ---                                     
          1        50 INACTIVE        YES                                     
          2        50 INACTIVE        YES                                     
          3        50 CURRENT          NO          

 

2.删除原有的日志组;(只操作状态为inactive的日志组)
  若要操作日志组为current时,需先进行日志切换:alter system switch logfile;
  若为active时,则可强制进行检查点:alter system checkpoint;

SYS@ORCL>alter system switch logfile;

System altered.

SYS@ORCL>alter system checkpoint; --强制执行检查点

SYS@ORCL>select GROUP#  ,BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log;

    GROUP#    SIZE_M STATUS          ARC                                     
 ---------- ---------- ---------------- ---                                     
          1        50 INACTIVE        YES                                     
          2        50 INACTIVE        YES                                     
          3        50 ACTIVE          YES    

SYS@ORCL>alter database drop logfile group 1;

Database altered.

SYS@ORCL>alter database drop logfile group 2;

Database altered.
                                

---------------------------
删除后还需要去指定目录删除日志文件,后才能建立文件,如制定别的名字的日志组,应该没有此限制。
---------------------------


3.添加3组大小为200M的日志组;
SYS@ORCL>alter database add logfile group 1 '/u01/app/oracle/oradata/orcl11g/redo01.log'size 200m;

Database altered.

SYS@ORCL>alter database add logfile group 2 '/u01/app/oracle/oradata/orcl11g/redo02.log'size 200m;

Database altered.

SYS@ORCL>alter database add logfile group 3 '/u01/app/oracle/oradata/orcl11g/redo03.log'size 200m;

4.给日志组添加成员
cd  /u01/app/oracle/oradata/orcl11g/
mkdir redo_bak

SYS@ORCL>alter database add logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo01_b.log' to group 1;
Database altered.
SYS@ORCL>alter database add logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo02_b.log' to group 2;
Database altered.
SYS@ORCL>alter database add logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo03_b.log' to group 3;
Database altered.


5.删除日志组成员

alter database drop logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo02_b.log';

            
            
                            
文章名称:修改redo_logfile组成员和大小
分享路径:http://azwzsj.com/article/ppceop.html