給ocr增加ocrmirror時遇到的問題總結
原本以為會很順利,沒想到遇到了幾個問題,簡單總結一下...
[@more@][oracle@node1 bin]$ ./ocrconfig
Name:
ocrconfig - Configuration tool for Oracle Cluster Registry.
Synopsis:
ocrconfig [option]
option:
-export
- Export cluster register contents to a file
-import
-upgrade [
- Upgrade cluster registry from previous version
-downgrade [-version
- Downgrade cluster registry to the specified version
-backuploc
-showbackup - Show backup information
-restore
-replace ocr|ocrmirror [
-overwrite - Overwrite OCR configuration on disk
-repair ocr|ocrmirror
-help - Print out this help information
Note:
A log file will be created in
$ORACLE_HOME/log/
you have file creation privileges in the above directory before
running this tool.
[oracle@node1 bin]$ ./ocrconfig -replace ocrmirror /dev/raw/raw5
PROT-20: Insufficient permission to proceed. Require privileged user
--注意許可權的問題,需要用root
[oracle@node1 bin]$ su - root
Password:
[root@node1 ~]# cd /crs/bin
[root@node1 bin]# ./ocrconfig -replace ocrmirror /dev/raw/raw7
PROT-1: Failed to initialize ocrconfig
[root@node1 bin]# ./ocrconfig -replace ocrmirror /dev/raw/raw7
PROT-1: Failed to initialize ocrconfig
[root@node1 bin]# ./ocrconfig -replace ocrmirror /dev/raw/raw10
PROT-1: Failed to initialize ocrconfig
[root@node1 bin]# fdisk -l /dev/sde
Disk /dev/sde: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 13 104391 83 Linux
/dev/sde2 14 26 104422+ 83 Linux
/dev/sde3 27 261 1887637+ 5 Extended
/dev/sde5 27 43 136521 83 Linux
/dev/sde6 44 60 136521 83 Linux
/dev/sde7 61 73 104391 83 Linux
/dev/sde8 74 86 104391 83 Linux
/dev/sde9 87 99 104391 83 Linux
/dev/sde10 100 112 104391 83 Linux
[root@node1 bin]# ./ocrconfig -replace ocrmirror /dev/raw/raw5
PROT-1: Failed to initialize ocrconfig
--crs沒有啟動時執行./ocrconfig -replace ocrmirror會收到如下提示
[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104336
Used space (kbytes) : 4580
Available space (kbytes) : 99756
ID : 1892429764
Device/File Name : /dev/raw/raw2
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
[root@node1 bin]# raw -qa
/dev/raw/raw1: bound to major 8, minor 65
/dev/raw/raw2: bound to major 8, minor 66
/dev/raw/raw3: bound to major 8, minor 67
/dev/raw/raw5: bound to major 8, minor 69
/dev/raw/raw6: bound to major 8, minor 70
/dev/raw/raw7: bound to major 8, minor 71
/dev/raw/raw8: bound to major 8, minor 72
/dev/raw/raw9: bound to major 8, minor 73
/dev/raw/raw10: bound to major 8, minor 74
[root@node1 bin]# rdate -s node2
[root@node1 bin]#
--=============================
[root@node1 oracle]# more ocr.loc
ocrconfig_loc=/dev/raw/raw2
local_only=FALSE
[root@node1 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
[root@node1 bin]# ./ocrconfig -replace ocrmirror /dev/raw/raw5
[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104336
Used space (kbytes) : 4580
Available space (kbytes) : 99756
ID : 1892429764
Device/File Name : /dev/raw/raw2
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw5
Device/File integrity check succeeded
Cluster registry integrity check succeeded
[root@node1 bin]# more /etc/oracle/ocr.loc
#Device/file getting replaced by device /dev/raw/raw5
ocrconfig_loc=/dev/raw/raw2
ocrmirrorconfig_loc=/dev/raw/raw5
local_only=false
[root@node1 bin]#
--修改成功之後我們主要到/etc/oracle/ocr.loc檔案也同步被做了修改
另外在執行命令./ocrconfig -replace ocrmirror...時還可能會收到如下錯誤提示:
PROT-22: Storage too small
這是由於一個bug造成的:
Oracle Cluster Registry (OCR)2009-05-23 13:11$ ocrconfig -replace ocrmirror /ora10g/app/oracle/oradata/V10/OracleClusterRegistry2
PROT-22: Storage too small
The problem is due to an Oracle bug where this operation requires the OCR mirror partition/file to be larger than the original by up to 128MB. The bug has been fixed in the 10.2.0.2 patchset.
1. get the voting disk location: cat /etc/oracle/ocr.loc ocrcheck
2. check or diagnose OCR integrity
cluvfy comp ocr -n all
ocrcheckocrdump3. Adding an Oracle Cluster Registry:
Note: RAC environments do not support more than two OCRs, a primary OCR and a second OCR. You must be root user to run ocrconfig commands.For PROT-16: Internal ErrorWhen issuing ocrconfig -replace it checks first about the size of the new OCR before making the replacement. If it is acceptable then it will replace to the new OCR.
The acceptable size is either 128Mb or 256Mb and so on. If the original OCR size was less than 128Mb, please make the new OCR as 128Mb or 256Mb. If the original OCR size was less than 256Mb and greater than 128Mb, please make the new OCR as 256Mb.
-- To implement the solution, please execute the following steps::
1). Please create another file ocrmirrornew.dbf:
dd if=/dev/zero of=/ocfs/OCR/ocrnew.dbf bs=1M count=128
dd if=/dev/zero of=/ocfs/OCR/ocrmirrornew.dbf bs=1M count=1282). Please run the following: ./ocrconfig -replace ocrmirror
./ocrconfig -replace ocr
./ocrconfig -replace ocrmirror /ocfs/OCR/ocrmirrornew.dbf
./ocrconfig -replace ocr /ocfs/OCR/ocrnew.dbf
-raw device example
./ocrconfig -replace ocrmirror /dev/raw/raw4
./ocrconfig -replace ocr /dev/raw/raw54. Removing the OCR:
ocrconfig -replace ocr -- remove an OCR device
ocrconfig -replace ocrmirror -- remove an OCR mirror device5. replace or move the location of an OCR device:Note: if your OCR resides on a cluster file system file or if the OCR is on an network file system, then create the target OCR file before continuing with this procedure.
ocrconfig -replace ocr
ocrconfig -replace ocrmirror
ocrconfig -showbackupThe default location for generating backups on UNIX-based systems is CRS_home/cdata/cluster_name8. backup the OCR:
ocrconfig -export /u01/app/oracle/ocr.bak -s online9. restore the OCR:as oracle user:ocrconfig -showbackup
srvctl stop nodeapps -n linux1
srvctl stop nodeapps -n linux2
crs_stat -t
as root user:
crsctl stop crs (or init.crs stop)
ocrconfig import
srvctl stop nodeapps -n linux1
srvctl stop nodeapps -n linux2
crs_stat -t
as root user:
crsctl stop crs (or init.crs stop)
./ocrconfig -restore /u01/app/oracle/product/crs/cdata/crs/backup01.ocrcrsctl start crs (or init.crs start)cluvfy comp ocr -n all [-verbose]Example moving OCR file from OCFS to raw devices (From Metalink)
The OCR disk must be owned by root, must be in the oinstall group, and must have permissions set to 640. Provide at least 100 MB disk space for the OCR.
In this example the OCR files are located in the ocfs2 file system:
/ocfs2/ocr1, /ocfs2/ocr2
Create raw device files of at least 100 MB. In this example the new OCR file will be on the following devices:
/dev/raw/raw1, /dev/raw/raw2
Once the raw devices are created, use the dd command to zero out the device and make sure no data is written to the raw devices:
dd if=/dev/zero of=/dev/raw/raw1
dd if=/dev/zero of=/dev/raw/raw2Now you are ready to move/replace the OCR file to the new storage location.
Move/Replace the OCR device ocrconfig -replace ocr /dev/raw/raw1Add /dev/raw/raw2 as OCR mirror device ocrconfig -replace ocrmirror /dev/raw/raw2
Example of adding an OCR device file(From metalink)
If you have upgraded your environment from a previous version, where you only had one OCR device file, you can use the following step to add an additional OCR file.
In this example a second OCR device file is added:
Add /dev/raw/raw2 as OCR mirror device ocrconfig -replace ocrmirror /dev/raw/raw2Syntax for ocrconfig:
Name: ocrconfig - Configuration tool for Oracle Cluster Registry.Synopsis:
ocrconfig [option]
option:
-export
-import
-upgrade [
-downgrade [-version
-backuploc
-showbackup - Show backup information
-restore
-replace ocr|ocrmirror [
-overwrite - Overwrite OCR configuration on disk
-repair ocr|ocrmirror
-help - Print out this help informationNote:
A log file will be created in $ORACLE_HOME/log/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1032158/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- vue專案中遇到的問題總結Vue
- Android中使用WebView遇到的問題總結:AndroidWebView
- React開發中遇到的問題總結React
- 2017年秋季遇到的相容問題總結
- 總結一下最近遇到的問題
- Windows安裝Filebeat遇到問題總結Windows
- 提交Spark作業遇到的NoSuchMethodError問題總結SparkError
- 升級 node18 遇到的問題總結
- 總結一下本週遇到的問題
- android單元測試遇到問題總結Android
- laravel 在配置nginx代理時遇到的連結問題LaravelNginx
- 專案中遇到的RediS快取問題及面試問題總結Redis快取面試
- 初試微信小程式遇到問題總結微信小程式
- 初次使用EasyUI框架外掛遇到的問題及總結UI框架
- SwitchResX自定義解析度時遇到的問題彙總
- 遇到的編碼問題、時區問題整理
- 客戶端(windows)訪問FTP伺服器遇到的問題(總結)客戶端WindowsFTP伺服器
- H5與APP混合開發遇到的問題總結H5APP
- Vue學習遇到疑問的總結Vue
- 總結:使用MyBatis Generator時遇到的坑MyBatis
- vue 克隆物件時遇到的問題Vue物件
- 在Centos和Docker上安裝STF 遇到的若干問題總結CentOSDocker
- 配置MapReduce時遇到的問題記錄
- php部署到nginx時遇到的問題PHPNginx
- Homestead環境遇到問題彙總
- 問題總結
- 倒數計時快取時間問題總結快取
- laravel開發中遇到的問題與bug修復的一些總結Laravel
- 使用Spring Data Jpa遇到問題彙總Spring
- Swoole 問題總結
- Elasticsearch 問題總結Elasticsearch
- Kibana 問題總結
- Kerberos問題總結ROS
- PHP中高階面試的時候總是會問到這些問題(總結)PHP面試
- 剛開始學習nlp時遇到的問題
- Laravel6.18.0 NPM 編譯時遇到的問題LaravelNPM編譯
- RT-Thread 元件 FinSH 使用時遇到的問題thread元件
- 遇到一個建表時出現的問題
- linux遇到的問題Linux