OCR的备份与恢复&ASM管理 下载本文

RAC的OCR和VOTING DISK备份方法

我们知道在对RAC节点做一些配置均需要做好备份工作,以便于能够恢复到配置前的状态,这也是一个DBA的基本素质要求,如下是比较常用的方法: 备份voting disk磁盘

[root@RAC2 bin]# ./crsctl query cssvotedisk 0. 0 /dev/raw/raw2

located 1 votedisk(s).

[root@RAC2 bin]# dd if=/dev/raw/raw2 of=/home/oracle/votedisk.bak 208896+0 records in 208896+0 records out

106954752 bytes (107 MB) copied, 68.1215 seconds, 1.6 MB/s 备份OCR磁盘:

[root@RAC2 bin]# export LANG=C

[root@RAC2 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@RAC2 bin]# ./ocrconfig -export /home/oracle/ocr.exp [root@RAC2 bin]# ./ocrcheck

Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 104216 Used space (kbytes) : 3856 Available space (kbytes) : 100360 ID : 1338542740 Device/File Name : /dev/raw/raw1 Device/File integrity check succeeded Device/File not configured

Cluster registry integrity check succeeded

crsctl用法可以参见如下: [root@RAC2 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 – sets a parameter override crsctl get css – gets the value of a CSS parameter crsctl unset css – sets CSS parameter to its default crsctl query cssvotedisk – lists the voting disks used by CSS crsctl add cssvotedisk – adds a new voting disk crsctl delete cssvotedisk – 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 statedumpevm – dumps state info for evm objects crsctl debug statedumpcrs – dumps state info for crs objects crsctl debug statedumpcss – 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 turns on debugging for resources crsctl query crssoftwareversion [] – lists the version of CRS software installed

crsctl query crsactiveversion – lists the CRS software operating version crsctllsmodulescss – lists the CSS modules that can be used for debugging crsctllsmodulescrs – lists the CRS modules that can be used for debugging crsctllsmodulesevm – 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 ocrconfig的用法参见如下: [root@RAC2 bin]# ./ocrconfig 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.