温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

修改redo_logfile组成员和大小

发布时间:2020-08-04 17:01:52 来源:网络 阅读:371 作者:viking714 栏目:关系型数据库


1.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 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';

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI