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

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

创新互联专注于企业成都全网营销、网站重做改版、南昌网站定制设计、自适应品牌网站建设、成都h5网站建设商城网站建设、集团公司官网建设、成都外贸网站建设、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为南昌等各大城市提供网站开发制作服务。

 

SQL> select * from v$log;

 

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

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

 1           1              10  52428800          512                1YES INACTIVE               102400224-NOV-15         1026535 24-NOV-15

 2           1              11  52428800          512                1YES ACTIVE               102653524-NOV-15         1039876 27-NOV-15

 3           1              12  52428800          512                1NO CURRENT               1039876 27-NOV-15      2.8147E+14

 

SQL> col memberfor a50

SQL> select * from v$logfile;

 

    GROUP# STATUS  TYPE   MEMBER                                    IS_

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

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

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

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

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

SQL> !mkdir -p/u01/apps/oracle/oradata/orcl/redo

SQL> alter database add logfile group4('/u01/apps/oracle/oradata/orcl/redo/redo04.log') size 50M;

Database altered.

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

SQL> alter database add logfilemember '/u01/apps/oracle/oradata/orcl/redo/redo011.log' to group 1;

 

Databasealtered.

 

SQL> alter database add logfilemember '/u01/apps/oracle/oradata/orcl/redo/redo022.log' to group 2;

 

Databasealtered.

 

SQL> alter database add logfilemember '/u01/apps/oracle/oradata/orcl/redo/redo033.log' to group 3;

 

Databasealtered.

 

SQL> alter database add logfilemember '/u01/apps/oracle/oradata/orcl/redo/redo044.log' to group4;

 

Databasealtered.

 

查看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              10  52428800          512                2YES INACTIVE                     102400224-NOV-15               1026535 24-NOV-15

 2           1              11  52428800          512                2YES INACTIVE                     102653524-NOV-15               1039876 27-NOV-15

 3           1              12  52428800          512                2NO CURRENT                     103987627-NOV-15            2.8147E+14

 4           1               0  52428800          512                2YES UNUSED                          0                             0

SQL>select * fromv$logfile;

 

    GROUP# STATUS  TYPE   MEMBER                                              IS_

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

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

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

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

 4           ONLINE /u01/apps/oracle/oradata/orcl/redo/redo04.log      NO

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

 2 INVALID ONLINE /u01/apps/oracle/oradata/orcl/redo/redo022.log     NO

 3 INVALID ONLINE /u01/apps/oracle/oradata/orcl/redo/redo033.log     NO

 4 INVALID ONLINE /u01/apps/oracle/oradata/orcl/redo/redo044.log     NO

 

SQL>alter systemswitch logfile;

Systemaltered.

 

SQL>/

Systemaltered.

 

SQL>/

Systemaltered.

 

SQL>/

Systemaltered.

 

查看日志组多元化

SQL>select * fromv$log;

 

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

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

 1           1              14  52428800          512                2YES INACTIVE                     104102627-NOV-15               1041029 27-NOV-15

 2           1              15  52428800          512                2YES INACTIVE                     104102927-NOV-15               1041037 27-NOV-15

 3           1              16  52428800          512                2NO CURRENT                     104103727-NOV-15            2.8147E+14

 4           1              13  52428800          512                2YES INACTIVE                     104100727-NOV-15               1041026 27-NOV-15

SQL>select * fromv$logfile;

 

    GROUP# STATUS  TYPE   MEMBER                                              IS_

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

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

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

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

 4           ONLINE /u01/apps/oracle/oradata/orcl/redo/redo04.log      NO

 1           ONLINE /u01/apps/oracle/oradata/orcl/redo/redo011.log     NO

 2           ONLINE /u01/apps/oracle/oradata/orcl/redo/redo022.log     NO

 3           ONLINE /u01/apps/oracle/oradata/orcl/redo/redo033.log     NO

 4           ONLINE /u01/apps/oracle/oradata/orcl/redo/redo044.log     NO

 


当前标题:添加redo日志组和添加日志组多元化
网址分享:http://myzitong.com/article/jpdihc.html