11G開始voting disk自動備份到OCR了,也就是說voting disk資訊合併到OCR中了

lusklusklusk發表於2018-11-01

In Oracle Clusterware 11g release 2 ( 11.2), you no longer have to back up the voting disk. The voting disk data is automatically backed up in OCR as part of any configuration change and is automatically restored to any voting disk added . If all voting disks are corrupted, however, you can restore them as described in "Restoring Voting Disks".

在Oracle Clusterware 11g第2版( 11.2)中,您不再需要備份voting disk。 作為任何配置更改的一部分,voting disk資料將自動備份到OCR中,並自動還原到新增的任何voting disk 。 但是,如果所有voting disk都已損壞,則可以按照“Restoring Voting Disks”中的說明進行還原。


安裝GRID軟體的時候,需要一個DISKGROUP,這個DISKGROUP就是存放OCR和ASM的spfile的,一般這個DISKGROUP專門給到OCR和ASM用,不要放DB的資料檔案,這個DISKGROUP撐死10G空間就夠了


voting disk

A file that manages information about node membership.

管理節點成員資格資訊的檔案。


Oracle Cluster Registry (OCR)

The Oracle RAC configuration information repository that manages information about the cluster node list and instance-to-node mapping information. OCR also manages information about Oracle Clusterware resource profiles for customized applications.

Oracle RAC配置資訊儲存庫,用於管理有關群集節點列表和例項到節點對映資訊的資訊。 OCR還管理有關自定義應用程式的Oracle Clusterware資源配置檔案的資訊。



檢查、新增、替換votedisk資訊

crsctl query css votedisk

crsctl add css votedisk /sharednfs/vote2

crsctl replace votedisk +DATA


ocrdump

ocrconfig -export邏輯匯出的dump開啟是亂碼,所以如果要檢視OCR的內容,只能使用ocrdump

將OCR檔案內容寫入/home/grid/FILE1檔案

ocrdump /home/grid/FILE1


[grid@plmdbb ~]$ crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   4f65321d62a84fa3bf3c652a155a57ee (/dev/plm_db_data) [DATA]

Located 1 voting disk(s).


下面為ASM的spfile檔案

ASMCMD> ls +DATA/plmdb-cluster/ASMPARAMETERFILE/

REGISTRY.253.947607045


下面為OCR檔案

ASMCMD> ls  +DATA/plmdb-cluster/OCRFILE/

REGISTRY.255.947607047


[grid@plmdbb ~]$ ocrcheck

Status of Oracle Cluster Registry is as follows :

         Version                  :          3

         Total space (kbytes)     :     262120

         Used space (kbytes)      :       2896

         Available space (kbytes) :     259224

         ID                       :  129709744

         Device/File Name         :      +DATA

                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check bypassed due to non-privileged user


[grid@plmdbb ~]$ ocrcheck -config

Oracle Cluster Registry configuration is :

         Device/File Name         :      +DATA


[grid@plmdbb ~]$ ocrconfig -showbackup

plmdba     2018/11/01 11:25:13     /u01/app/11.2.0/grid/cdata/plmdb-cluster/backup00.ocr

plmdba     2018/11/01 07:25:13     /u01/app/11.2.0/grid/cdata/plmdb-cluster/backup01.ocr

plmdba     2018/11/01 03:25:13     /u01/app/11.2.0/grid/cdata/plmdb-cluster/backup02.ocr

plmdba     2018/10/30 19:25:11     /u01/app/11.2.0/grid/cdata/plmdb-cluster/day.ocr

plmdba     2018/10/21 15:24:52     /u01/app/11.2.0/grid/cdata/plmdb-cluster/week.ocr

PROT-25: Manual backups for the Oracle Cluster Registry are not available





Restoring Voting Disks

If all of the voting disks are corrupted, then you can restore them, as follows:

1、Restore OCR as described in "Restoring Oracle Cluster Registry", if necessary.

This step is necessary only if OCR is also corrupted or otherwise unavailable, such as if OCR is on Oracle ASM and the disk group is no longer available.


2、Run the following command as root from only one node to start the Oracle Clusterware stack in exclusive mode, which does not require voting files to be present or usable:

# crsctl start crs -excl


3、Run the crsctl query css votedisk command to retrieve the list of voting files currently defined, similar to the following:

This list may be empty if all voting disks were corrupted, or may have entries that are marked as status 3 or OFF.

$ crsctl query css votedisk

--  -----    -----------------                --------- ---------

##  STATE    File Universal Id                File Name Disk group

 1. ONLINE   7c54856e98474f61bf349401e7c9fb95 (/dev/sdb1) [DATA]


4、Depending on where you store your voting files, do one of the following:

4.1、If the voting disks are stored in Oracle ASM, then run the following command to migrate the voting disks to the Oracle ASM disk group you specify:

The Oracle ASM disk group to which you migrate the voting files must exist in Oracle ASM. You can use this command whether the voting disks were stored in Oracle ASM or some other storage device.

crsctl replace votedisk +asm_disk_group

4.2、If you did not store voting disks in Oracle ASM, then run the following command using the File Universal Identifier (FUID) obtained in the previous step:

$ crsctl delete css votedisk FUID

Add a voting disk, as follows:

$ crsctl add css votedisk path_to_voting_disk


5、Stop the Oracle Clusterware stack as root:

If the Oracle Clusterware stack is running in exclusive mode, then use the -f option to force the shutdown of the stack.

# crsctl stop crs


6、Restart the Oracle Clusterware stack in normal mode as root:

# crsctl start crs

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2218401/,如需轉載,請註明出處,否則將追究法律責任。

相關文章