添加日志组的成员(一组添加一个成员)

添加日志组的成员(一组添加一个成员)
--查询
SYS@PROD> col member for a50
SYS@PROD> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                    IS_     CON_ID
---------- ------- ------- ---------------------------------------- --- ----------
     3       ONLINE  /u01/app/oracle/oradata/PROD/redo03.log  NO         0
     2       ONLINE  /u01/app/oracle/oradata/PROD/redo02.log  NO         0
     1       ONLINE  /u01/app/oracle/oradata/PROD/redo01.log  NO         0
     4       ONLINE  /u01/app/oracle/oradata/PROD/redo04.log  NO         0
--增加日志组成员
SYS@PROD> alter database add logfile member 
  1  '/u01/app/oracle/oradata/PROD/redo0101.log' to group 1,
  2  '/u01/app/oracle/oradata/PROD/redo0201.log' to group 2,
  3  '/u01/app/oracle/oradata/PROD/redo0301.log' to group 3,
  4  '/u01/app/oracle/oradata/PROD/redo0401.log' to group 4;
--验证
SYS@PROD> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                          IS_     CON_ID
---------- ------- ------- -------------------------------------------------- --- ----------
     3       ONLINE  /u01/app/oracle/oradata/PROD/redo03.log          NO       0
     2       ONLINE  /u01/app/oracle/oradata/PROD/redo02.log          NO       0
     1       ONLINE  /u01/app/oracle/oradata/PROD/redo01.log          NO       0
     4       ONLINE  /u01/app/oracle/oradata/PROD/redo04.log          NO       0
     1 INVALID ONLINE  /u01/app/oracle/oradata/PROD/redo0101.log          NO       0
     2 INVALID ONLINE  /u01/app/oracle/oradata/PROD/redo0201.log          NO       0
     3 INVALID ONLINE  /u01/app/oracle/oradata/PROD/redo0301.log          NO       0
     4 INVALID ONLINE  /u01/app/oracle/oradata/PROD/redo0401.log          NO       0
说明: STATUS 是 INVALID,说明 member 还没有同步好。
--切日志同步
SYS@PROD> alter system switch logfile;

System altered.

SYS@PROD> /

System altered.

SYS@PROD> /

System altered.

SYS@PROD> /

System altered.

SYS@PROD> /

System altered.
--验证
SYS@PROD> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                          IS_     CON_ID
---------- ------- ------- -------------------------------------------------- --- ----------
     3       ONLINE  /u01/app/oracle/oradata/PROD/redo03.log          NO       0
     2       ONLINE  /u01/app/oracle/oradata/PROD/redo02.log          NO       0
     1       ONLINE  /u01/app/oracle/oradata/PROD/redo01.log          NO       0
     4       ONLINE  /u01/app/oracle/oradata/PROD/redo04.log          NO       0
     1       ONLINE  /u01/app/oracle/oradata/PROD/redo0101.log          NO       0
     2       ONLINE  /u01/app/oracle/oradata/PROD/redo0201.log          NO       0
     3       ONLINE  /u01/app/oracle/oradata/PROD/redo0301.log          NO       0
     4       ONLINE  /u01/app/oracle/oradata/PROD/redo0401.log          NO       0

你可能感兴趣的:(oracle,oracle)