> 데이터 베이스 > MySQL 튜토리얼 > 【ORACLE RAC】日志组管理

【ORACLE RAC】日志组管理

WBOY
풀어 주다: 2016-06-07 15:07:15
원래의
1363명이 탐색했습니다.

************************************************************************ ****原文: blog.csdn.net/clark_xu 徐长亮的专栏 ************************************************************************ rac需要至少需要四个日志组,分配到每个线程上各

************************************************************************ ****原文:blog.csdn.net/clark_xu  徐长亮的专栏 ************************************************************************

rac需要至少需要四个日志组,分配到每个线程上各两组,两个线程的日志组不共享。

一、查看各个节点的线程分配:

节点一

SQL> show parameters thread

NAME                                 TYPE        VALUE

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

parallel_threads_per_cpu             integer     2

thread                               integer     1

节点2

SQL> show parameters thread

NAME                                 TYPE        VALUE

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

parallel_threads_per_cpu             integer     2

thread                               integer     2

 二、查看默认组对应的线程

SQL> select group#,thread#,members from v$log;

  GROUP#    THREAD#    MEMBERS

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

        1          1          2

        2          1          2

        3          2          2

        4          2          2

三、常见的日志组规划:每个线程6组,每个组的两个成员放在不同的位置

 

                                                                                                                                                                                                       
redo 日志组线程成员位置大小
Group  1thread 1member 1+DGDATA1GB 
member 2+DGFRA1GB 
Group  2thread 1member 1+DGDATA1GB 
member 2+DGFRA1GB 
Group  3thread 2member 1+DGDATA1GB
member 2+DGFRA1GB
Group  4thread 2member 1+DGDATA1GB
member 2+DGFRA1GB
Group  5thread 1member 1+DGDATA1GB
member 2+DGFRA1GB
Group  6thread 1member 1+DGDATA1GB
member 2+DGFRA1GB
Group  7thread 1member 1+DGDATA1GB
member 2+DGFRA1GB
Group  8thread 1member 1+DGDATA1GB
member 2+DGFRA1GB
Group  9thread 2member 1+DGDATA1GB
member 2+DGFRA1GB
Group 10thread 2member 1+DGDATA1GB
member 2+DGFRA1GB
Group  11thread 2member 1+DGDATA1GB
member 2+DGFRA1GB
Group  12thread 2member 1+DGDATA1GB
member 2+DGFRA1GB

 

四、添加日志组

SQL> ALTER DATABASE ADD LOGFILE THREAD 1GROUP 5 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 1GROUP 6 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 1GROUP 7 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 1GROUP 8 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 2GROUP 9 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 2GROUP 10 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 2GROUP 11 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 2GROUP 12 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

五、修改当前日志组,为了能删除默认的四个日志组

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

Systemaltered.

SQL> alter system checkpoint;

System altered.

六、删除和新建日志组

SQL> alter database drop logfile group1;

 Database altered.

SQL> alter database drop logfile group 3;

 Database altered.

SQL> alter database drop logfile group 2;

 Database altered.

SQL> alter database drop logfile group 4;

 Database altered.

七、添加日志组

SQL> ALTER DATABASE ADD LOGFILE THREAD 1GROUP 1 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 1GROUP 2 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 2GROUP 3 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 2GROUP 4 ('+DGDATA','+DGFRA') SIZE 1024M;

Database altered.

八、查看,确认

SQL> select group#,thread#,members fromv$log;

   GROUP#    THREAD#    MEMBERS

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

        1          1          2

        2          1          2

        3          2          2

        4          2          2

        5          1          2

        6          1          2

        7          1          2

        8          1          2

        9          2          2

       10          2          2

       11          2          2

   GROUP#    THREAD#    MEMBERS

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

       12          2          2

12 rows selected

 

 

 

 

 

 

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