redo日志多元化

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了redo日志多元化相关的知识,希望对你有一定的参考价值。

添加redo日志组和添加日志组多元化

 

  1. 查看redo日志组的状态和日志的位置.

SQL>select * from v$log;

 

    GROUP#   THREAD#  SEQUENCE#      BYTES BLOCKSIZE          MEMBERS ARCSTATUS               FIRST_CHANGE# FIRST_TIME   NEXT_CHANGE# NEXT_TIME

-------------------- ---------- ---------- ---------- ---------- --- ----------------------------- ------------ ------------ ------------

 1           1              58  52428800          512                1NO CURRENT                     116662724-JAN-16            2.8147E+14

 2           1              56  52428800          512                1YES INACTIVE                     113719619-JAN-16               1166195 24-JAN-16

 3           1              57  52428800          512                1YES INACTIVE                     116619524-JAN-16               1166627 24-JAN-16

 

 

SQL>select * from v$logfile;

 

    GROUP# STATUS  TYPE   MEMBER                                              IS_

----------------- ------- -------------------------------------------------- ---

 3           ONLINE /u01/app/oracle/oradata/orcl/redo03.log              NO

 2           ONLINE /u01/app/oracle/oradata/orcl/redo02.log              NO

 1           ONLINE /u01/app/oracle/oradata/orcl/redo01.log              NO

 4           STANDBY/u01/app/oracle/oradata/orcl/standby/slog1.rdo     NO

 5           STANDBY/u01/app/oracle/oradata/orcl/standby/slog2.rdo     NO

 6           STANDBY/u01/app/oracle/oradata/orcl/standby/slog3.rdo     NO

 7           STANDBY/u01/app/oracle/oradata/orcl/standby/slog4.rod     NO

 

  1. 建立系统要存放日志组的路径.

mkdir -p /u01/app/oracle/redo

chmod -R 755 /u01/app/oracle/redo

3.建立redo日志组8

SQL> alter database add logfile group 8(‘/u01/app/oracle/redo/redo04.log‘)size 50m;

 

Database altered.

 

 

 

  1. 给每个redo日志组建立多元化.

 

SQL> alter database add logfile member‘/u01/app/oracle/oradata/orcl/redo011.log‘ to group 1;

SQL> alter database add logfile member‘/u01/app/oracle/oradata/orcl/redo022.log‘ to group 2;

SQL> alter database add logfile member‘/u01/app/oracle/oradata/orcl/redo033.log‘ to group 3;

 

  1. 查看redo的状态,组合4没有被使用,所以切几次日志,组合4已生效.

 

SQL> select * from v$log;

 

    GROUP#    THREAD# SEQUENCE#      BYTES  BLOCKSIZE          MEMBERS ARCSTATUS               FIRST_CHANGE# FIRST_TIME   NEXT_CHANGE# NEXT_TIME

---------- ---------- ---------- ---------- ---------- ------------- ---------------- ------------- ------------ ------------ ------------

 1           1              62  52428800          512                2NO CURRENT                     117665425-JAN-16            2.8147E+14

 2           1              60  52428800          512                2YES INACTIVE                     117661925-JAN-16               1176640 25-JAN-16

 3           1              61  52428800          512                2YES INACTIVE                     117664025-JAN-16               1176654 25-JAN-16

 8           1              59  52428800          512                1YES INACTIVE                     117659925-JAN-16               1176619 25-JAN-16

 

 

SQL> alter system switch logfile;

 

System altered.

 

SQL> select * from v$logfile;

 

    GROUP# STATUS  TYPE   MEMBER                                              IS_

---------- ------- --------------------------------------------------------- ---

 3           ONLINE /u01/app/oracle/oradata/orcl/redo03.log              NO

 2           ONLINE /u01/app/oracle/oradata/orcl/redo02.log              NO

 1           ONLINE /u01/app/oracle/oradata/orcl/redo01.log              NO

 4           STANDBY/u01/app/oracle/oradata/orcl/standby/slog1.rdo     NO

 5           STANDBY/u01/app/oracle/oradata/orcl/standby/slog2.rdo     NO

 6           STANDBY/u01/app/oracle/oradata/orcl/standby/slog3.rdo     NO

 7           STANDBY/u01/app/oracle/oradata/orcl/standby/slog4.rod     NO

 8           ONLINE /u01/app/oracle/redo/redo04.log                      NO

 1 INVALID ONLINE /u01/app/oracle/oradata/orcl/redo011.log              NO

 2           ONLINE /u01/app/oracle/oradata/orcl/redo022.log              NO

 3           ONLINE /u01/app/oracle/oradata/orcl/redo033.log              NO

SQL> alter system switch logfile;

 

System altered.

SQL> alter system switch logfile;

 

System altered.

 

SQL> /

 

System altered.

 

SQL> /

 

System altered.

 

 

  1. 查看redo日志组的多元化.

 

SQL> select * from v$logfile;

 

    GROUP# STATUS  TYPE   MEMBER                                              IS_

---------- ------- --------------------------------------------------------- ---

 3           ONLINE /u01/app/oracle/oradata/orcl/redo03.log              NO

 2           ONLINE /u01/app/oracle/oradata/orcl/redo02.log              NO

 1           ONLINE /u01/app/oracle/oradata/orcl/redo01.log              NO

 4           STANDBY/u01/app/oracle/oradata/orcl/standby/slog1.rdo     NO

 5           STANDBY/u01/app/oracle/oradata/orcl/standby/slog2.rdo     NO

 6           STANDBY/u01/app/oracle/oradata/orcl/standby/slog3.rdo     NO

 7           STANDBY/u01/app/oracle/oradata/orcl/standby/slog4.rod     NO

 8           ONLINE /u01/app/oracle/redo/redo04.log                      NO

 1           ONLINE /u01/app/oracle/oradata/orcl/redo011.log              NO

 2           ONLINE /u01/app/oracle/oradata/orcl/redo022.log              NO

 3           ONLINE /u01/app/oracle/oradata/orcl/redo033.log              NO


以上是关于redo日志多元化的主要内容,如果未能解决你的问题,请参考以下文章

mysql刷redo由啥线程完成

linux内核驱动调试日志

ORACLE中,数据库的redo与undo分别是啥呀,两者是啥关系呢?

SnapAssure备份实施运维最佳实践_redo日志篇

redo日志

python基础学习日志day10-