search
HomeDatabaseMysql TutorialOracle 10g Clusterware Votedisk 损坏的恢复方法

votedisk无论是对于RAC(10g Clusterware、11g GI)而言,是非常重要的,我们称它为仲裁盘,当RAC集群中的某个节点发生故障而脱网掉

votedisk无论是对于RAC(10g Clusterware、11g GI)而言,是非常重要的,我们称它为仲裁盘,当RAC集群中的某个节点发生故障而脱网掉线时,就由它来判断是否将其踢出集群,以保证集群正常运行,当votedisk损坏了,也就会导致集群服务无法启动,集群资源都无法加载,最后导致罢工。那么我们平时就要注意对votedisk的备份,在11g中,由于votedisk和ocr默认就会放进ASM磁盘组,因此可以不用特别关注,但对于10g的Cluster来说,由于不能放到ASM磁盘组,只能以raw的形式使用,因此要特别关注votedisk,定期对其进行备份,如:

用dd命令备份和恢复votedisk的方法:
备份:dd if=/dev/raw/raw3  of=/tmp/votedisk.bak
恢复:dd if=/tmp/votedisk.bak of=/dev/raw/raw3

如果很不幸,之前没有做过备份,且没有做过镜像,当votedisk损坏的时候,,就只能对crs进行重建了,下面来演示一下这个过程:

--关闭crs,对votedisk的盘进行破坏,这里是/dev/raw/raw3
[root@rac1 ~]# dd if=/dev/zero of=/dev/raw/raw3 bs=4096 count=12800

再次重启crs,就提示无法启动了,查找ocssd.log日志文件发现,其中有记录,说明了是磁盘损坏
PS:10g Clusterware的日志入口地址是$ORA_CRS_HOME/log/主机名/...

 [    CSSD]2015-01-16 09:37:38.327 >USER:    Oracle Database 10g CSS Release 10.2.0.1.0 Production Copyright 1996, 2094 Oracle.  All rights reserved.
