This was first published on https://blog.dbi-services.com/ocm-12c-preparation-restore-voting-disks-ocr-and-asm-spfile (2015-12-21)
Republishing here for new followers. The content is related to the the versions available at the publication date
As in the previous posts, here are a few commands I used to check that I know how to restore the cluster mandatory files in 12c. It’s what I’m doing while preparing the OCM 12c exam, but without any clue about what will be at the exam. For more details, it’s in the MOS note 1062983.1
Here are the OCR backups:
[root@racp1vm1 ~]# ocrconfig -showbackuploc The Oracle Cluster Registry backup location is [/u01/app/12.1.0/grid_1/cdata/] [root@racp1vm1 ~]# ocrconfig -showbackup racp1vm1 2015/11/24 17:23:27 /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup00.ocr 3467666221 racp1vm1 2015/11/24 13:23:26 /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup01.ocr 3467666221 racp1vm1 2015/11/24 09:23:26 /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup02.ocr 3467666221 racp1vm1 2015/11/23 07:14:45 /u01/app/12.1.0/grid_1/cdata/ws-dbi/day.ocr 0 racp1vm1 2015/11/23 07:14:45 /u01/app/12.1.0/grid_1/cdata/ws-dbi/week.ocr 0 racp1vm1 2015/12/18 20:28:50 /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151218_202850.ocr 3467666221 racp1vm1 2015/12/18 20:28:42 /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151218_202842.ocr 3467666221 racp1vm1 2015/12/18 20:28:40 /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151218_202840.ocr 3467666221 racp1vm1 2015/11/23 09:53:43 /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151123_095343.ocr 3467666221 racp1vm1 2015/11/23 01:33:18 /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151123_013318.ocr 0We need to stop Grid Infrastructure on all nodes
[root@racp1vm1 ~]# crsctl stop crs -f CRS-4639: Could not contact Oracle High Availability Services CRS-4000: Command Stop failed, or completed with errors. [root@racp1vm1 ~]# crsctl stop crs -f CRS-4639: Could not contact Oracle High Availability Services CRS-4000: Command Stop failed, or completed with errors.and start it in exclusive mode without starting CRSD
[root@racp1vm1 ~]# crsctl start crs -h Usage: crsctl start crs [-excl [-nocrs] [-cssonly]] | [-wait | -waithas | -nowait] | [-noautostart] Start OHAS on this server where -excl Start Oracle Clusterware in exclusive mode -nocrs Start Oracle Clusterware in exclusive mode without starting CRS -nowait Do not wait for OHAS to start -wait Wait until startup is complete and display all progress and status messages -waithas Wait until startup is complete and display OHASD progress and status messages -cssonly Start only CSS -noautostart Start only OHAS
[root@racp1vm1 ~]# crsctl start crs -excl -nocrsThen we are able to restore the OCR:
[root@racp1vm1 grid]# ocrconfig -restore /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151123_095343.ocr
Here are my voting disks:
[root@racp1vm1 grid]# crsctl query css votedisk $## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 22bf1a8f5f634fafbf521c83d8bf5982 (/dev/sdb1) [DATA] Located 1 voting disk(s).I can delete it and re-create it:
[root@racp1vm1 grid]# crsctl delete css votedisk +DATA CRS-4611: Successful deletion of voting disk +DATA.
[root@racp1vm1 grid]# crsctl replace votedisk +DATA Successful addition of voting disk 67ad2282347d4f77bf2151e0a7c10105. Successfully replaced voting disk group with +DATA. CRS-4266: Voting file(s) successfully replaced
Here I’m removing the ASM spfile withotu having a backup:
ASMCMD> spget +DATA/ws-dbi/ASMPARAMETERFILE/registry.253.896481653 ASMCMD> rm +DATA/ws-dbi/ASMPARAMETERFILE/registry.253.896481653But I can get the non-default parameters from the alert.log:
[root@racp1vm1 ~]# adrci exec='set home +ASM1 ; show alert' G ?non-defaultand paste them to a pfile. Note that I have to add the instance_type which is not listed as non-default:
cat > /tmp/spfile.txt large_pool_size = 12M remote_login_passwordfile= "EXCLUSIVE" asm_diskgroups = "ACFSDG" asm_diskgroups = "FRA" asm_power_limit = 1 instance_type='asm'Then re-create spfile:
[grid@racp1vm1 ~]$ sqlplus / as sysasm SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 18 21:35:25 2015 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Real Application Clusters and Automatic Storage Management options SQL> create spfile='+DATA' from pfile='/tmp/spfile.txt'; File created.
[root@racp1vm1 grid]# crsctl stop crs -f [root@racp1vm1 grid]# crsctl start crs