Oracle 10g下ocr和votedisk的管理(2)

10g下怎么增加或者删除ocr磁盘?

在10g中,如果在安装cluster时,如果选择external redundancy那么ocr只能选择一个磁盘,但是通过命令行我们依然可以添加新的磁盘到ocr。如果我们需要替换现有的ocr磁盘,那么必须同时存在两份ocr磁盘才可以,即primary ocr和mirror ocr同时存在时,才可以替换primary ocr或者mirror ocr。

操作实例:

[root@node1 bin]# ocrcheck
Status of Oracle Cluster Registry is as follows :
  Version                  :          2
  Total space (kbytes)    :    1125736
  Used space (kbytes)      :      3852
  Available space (kbytes) :    1121884
  ID                      :  849560479
  Device/File Name        : /dev/raw/raw1
                                    Device/File integrity check succeeded

Device/File not configured

Cluster registry integrity check succeeded

[root@node1 bin]# ocrconfig -replace ocr /dev/raw/raw3
PROT-16: Internal Error
[root@node1 bin]# ocrconfig -replace ocrmirror /dev/raw/raw4
[root@node1 bin]# ocrcheck
Status of Oracle Cluster Registry is as follows :
  Version                  :          2
  Total space (kbytes)    :    1125736
  Used space (kbytes)      :      3852
  Available space (kbytes) :    1121884
  ID                      :  849560479
  Device/File Name        : /dev/raw/raw1
                                    Device/File integrity check succeeded
  Device/File Name        : /dev/raw/raw4
                                    Device/File integrity check succeeded

Cluster registry integrity check succeeded

[root@node1 bin]# ocrconfig -replace ocr /dev/raw/raw3
[root@node1 bin]# ocrcheck
Status of Oracle Cluster Registry is as follows :
  Version                  :          2
  Total space (kbytes)    :    1125736
  Used space (kbytes)      :      3852
  Available space (kbytes) :    1121884
  ID                      :  849560479
  Device/File Name        : /dev/raw/raw3
                                    Device/File integrity check succeeded
  Device/File Name        : /dev/raw/raw4
                                    Device/File integrity check succeeded

Cluster registry integrity check succeeded

[root@node1 bin]# crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/ocrcheck
Warning: Permanently added the RSA host key for IP address '192.168.100.32' to the list of known hosts.
root@node2's password:
Status of Oracle Cluster Registry is as follows :
  Version                  :          2
  Total space (kbytes)    :    1125736
  Used space (kbytes)      :      3852
  Available space (kbytes) :    1121884
  ID                      :  849560479
  Device/File Name        : /dev/raw/raw3
                                    Device/File integrity check succeeded
  Device/File Name        : /dev/raw/raw4
                                    Device/File integrity check succeeded

Cluster registry integrity check succeeded

[root@node1 bin]# ssh node2 cat /etc/oracle/ocr.loc
root@node2's password:
#Device/file /dev/raw/raw1 getting replaced by device /dev/raw/raw3
ocrconfig_loc=/dev/raw/raw3
ocrmirrorconfig_loc=/dev/raw/raw4
local_only=false

新增或者删除orc最好在所有节点都在线时进行,否则会出现节点信息不同步的情况,

例如:如果在节点node2关闭时,在节点node1进行ocr删除操作,结果如下

