Welcome 微信登录

首页 / 数据库 / MySQL / Oracle 10g下ocr和votedisk的管理

ocr和votedisk是什么?作为集群,Oracle cluster需要共享存储来存放整个集群的配置信息,ocr便是用例存放这些配置信息的地方,ocr的存储容量一般不会太大,在10g下,oracle建议256M已经足以。ocr必须需要存储在集群文件系统或者裸设备上,出于性能上的考虑,本人建议将ocr建立在裸设备上,性能高并且管理也不复杂(ocr和votedisk的数量一般不会太多)。ocr中存放的是集群的配置信息,这些信息只能在一个节点上进行维护操作,这一节点叫做Master Node,其他节点会在内存中保留一份ocr的复制,并且只能进行读操作,所有ocr的更新都是有master node来执行并通知各个节点的。votedisk磁盘存储集中地各个节点并用来进行心跳监测 ocr和votedisk的维护是否需要保持脱机状态?orc的维护在大多数情况下,是需要联机操作的,因为在各个节点具有ocr.loc文件,联机操作可以保证各个节点的ocr.loc文件及时得到更新。但是部分操作,如repaire和重建等操作需要在脱机状态下进行(后面会详细描述)votedisk磁盘的维护往往需要在脱机状态下进行Oracle 11g 在RedHat Linux 5.8_x64平台的安装手册 http://www.linuxidc.com/Linux/2014-07/104745.htmLinux-6-64下安装Oracle 12C笔记 http://www.linuxidc.com/Linux/2013-07/86805.htm在CentOS 6.4下安装Oracle 11gR2(x64) http://www.linuxidc.com/Linux/2014-02/97374.htmOracle 11gR2 在VMWare虚拟机中安装步骤 http://www.linuxidc.com/Linux/2013-09/89579p2.htmDebian 下 安装 Oracle 11g XE R2 http://www.linuxidc.com/Linux/2014-03/98881.htmocr维护的命令有哪些?维护ocr常用的命令有:ocrcheck[root@node1 bin]# ./ocrcheck -h
Name:
 ocrcheck - Displays health of Oracle Cluster Registry.Synopsis:
 ocrcheckDescription:
 prompt> ocrcheck
 Displays current usage, location and health of the cluster registryNotes:
 A log file will be created in
 $ORACLE_HOME/log/<hostname>/client/ocrcheck_<pid>.log. Please ensure
 you have file creation privileges in the above directory before
 running this tool.ocrdump(dump出来的内容可以用来查看ocr中的内容,但是不可以用来进行恢复)[root@node1 bin]# ./ocrdump -h
Name:
 ocrdump - Dump contents of Oracle Cluster Registry to a file.Synopsis:
 ocrdump [<filename>|-stdout] [-backupfile <backupfilename>] [-keyname <keyname>] [-xml] [-noheader]Description:
 Default filename is OCRDUMPFILE. Examples are: prompt> ocrdump
 writes cluster registry contents to OCRDUMPFILE in the current directory prompt> ocrdump MYFILE
 writes cluster registry contents to MYFILE in the current directory prompt> ocrdump -stdout -keyname SYSTEM
 writes the subtree of SYSTEM in the cluster registry to stdout prompt> ocrdump -stdout -xml
 writes cluster registry contents to stdout in xml formatNotes:
 The header information will be retrieved based on best effort basis.
 A log file will be created in
 $ORACLE_HOME/log/<hostname>/client/ocrdump_<pid>.log. Make sure
 you have file creation privileges in the above directory before
 running this tool.ocrconfig[root@node1 bin]# ./ocrconfig -h
Name:
 ocrconfig - Configuration tool for Oracle Cluster Registry.Synopsis:
 ocrconfig [option]
 option:
  -export <filename> [-s online]
                                      - Export cluster register contents to a file
  -import <filename>                  - Import cluster registry contents from a file
  -upgrade [<user> [<group>]]
                                      - Upgrade cluster registry from previous version
  -downgrade [-version <version string>]
                                      - Downgrade cluster registry to the specified version
  -backuploc <dirname>                - Configure periodic backup location
  -showbackup                        - Show backup information
  -restore <filename>                - Restore from physical backup
  -replace ocr|ocrmirror [<filename>] - Add/replace/remove a OCR device/file
  -overwrite                          - Overwrite OCR configuration on disk
  -repair ocr|ocrmirror <filename>    - Repair local OCR configuration
  -help                              - Print out this help informationNote:
 A log file will be created in
 $ORACLE_HOME/log/<hostname>/client/ocrconfig_<pid>.log. Please ensure
 you have file creation privileges in the above directory before
 running this tool.Table D-1 The ocrconfig Command Options
OptionPurpose
-backuplocTo change an OCR backup file location. For this entry, use a full path that is accessible by all of the nodes.
-downgradeTo downgrade an OCR to an earlier version.
-exportTo export the contents of an OCR into a target file.
-helpTo display help for the ocrconfig commands.
-importTo import the OCR contents from a previously exported OCR file.
-overwriteTo update an OCR configuration that is recorded on the OCR with the current OCR configuration information that is found on the node from which you are running this command.
-repairTo update an OCR configuration on the node from which you are running this command with the new configuration information specified by this command.
-replaceTo add, replace, or remove an OCR location.
-restoreTo restore an OCR from an automatically created OCR backup file.
-showbackupTo display the location, timestamp, and the originating node name of the backup files that Oracle created in the past 4 hours, 8 hours, 12 hours, and in the last day and week. You do not have to be the root user to execute the -showbackup option.
-upgradeTo upgrade an OCR to a later version. 

