zoukankan      html  css  js  c++  java
  • Oracle Clusterware工具2

    集群层

      这一层的管理命令包括crsctl、ocrcheck、ocrdump、ocrconfig,其中后3个命令是针对OCR磁盘的。

    CRSCTL:

      crsctl是一个命令行工具,用于管理Oracle Clusterware daemons(何谓daemon,又名守护进程、后台进程,名称以字母d结尾)。这些daemon包括Cluster Synchronization Services (CSS), Cluster-Ready Services (CRS), and Event Manager (EVM)。

    查看crsctl的help:

    [oracle@node1 bin]$ ./crsctl
    Usage: crsctl check  crs          - checks the viability of the CRS stack
           crsctl check  cssd         - checks the viability of CSS
           crsctl check  crsd         - checks the viability of CRS
           crsctl check  evmd         - checks the viability of EVM
           crsctl set    css <parameter> <value> - sets a parameter override
           crsctl get    css <parameter> - gets the value of a CSS parameter
           crsctl unset  css <parameter> - sets CSS parameter to its default
           crsctl query  css votedisk    - lists the voting disks used by CSS
           crsctl add    css votedisk <path> - adds a new voting disk
           crsctl delete css votedisk <path> - removes a voting disk
           crsctl enable  crs    - enables startup for all CRS daemons
           crsctl disable crs    - disables startup for all CRS daemons
           crsctl start crs  - starts all CRS daemons.
           crsctl stop  crs  - stops all CRS daemons. Stops CRS resources in case of cluster.
           crsctl start resources  - starts CRS resources. 
           crsctl stop resources  - stops  CRS resources. 
           crsctl debug statedump evm  - dumps state info for evm objects
           crsctl debug statedump crs  - dumps state info for crs objects
           crsctl debug statedump css  - dumps state info for css objects
           crsctl debug log css [module:level]{,module:level} ... 
                                 - Turns on debugging for CSS 
           crsctl debug trace css - dumps CSS in-memory tracing cache
           crsctl debug log crs [module:level]{,module:level} ... 
                                 - Turns on debugging for CRS 
           crsctl debug trace crs - dumps CRS in-memory tracing cache
           crsctl debug log evm [module:level]{,module:level} ... 
                                 - Turns on debugging for EVM
           crsctl debug trace evm - dumps EVM in-memory tracing cache
           crsctl debug log res <resname:level> turns on debugging for resources
           crsctl query crs softwareversion [<nodename>] - lists the version of CRS software installed
           crsctl query crs activeversion - lists the CRS software operating version
           crsctl lsmodules css - lists the CSS modules that can be used for debugging
           crsctl lsmodules crs - lists the CRS modules that can be used for debugging
           crsctl lsmodules evm - lists the EVM modules that can be used for debugging
    
     If necesary any of these commands can be run with additional tracing by
     adding a "trace" argument at the very front.
     Example: crsctl trace check css

    使用示例:

    检查crs状态
    [oracle@node1 bin]$ ./crsctl check  crs
    CSS appears healthy
    CRS appears healthy
    EVM appears healthy
    
    检查单个状态 
    [oracle@node1 bin]$ ./crsctl check  cssd
    CSS appears healthy
    [oracle@node1 bin]$ ./crsctl check  crsd
    CRS appears healthy
    [oracle@node1 bin]$ ./crsctl check  evmd
    EVM appears healthy
    
    启动crs栈,必须使用root用户
    # ./crsctl start crs
    Attempting to start CRS stack 
    The CRS stack will be started shortly 
    
    停止crs栈,必须使用root用户:
    # ./crsctl stop crs 
    Stopping resources. 
    Successfully stopped CRS resources 
    Stopping CSSD. 
    Shutting down CSS daemon. 
    Shutdown request successfully issued.
    
    配置crs进程栈是否随着操作系统的启动而自启动,有时出于维护目的需要关闭这个特性,可以用root用户执行下面命令。 
    # ./crsctl disable crs 
    # ./crsctl enable crs 
    这个命令实际是修改了/etc/oracle/scls_scr/node1/root/crsstart这个文件里的内容。
    
    查看votedisk磁盘位置:
    [oracle@node1 bin]$ ./crsctl query css votedisk
     0.     0    /dev/raw/raw2
    
    located 1 votedisk(s).
    [oracle@node1 bin]$ 

    以下两个测试具有一定的破坏力,没有测试 (*^__^*)

    --增加votedisk:
    --# ./crsctl add css votedisk /dev/raw/raw3 -force
    --Now formatting voting disk: /dev/raw/raw3
    --successful addition of votedisk /dev/raw/raw3.
     
    --删除votedisk:
    --# ./crsctl delete css votedisk /dev/raw/raw4 -force
    --successful deletion of votedisk /dev/raw/raw4.
    查看crs参数
    [oracle@node1 bin]$ ./crsctl get css misscount
    60
    [oracle@node1 bin]$ 
    
    修改crs参数,必须为root用户
    # ./crsctl set css miscount 60

      CRS由CRS,CSS,EVM三个服务组成,每个服务又是由一系列module组成,crsctl允许对每个module进行跟踪,并把跟踪内容记录到日志中。

    查看3个服务各自的模块列表分别如下:

    [oracle@node1 bin]$ crsctl lsmodules css
    The following are the CSS modules :: 
        CSSD
        COMMCRS
        COMMNS
    [oracle@node1 bin]$ crsctl lsmodules evm
    The following are the EVM modules :: 
       EVMD
       EVMDMAIN
       EVMCOMM
       EVMEVT
       EVMAPP
       EVMAGENT
       CRSOCR
       CLUCLS
       CSSCLNT
       COMMCRS
       COMMNS
    [oracle@node1 bin]$ crsctl lsmodules crs
    The following are the CRS modules :: 
        CRSUI
        CRSCOMM
        CRSRTI
        CRSMAIN
        CRSPLACE
        CRSAPP
        CRSRES
        CRSCOMM
        CRSOCR
        CRSTIMER
        CRSEVT
        CRSD
        CLUCLS
        CSSCLNT
        COMMCRS
        COMMNS
    [oracle@node1 bin]$ 

    跟踪CSSD模块,需要root用户执行: 

    # ./crsctl debug log css "CSSD:1"
    Configuration parameter trace is now set to 1.
    Set CRSD Debug Module: CSSD  Level: 1

    查看跟踪日志:

    查看跟踪日志 
    # pwd 
    /opt/ora10g/product/10.2.0/crs_1/log/node1/cssd
    
    [oracle@node1 cssd]$ tail -200 ocssd.log|more
    [    CSSD]2013-06-14 22:00:32.520 [86608784] >TRACE:   clssgmClientConnectMsg: Connect from con(0x92eb648) proc(0x92ebb80) pid() proto(10:2:1:1)
    [    CSSD]2013-06-14 22:00:43.422 [86608784] >TRACE:   clssgmClientConnectMsg: Connect from con(0x92eecb8) proc(0x92f0960) pid() proto(10:2:1:1)
    [    CSSD]2013-06-14 22:00:48.849 [86608784] >TRACE:   clssgmClientConnectMsg: Connect from con(0x92f15d0) proc(0x92f3278) pid() proto(10:2:1:1)
    [    CSSD]2013-06-14 22:00:51.508 [86608784] >TRACE:   clssgmClientConnectMsg: Connect from con(0x92c6af8) proc(0x92ea288) pid() proto(10:2:1:1)
    [    CSSD]2013-06-14 22:01:05.039 [86608784] >TRACE:   clssgmClientConnectMsg: Connect from con(0x92c6a70) proc(0x92eb1f8) pid() proto(10:2:1:1)

    -- 整理自《大话 oracle rac》

  • 相关阅读:
    BZOJ2784: [JLOI2012]时间流逝
    JZOJ 5190. 景中人 (找性质+dp+记忆化实现)
    [NOI2013] 向量内积(随机好题)
    【NOI2014】购票(斜率优化dp+树链剖分)
    「NOI2016」国王饮水记(猜结论+动态规划+斜率优化)
    「NOI2016」网格(猜结论+tarjan找桥点+乱搞)
    Codeforces 1270 H. Number of Components(找性质+线段树)
    Codeforces 1276D. Tree Elimination(树形dp)
    Codeforces 1158 F. Density of subarrays(找性质+分段dp)
    Codeforces 960G Bandit Blues (快速求第一类斯特林数)
  • 原文地址:https://www.cnblogs.com/polestar/p/3136161.html
Copyright © 2011-2022 走看看