Chinaunix首页 | 论坛 | 博客
  • 博客访问: 594504
  • 博文数量: 51
  • 博客积分: 4000
  • 博客等级: 上校
  • 技术积分: 1737
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-27 13:45
文章分类

全部博文(51)

文章存档

2011年(3)

2009年(19)

2008年(29)

我的朋友

分类: Oracle

2008-03-13 21:55:16

 在Oracle10g RAC环境中,OCR及Voting Disk对于集群来说都是非常重要的。
 通过命令./ocrconfig -showbackup 显示备份
[oracle@swrac1 bin]$ ./ocrconfig -showbackup
swrac1     2008/03/13 18:58:37     /oracle/oracle/product/10.2.0/crs/cdata/crs
swrac1     2008/03/13 14:58:37     /oracle/oracle/product/10.2.0/crs/cdata/crs
swrac1     2008/03/13 10:58:37     /oracle/oracle/product/10.2.0/crs/cdata/crs
swrac1     2008/03/12 02:58:30     /oracle/oracle/product/10.2.0/crs/cdata/crs
swrac1     2008/03/02 02:57:42     /oracle/oracle/product/10.2.0/crs/cdata/crs
 注意这个备份只会存储在一个节点上,并非所有节点都会记录这个备份。
在备份节点的相应目录下我们可以找到这些备份:
 cd /oracle/oracle/product/10.2.0/crs/cdata/crs
 ls
 [oracle@swrac1 crs]$ ls
 backup00.ocr  backup01.ocr  backup02.ocr  day_.ocr  day.ocr  week_.ocr  week.ocr
显示日、天、周备份
 
 当出现故障时,可以通过ocrconfig命令来执行恢复,通过帮助可以看到详细的用法:
  [oracle@swrac1 bin]$ ./ocrconfig --help
Name:
    ocrconfig - Configuration tool for Oracle Cluster Registry.
Synopsis:
        ocrconfig [option]
        option:
                -export [-s online]
                           - Export cluster register contents to a file
                -import                  
                           - Import cluster registry contents from a file
                -upgrade [ []]
                           - Upgrade cluster registry from previous version
                -downgrade [-version ]
                           - Downgrade cluster registry to the specified version
                -backuploc                
                           - Configure periodic backup location
                -showbackup              
                           - Show backup information
                -restore                 
                           - Restore from physical backup
                -replace ocr|ocrmirror []
                           - Add/replace/remove a OCR device/file
                -overwrite 
                         - Overwrite OCR configuration on disk
                -repair ocr|ocrmirror    
                         - Repair local OCR configuration
                -help                - Print out this help information
Note:
        A log file will be created in
        $ORACLE_HOME/log//client/ocrconfig_.log. Please ensure
        you have file creation privileges in the above directory before
        running this tool.
 
如果不出意外,恢复过程将会很简单,通过 ocrconfig -restore 就可以回复这里的物理备份。

   对于voting disk可以通过dd来进行备份。
首先通过 crsctl query css votedisk 命令可以找到voting disk的存储地
 
  [oracle@swrac1 bin]$ ./crsctl query css votedisk
 0.     0    /dev/raw/raw3
 1.     0    /dev/raw/raw4
 2.     0    /dev/raw/raw5
   然后通过dd备份:
    [oracle@swrac1 bin]$ dd if=/dev/raw/raw5 of=/oracle/oracle/votedisk.bak
    13809+0 records in
    13809+0 records out
   
  当需要恢复时,通过dd进行恢复即可。这个voting disk记录了什么内容呢?
   [oracle@swrac1 oracle]$ strings  votedisk.bak  | sort  -u
etoV
fSLC
ssLckcoT
SslcLlik
sSlcrEp0
swrac1
swrac2
}|{z
 通过strings可以将其中的字符串取出来看一个印象:
 
 
阅读(1348) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~