ocr损坏后怎么恢复?ocr损坏后通常有两种方式进行修正:恢复和重建。恢复的时候,我们可以从之前export导出的文件恢复,也可以从之前有masternode备份的文件进行恢复。[root@node1 bin]# ./crs_stat -t -v
Name          Type          R/RA  F/FT  Target    State    Host       
----------------------------------------------------------------------
httpd_vip      application    0/1    0/0    ONLINE    ONLINE    node2     
httpd_web      application    0/1    0/4    ONLINE    ONLINE    node2     
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/0    0/1    ONLINE    ONLINE    node2     
ora....b1.inst application    0/5    0/0    ONLINE    ONLINE    node1     
ora....b2.inst application    0/5    0/0    ONLINE    ONLINE    node2     
[root@node1 bin]# ./ocrconfig -export a.ocr (导出时最好是关闭crs)
[root@node1 bin]# ./crs_stop httpd_web
Attempting to stop `httpd_web` on member `node2`
Stop of `httpd_web` on member `node2` succeeded.
[root@node1 bin]# ./crs_stop httpd_vip
Attempting to stop `httpd_vip` on member `node2`
Stop of `httpd_vip` on member `node2` succeeded.
[root@node1 bin]# ./crs_stat -t -v
Name          Type          R/RA  F/FT  Target    State    Host       
----------------------------------------------------------------------
httpd_vip      application    0/1    0/0    OFFLINE  OFFLINE             
httpd_web      application    0/1    0/4    OFFLINE  OFFLINE             
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/0    0/1    ONLINE    ONLINE    node2     
ora....b1.inst application    0/5    0/0    ONLINE    ONLINE    node1     
ora....b2.inst application    0/5    0/0    ONLINE    ONLINE    node2     
[root@node1 bin]# ./crs_unregister httpd_web
[root@node1 bin]# ./crs_unregister httpd_vip
[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/0    0/1    ONLINE    ONLINE    node2     
ora....b1.inst application    0/5    0/0    ONLINE    ONLINE    node1     
ora....b2.inst application    0/5    0/0    ONLINE    ONLINE    node2     
[root@node1 bin]# ssh node2 /u01/app/crs_home/bin/crs_stat -t -v
root@node2"s password:
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/0    0/1    ONLINE    ONLINE    node2     
ora....b1.inst application    0/5    0/0    ONLINE    ONLINE    node1     
ora....b2.inst application    0/5    0/0    ONLINE    ONLINE    node2     
[root@node1 bin]# ./corconfig -import a.ocr
-bash: ./corconfig: No such file or directory
<strong>[root@node1 bin]# ./ocrconfig -import a.ocr
PROT-19: Cannot proceed while clusterware is running. Shutdown clusterware first(<span style="background-color: rgb(255, 0, 0);">在导入ocr是集群必须要关闭</span>)</strong>
[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]# ./ocrconfig -import a.ocr
[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       
----------------------------------------------------------------------
httpd_vip      application    0/1    0/0    ONLINE    ONLINE    node1     
httpd_web      application    1/1    0/4    ONLINE    ONLINE    node1     
ora....SM1.asm application    0/5    0/0    ONLINE    OFFLINE             
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/0    0/1    ONLINE    OFFLINE             
ora....b1.inst application    0/5    0/0    ONLINE    OFFLINE             
ora....b2.inst application    0/5    0/0    ONLINE    OFFLINE下面是由restore来恢复ocr[root@node1 crs]# ll -h /u01/app/crs_home/bin/a.ocr
-rw-r--r-- 1 root root 93K Aug  1 16:06 /u01/app/crs_home/bin/a.ocr
[root@node1 crs]# ll -h
total 25M
-rw-r--r-- 1 root  root 4.4M Jul 31 12:36 35521234
-rw-r--r-- 1 oracle root 3.5M Jul 22 14:04 backup00.ocr
-rw-r--r-- 1 oracle root 3.5M Jul 10 14:04 backup01.ocr
-rw-r--r-- 1 oracle root 3.5M Jul  9 14:00 backup02.ocr
-rw-r--r-- 1 oracle root 3.5M Jul 22 14:04 day.ocr
-rw-r--r-- 1 oracle root  85K Jul 24 15:27 ocr.exp
-rw-r--r-- 1 oracle root 3.5M Jul 10 14:04 week_.ocr
-rw-r--r-- 1 oracle root 3.5M Jul  3 14:15 week.ocr
[root@node1 crs]# ocrconfig -restore /u01/app/crs_home/bin/a.ocr
PROT-22: Storage too small
[root@node1 crs]# ocrconfig -restore /u01/app/crs_home/cdata/crs/backup00.ocr
PROT-19: Cannot proceed while clusterware is running. Shutdown clusterware first说明:export导出的文件只能是由import导入,restore时,cluster也必须全部离线具体的操作过程这里不再演示,更多详情见请继续阅读下一页的精彩内容: http://www.linuxidc.com/Linux/2014-08/105645p2.htm
  • 1
  • 2
  • 3
  • 下一页
MySQL无法启动——cannot allocate the memory for the buffer poolHive优化提示-如何写好HQL相关资讯      ORACLE 10G  Oracle 10g管理 
  • Oracle 10g(10.2.0.4)升级到10.2.0  (04月10日)
  • Oracle 10g 一主多备的搭建技巧  (07/31/2015 15:31:51)
  • 多平台下的32位和64位Oracle 10g下  (02/18/2015 10:38:21)
  • Oracle 10g实现只读表的N种方法  (08/05/2015 10:54:35)
  • Oracle 10g中约束与列属性NULLABLE  (03/07/2015 19:22:46)
  • Oracle 10g Clusterware Votedisk   (01/16/2015 14:09:54)
本文评论 查看全部评论 (0)
表情: 姓名: 字数