[    CSSD]2015-01-16 09:37:38.327 >USER:    CSS daemon log for node rac1, number 1, in cluster cluster
[  clsdmt]Listening to (ADDRESS=(PROTOCOL=ipc)(KEY=rac1DBG_CSSD))
[    CSSD]2015-01-16 09:37:38.332 [3059615952] >TRACE:  clssscmain: local-only set to false
[    CSSD]2015-01-16 09:37:38.344 [3059615952] >TRACE:  clssnmReadNodeInfo: added node 1 (rac1) to cluster
[    CSSD]2015-01-16 09:37:38.352 [3059615952] >TRACE:  clssnmReadNodeInfo: added node 2 (rac2) to cluster
[    CSSD]2015-01-16 09:37:38.356 [3032808336] >TRACE:  clssnm_skgxnmon: skgxn init failed, rc 1
[    CSSD]2015-01-16 09:37:38.356 [3059615952] >TRACE:  clssnm_skgxnonline: Using vacuous skgxn monitor
[    CSSD]2015-01-16 09:37:38.362 [3059615952] >TRACE:  clssnmDiskStateChange: state from 1 to 2 disk (0//dev/raw/raw3)
[    CSSD]2015-01-16 09:37:40.381 [3032808336] >TRACE:  clssnmvDiskOpen: corrupt kill block on disk (0x09!=0x636c73536b696c4c)
[    CSSD]2015-01-16 09:37:40.381 [3032808336] >TRACE:  clssnmDiskStateChange: state from 2 to 3 disk (0//dev/raw/raw3)

重建crs很简单,就执行2个脚本:
1.$ORA_CRS_HOME/install/rootdelete.sh
2.$ORA_CRS_HOME/install/rootdeinstall.sh

节点1:
[root@rac1 install]# ./rootdelete.sh
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources.
Error while stopping resources. Possible cause: CRSD is down.
Stopping CSSD.
Unable to communicate with the CSS daemon.
Shutdown has begun. The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'
[root@rac1 install]# ./rootdeinstall.sh

Removing contents from OCR device
2560+0 records in
2560+0 records out
10485760 bytes (10 MB) copied, 0.590608 seconds, 17.8 MB/s

节点2:
[root@rac2 install]# ./rootdelete.sh
Shutting down Oracle Cluster Ready Services (CRS):
OCR initialization failed with invalid format: PROC-22: The OCR backend has an invalid format
Shutdown has begun. The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'
[root@rac2 install]# ./rootdeinstall.sh

Removing contents from OCR device
2560+0 records in
2560+0 records out
10485760 bytes (10 MB) copied, 0.627909 seconds, 16.7 MB/s
[root@rac2 install]# dd if=/dev/zero of=/dev/raw/raw3 bs=4096 count=128000
dd: writing `/dev/raw/raw3': No space left on device
25601+0 records in
25600+0 records out
104857600 bytes (105 MB) copied, 5.40456 seconds, 19.4 MB/s

然后重新在2个节点依次执行$ORA_CRS_HOME/root.sh就可以了,软件的OUI不用重新安装

如果通过脚本无法删除成功,安装顺利重新安装crs,可以手工删除以下目录:

rm /etc/oracle/*
rm -f /etc/init.d/init.cssd
rm -f /etc/init.d/init.crs
rm -f /etc/init.d/init.crsd
rm -f /etc/init.d/init.evmd
rm -f /etc/rc2.d/K96init.crs
rm -f /etc/rc2.d/S96init.crs
rm -f /etc/rc3.d/K96init.crs
rm -f /etc/rc3.d/S96init.crs
rm -f /etc/rc5.d/K96init.crs
rm -f /etc/rc5.d/S96init.crs
rm -Rf /etc/oracle/scls_scr
rm -f /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab

总结:

平时我们都会对ocr和votedisk磁盘做多个镜像冗余,另外,如果是裸设备的话,还会通过dd命令单独去备份,通常是不太容易损坏和丢失的,万一发生了无备份情况下的损坏,那么就只能工作重建crs来解决问题了,这就是DBAs们的最后一根救命稻草了。

本文永久更新链接地址:

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What Are the Limitations of Using Views in MySQL?What Are the Limitations of Using Views in MySQL?May 14, 2025 am 12:10 AM

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

Securing Your MySQL Database: Adding Users and Granting PrivilegesSecuring Your MySQL Database: Adding Users and Granting PrivilegesMay 14, 2025 am 12:09 AM

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

What Factors Influence the Number of Triggers I Can Use in MySQL?What Factors Influence the Number of Triggers I Can Use in MySQL?May 14, 2025 am 12:08 AM

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M

MySQL: Is it safe to store BLOB?MySQL: Is it safe to store BLOB?May 14, 2025 am 12:07 AM

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

MySQL: Adding a user through a PHP web interfaceMySQL: Adding a user through a PHP web interfaceMay 14, 2025 am 12:04 AM

Adding MySQL users through the PHP web interface can use MySQLi extensions. The steps are as follows: 1. Connect to the MySQL database and use the MySQLi extension. 2. Create a user, use the CREATEUSER statement, and use the PASSWORD() function to encrypt the password. 3. Prevent SQL injection and use the mysqli_real_escape_string() function to process user input. 4. Assign permissions to new users and use the GRANT statement.

MySQL: BLOB and other no-sql storage, what are the differences?MySQL: BLOB and other no-sql storage, what are the differences?May 13, 2025 am 12:14 AM

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

MySQL Add User: Syntax, Options, and Security Best PracticesMySQL Add User: Syntax, Options, and Security Best PracticesMay 13, 2025 am 12:12 AM

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

MySQL: How to avoid String Data Types common mistakes?MySQL: How to avoid String Data Types common mistakes?May 13, 2025 am 12:09 AM

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.