[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/crsctl stop crs
root@node2's password:
Permission denied, please try again.
root@node2's password:
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/crsctl check crs
root@node2's password:
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM
[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
  Version                  :          2
  Total space (kbytes)    :    1125736
  Used space (kbytes)      :      3852
  Available space (kbytes) :    1121884
  ID                      :  849560479
  Device/File Name        : /dev/raw/raw3
                                    Device/File integrity check succeeded
  Device/File Name        : /dev/raw/raw4
                                    Device/File integrity check succeeded

Cluster registry integrity check succeeded

[root@node1 bin]# ./ocrconfig -replace ocrmirror
[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
  Version                  :          2
  Total space (kbytes)    :    1125736
  Used space (kbytes)      :      3852
  Available space (kbytes) :    1121884
  ID                      :  849560479
  Device/File Name        : /dev/raw/raw3
                                    Device/File integrity check succeeded

Device/File not configured

Cluster registry integrity check succeeded

[root@node1 bin]# cat /etc/oracle/ocr.loc
#Device/file /dev/raw/raw4 being deleted
ocrconfig_loc=/dev/raw/raw3
local_only=false[root@node1 bin]# ssh node2 cat /etc/oracle/ocr.loc
root@node2's password:
Permission denied, please try again.
root@node2's password:
#Device/file /dev/raw/raw1 getting replaced by device /dev/raw/raw3
ocrconfig_loc=/dev/raw/raw3
ocrmirrorconfig_loc=/dev/raw/raw4
local_only=false[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/crsctl start crs
root@node2's password:
Attempting to start CRS stack
The CRS stack will be started shortly
[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/crsctl check crs
root@node2's password:
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM
[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/ocrconfig -repair ocrmirror
root@node2's password:
[root@node1 bin]# ssh node2 cat /etc/oracle/ocr.loc
root@node2's password:
#Device/file /dev/raw/raw4 being deleted
ocrconfig_loc=/dev/raw/raw3
local_only=false[r
[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/crsctl start crs
root@node2's password:
Attempting to start CRS stack
The CRS stack will be started shortly
[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/crsctl check crs
root@node2's password:
CSS appears healthy
CRS appears healthy
EVM appears healthy

结论:在增加、删除、替换ocr时,所有节点最好同时在线,在导入导出或者恢复ocr是,cluster节点需要关闭
如何添加/删除votedisk?

添加删除votedisk可以使用crsctl命令:

[root@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 log crs [module:level]{,module:level} ...
                            - Turns on debugging for CRS
      crsctl debug log evm [module:level]{,module:level} ...
                            - Turns on debugging for EVM
      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

首先在线添加:

[root@node1 bin]# ./crsctl add css votedisk /dev/raw/raw4
Cluster is not in a ready state for online disk addition
[root@node1 bin]# ./crsctl add css votedisk /dev/raw/raw4 -force
Now formatting voting disk: /dev/raw/raw4
successful addition of votedisk /dev/raw/raw4.
[root@node1 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@node1 bin]# ./crsctl query css votedisk
 0.    0    /dev/raw/raw2
 1.    0    /dev/raw/raw4

located 2 votedisk(s).
[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/crsctl query css votedisk
root@node2's password:
 0.    0    /dev/raw/raw2
 1.    0    /dev/raw/raw4

located 2 votedisk(s).
[root@node1 bin]# ./crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/crsctl stop crs
root@node2's password:
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@node1 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/crsctl start crs
root@node2's password:
Attempting to start CRS stack
The CRS stack will be started shortly         
[root@node1 bin]# ./crs_stat -t -v
Name          Type          R/RA  F/FT  Target    State    Host       
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    ONLINE    ONLINE    node1     
ora....E1.lsnr application    0/5    0/0    ONLINE    ONLINE    node1     
ora.node1.gsd  application    0/5    0/0    ONLINE    ONLINE    node1     
ora.node1.ons  application    0/3    0/0    ONLINE    ONLINE    node1     
ora.node1.vip  application    0/0    0/0    ONLINE    ONLINE    node1     
ora....SM2.asm application    0/5    0/0    ONLINE    ONLINE    node2     
ora....E2.lsnr application    0/5    0/0    ONLINE    ONLINE    node2     
ora.node2.gsd  application    0/5    0/0    ONLINE    ONLINE    node2     
ora.node2.ons  application    0/3    0/0    ONLINE    ONLINE    node2     
ora.node2.vip  application    0/0    0/0    ONLINE    ONLINE    node2     
ora.racdb.db  application    0/1    0/1    ONLINE    ONLINE    node1     
ora....b1.inst application    0/5    0/0    ONLINE    OFFLINE             
ora....b2.inst application    0/5    0/0    ONLINE    ONLINE    node2 

删除操作不再演示


看来在线添加votedisk是可以成功的,在10g下需要使用 -force选项,但是网上有资料表示:在添加或者删除votedisk时,最好停掉所有应用。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/95136e712b43aec38cbb9885e7884912.html