ORACLE 11G RAC--維護叢集的OCR命令介紹
ORACLE CLUSTERWARE把整個叢集的配置資訊放在共享儲存上,這個儲存就是OCR DISK.在叢集中只能有一個節點對OCR DISK進行讀寫,所有節點都會在記憶體中保留一份OCR的拷貝。OCR如何維護?
1.OCRDUMP,以ASCII的方式列印OCR的內容,產生的檔案只用於閱讀,不用於備份恢復OCR.
選項說明:
stdout把內容列印到輸出螢幕上
Filename內容輸出到檔案中
keyname只列印某個鍵及其子鍵的內容
xml以XML格式列印輸出
[oracle@rac1 bin]$ pwd
/u01/app/11.2.0/11ggrid/bin
[oracle@rac1 bin]$ ./ocrdump -stdout -keyname SYSTEM.css -xml | more
08/16/2012 18:50:25
./ocrdump.bin -stdout -keyname SYSTEM.css -xml
SYSTEM.css
UNDEF
PROCR_ALL_ACCESS
PROCR_CREATE_SUB_KEY
PROCR_CREATE_SUB_KEY
root
root
執行這個命令的時候會生成一個日誌檔案,這個日誌檔案可用來檢視命令執行失敗的原因。
[root@rac1 client]# more ocrdump_25560.log
Oracle Database 11g Clusterware Release 11.2.0.1.0 - Production Copyright 1996, 2009 Oracle. All rights reserved.
2012-08-16 00:00:45.016: [ OCRDUMP][3086886592]ocrdump starts...
2012-08-16 00:00:45.143: [ OCRDUMP][3086886592]Exiting [status=success]...
[root@rac1 client]# pwd
/u01/app/11.2.0/11ggrid/log/rac1/client
[root@rac1 client]#
2.OCRCHECK,用來檢查OCR內容的一致性。執行它不需要引數
[root@rac1 bin]# pwd
/u01/app/11.2.0/11ggrid/bin
[root@rac1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2592
Available space (kbytes) : 259528
ID : 2013995871
Device/File Name : +CRS
Device/File integrity check succeeded【這說明OCR內容是一致的】
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
[root@rac1 bin]#
執行這個命令也會產生一個日誌檔案
[root@rac1 bin]# pwd
/u01/app/11.2.0/11ggrid/bin
[root@rac1 bin]# cd /u01/app/11.2.0/11ggrid/log/rac1/client/
[root@rac1 client]# ls -ltr ocrcheck_*.log
-rw-r--r-- 1 root root 379 Aug 9 01:25 ocrcheck_6982.log
-rw-r--r-- 1 root root 379 Aug 16 00:03 ocrcheck_25681.log
-rw-r--r-- 1 root root 379 Aug 16 19:03 ocrcheck_16786.log
[root@rac1 client]# more ocrcheck_25681.log
Oracle Database 11g Clusterware Release 11.2.0.1.0 - Production Copyright 1996, 2009 Oracle. All rights reserved.
2012-08-16 00:03:19.633: [OCRCHECK][3086935744]ocrcheck starts...
2012-08-16 00:03:20.963: [OCRCHECK][3086935744]protchcheck: OCR status : total = [262120], used = [2592], avail = [259528]
2012-08-16 00:03:28.921: [OCRCHECK][3086935744]Exiting [status=success]...
[root@rac1 client]#
3.ocrconfig這個命令用來維護ocr磁碟,ocr磁碟最多隻能有兩個,一個為主一個為映象。
用法說明
[root@rac1 bin]# ./ocrconfig -help
Name:
ocrconfig - Configuration tool for Oracle Cluster/Local Registry.
Synopsis:
ocrconfig [option]
option:
[-local] -export
- Export OCR/OLR contents to a file
[-local] -import - Import OCR/OLR contents from a file
[-local] -upgrade [ []]
- Upgrade OCR from previous version
-downgrade [-version]
- Downgrade OCR to the specified version
[-local] -backuploc - Configure OCR/OLR backup location
[-local] -showbackup [auto|manual] - Show OCR/OLR backup information
[-local] -manualbackup - Perform. OCR/OLR backup
[-local] -restore - Restore OCR/OLR from physical backup
-replace -replacement
- Replace a OCR device/file with
-add - Add a new OCR device/file
-delete - Remove a OCR device/file
-overwrite - Overwrite OCR configuration on disk
-repair -add | -delete | -replace -replacement
- Repair OCR configuration on the local node
-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.
* Only -local -showbackup [manual] is supported.
* Use option '-local' to indicate that the operation is to be performed on the Oracle Local Registry.
[root@rac1 bin]#
檢視自動備份
[oracle@rac1 bin]$ pwd
/u01/app/11.2.0/11ggrid/bin
[oracle@rac1 bin]$ ./ocrconfig -showbackup
rac2 2012/08/16 15:36:35 /u01/app/11.2.0/11ggrid/cdata/rac-cluster/backup00.ocr
rac2 2012/08/16 11:36:34 /u01/app/11.2.0/11ggrid/cdata/rac-cluster/backup01.ocr
rac2 2012/08/16 07:36:34 /u01/app/11.2.0/11ggrid/cdata/rac-cluster/backup02.ocr
rac1 2012/08/15 00:28:16 /u01/app/11.2.0/11ggrid/cdata/rac-cluster/day.ocr
rac1 2012/08/08 00:27:44 /u01/app/11.2.0/11ggrid/cdata/rac-cluster/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available
[oracle@rac1 bin]$
4.使用匯入匯出執行備份與恢復
在對叢集做調整時,如增,刪節點前要先對OCR備份,以下操作風險大,‘虐’過。。。。
1.OCRDUMP,以ASCII的方式列印OCR的內容,產生的檔案只用於閱讀,不用於備份恢復OCR.
選項說明:
stdout把內容列印到輸出螢幕上
Filename內容輸出到檔案中
keyname只列印某個鍵及其子鍵的內容
xml以XML格式列印輸出
[oracle@rac1 bin]$ pwd
/u01/app/11.2.0/11ggrid/bin
[oracle@rac1 bin]$ ./ocrdump -stdout -keyname SYSTEM.css -xml | more
執行這個命令的時候會生成一個日誌檔案,這個日誌檔案可用來檢視命令執行失敗的原因。
[root@rac1 client]# more ocrdump_25560.log
Oracle Database 11g Clusterware Release 11.2.0.1.0 - Production Copyright 1996, 2009 Oracle. All rights reserved.
2012-08-16 00:00:45.016: [ OCRDUMP][3086886592]ocrdump starts...
2012-08-16 00:00:45.143: [ OCRDUMP][3086886592]Exiting [status=success]...
[root@rac1 client]# pwd
/u01/app/11.2.0/11ggrid/log/rac1/client
[root@rac1 client]#
2.OCRCHECK,用來檢查OCR內容的一致性。執行它不需要引數
[root@rac1 bin]# pwd
/u01/app/11.2.0/11ggrid/bin
[root@rac1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2592
Available space (kbytes) : 259528
ID : 2013995871
Device/File Name : +CRS
Device/File integrity check succeeded【這說明OCR內容是一致的】
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
[root@rac1 bin]#
執行這個命令也會產生一個日誌檔案
[root@rac1 bin]# pwd
/u01/app/11.2.0/11ggrid/bin
[root@rac1 bin]# cd /u01/app/11.2.0/11ggrid/log/rac1/client/
[root@rac1 client]# ls -ltr ocrcheck_*.log
-rw-r--r-- 1 root root 379 Aug 9 01:25 ocrcheck_6982.log
-rw-r--r-- 1 root root 379 Aug 16 00:03 ocrcheck_25681.log
-rw-r--r-- 1 root root 379 Aug 16 19:03 ocrcheck_16786.log
[root@rac1 client]# more ocrcheck_25681.log
Oracle Database 11g Clusterware Release 11.2.0.1.0 - Production Copyright 1996, 2009 Oracle. All rights reserved.
2012-08-16 00:03:19.633: [OCRCHECK][3086935744]ocrcheck starts...
2012-08-16 00:03:20.963: [OCRCHECK][3086935744]protchcheck: OCR status : total = [262120], used = [2592], avail = [259528]
2012-08-16 00:03:28.921: [OCRCHECK][3086935744]Exiting [status=success]...
[root@rac1 client]#
3.ocrconfig這個命令用來維護ocr磁碟,ocr磁碟最多隻能有兩個,一個為主一個為映象。
用法說明
[root@rac1 bin]# ./ocrconfig -help
Name:
ocrconfig - Configuration tool for Oracle Cluster/Local Registry.
Synopsis:
ocrconfig [option]
option:
[-local] -export
- Export OCR/OLR contents to a file
[-local] -import
[-local] -upgrade [
- Upgrade OCR from previous version
-downgrade [-version
- Downgrade OCR to the specified version
[-local] -backuploc
[-local] -showbackup [auto|manual] - Show OCR/OLR backup information
[-local] -manualbackup - Perform. OCR/OLR backup
[-local] -restore
-replace
- Replace a OCR device/file
-add
-delete
-overwrite - Overwrite OCR configuration on disk
-repair -add
- Repair OCR configuration on the local node
-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.
* Only -local -showbackup [manual] is supported.
* Use option '-local' to indicate that the operation is to be performed on the Oracle Local Registry.
[root@rac1 bin]#
檢視自動備份
[oracle@rac1 bin]$ pwd
/u01/app/11.2.0/11ggrid/bin
[oracle@rac1 bin]$ ./ocrconfig -showbackup
rac2 2012/08/16 15:36:35 /u01/app/11.2.0/11ggrid/cdata/rac-cluster/backup00.ocr
rac2 2012/08/16 11:36:34 /u01/app/11.2.0/11ggrid/cdata/rac-cluster/backup01.ocr
rac2 2012/08/16 07:36:34 /u01/app/11.2.0/11ggrid/cdata/rac-cluster/backup02.ocr
rac1 2012/08/15 00:28:16 /u01/app/11.2.0/11ggrid/cdata/rac-cluster/day.ocr
rac1 2012/08/08 00:27:44 /u01/app/11.2.0/11ggrid/cdata/rac-cluster/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available
[oracle@rac1 bin]$
4.使用匯入匯出執行備份與恢復
在對叢集做調整時,如增,刪節點前要先對OCR備份,以下操作風險大,‘虐’過。。。。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15720542/viewspace-741128/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE 11G RAC--叢集應用層命令掃盲Oracle
- OCR維護命令
- rac維護工具集系列(四)--叢集層OCR系列
- rac叢集日常維護命令
- hbase叢集 常用維護命令
- Oracle RAC維護命令集Oracle
- oracle 11g rac 叢集操作命令Oracle
- Oracle ClusterWare 的OCR叢集登錄檔Oracle
- ORACLE 12C PDB 維護基礎介紹Oracle
- 11G RAC OLR維護命令
- Oracle RAC維護命令Oracle
- Redis 漸進叢集介紹Redis
- MySQL叢集 NDB 7.5介紹MySql
- 阿里超大規模 Flink 叢集運維體系介紹阿里運維
- rac維護工具集系列(三)--叢集層crsctl系列
- oracle 11g data guard維護Oracle
- 收集oracle日常維護的工作命令Oracle
- ORACLE 11G RAC--日誌路徑Oracle
- solr叢集構建的基本流程介紹Solr
- Oracle 11g RMAN的常規維護Oracle
- 叢集管理工具ansible常用命令介紹(一)
- Oracle叢集軟體管理-OCR和Voting Files管理Oracle
- 【轉】ORACLE CRS日常維護命令Oracle
- Oracle RAC日常基本維護命令Oracle
- Redis叢集介紹及測試思路Redis
- Redis 3.0介紹及叢集說明Redis
- ORACLE 11G 維護視窗和自動維護任務Oracle
- linux中oracle的日常維護命令LinuxOracle
- Oracle字符集介紹Oracle
- 介紹Oracle自帶的一些ASM維護工具 (kfod/kfed/amdu)OracleASM
- 如何搭建一個易於維護的 Hadoop 叢集?Hadoop
- Oracle介紹SVRMGRL命令(轉)OracleVR
- 基本UNIX命令集介紹(轉)
- 基於OGG的Oracle與Hadoop叢集準實時同步介紹OracleHadoop
- ORACLE 11G 自動維護任務Oracle
- 管理oracle叢集中的ocr檔案Oracle
- 替換oracle叢集中的OCR 映象Oracle
- 【PDB】Oracle pdb維護常用sql命令OracleSQL