{
  "date": "2015-12-21T15:43:50",
  "slug": "ocm-12c-preparation-restore-voting-disks-ocr-and-asm-spfile",
  "link": "https://www.dbi-services.com/blog/ocm-12c-preparation-restore-voting-disks-ocr-and-asm-spfile/",
  "title": {
    "rendered": "OCM 12c preparation: restore Voting disks, OCR and ASM spfile"
  },
  "content": {
    "rendered": "<h2>By Franck Pachot</h2>\n<p>.<br />\nAs 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&#8217;s what I&#8217;m doing while preparing the OCM 12c exam, but without any clue about what will be at the exam.<br />\n<!--more--><br />\nFor more details, it&#8217;s in the MOS note <a href=\"https://support.oracle.com/epmos/faces/DocumentDisplay?id=1062983.1\" target=\"_blank\" rel=\"noopener noreferrer\">1062983.1</a></p>\n<h3>OCR</h3>\n<p>Here are the OCR backups:</p>\n<pre><code>\n[root@racp1vm1 ~]# ocrconfig -showbackuploc\nThe Oracle Cluster Registry backup location is [/u01/app/12.1.0/grid_1/cdata/]\n[root@racp1vm1 ~]# ocrconfig -showbackup\n&nbsp;\nracp1vm1     2015/11/24 17:23:27     /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup00.ocr     3467666221\nracp1vm1     2015/11/24 13:23:26     /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup01.ocr     3467666221\nracp1vm1     2015/11/24 09:23:26     /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup02.ocr     3467666221\nracp1vm1     2015/11/23 07:14:45     /u01/app/12.1.0/grid_1/cdata/ws-dbi/day.ocr     0\nracp1vm1     2015/11/23 07:14:45     /u01/app/12.1.0/grid_1/cdata/ws-dbi/week.ocr     0\nracp1vm1     2015/12/18 20:28:50     /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151218_202850.ocr     3467666221\nracp1vm1     2015/12/18 20:28:42     /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151218_202842.ocr     3467666221\nracp1vm1     2015/12/18 20:28:40     /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151218_202840.ocr     3467666221\nracp1vm1     2015/11/23 09:53:43     /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151123_095343.ocr     3467666221\nracp1vm1     2015/11/23 01:33:18     /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151123_013318.ocr     0\n</code></pre>\n<p>We need to stop Grid Infrastructure on all nodes</p>\n<pre><code>\n[root@racp1vm1 ~]# crsctl stop crs -f\nCRS-4639: Could not contact Oracle High Availability Services\nCRS-4000: Command Stop failed, or completed with errors.\n&nbsp;\n[root@racp1vm1 ~]# crsctl stop crs -f\nCRS-4639: Could not contact Oracle High Availability Services\nCRS-4000: Command Stop failed, or completed with errors.\n</code></pre>\n<p>and start it in exclusive mode without starting CRSD</p>\n<pre><code>\n[root@racp1vm1 ~]# crsctl start crs -h\nUsage:\n  crsctl start crs [-excl [-nocrs] [-cssonly]] | [-wait | -waithas | -nowait] | \n&nbsp;\n[-noautostart]\n     Start OHAS on this server\nwhere\n     -excl        Start Oracle Clusterware in exclusive mode\n     -nocrs       Start Oracle Clusterware in exclusive mode without starting CRS\n     -nowait      Do not wait for OHAS to start\n     -wait        Wait until startup is complete and display all progress and \n&nbsp;\nstatus messages\n     -waithas     Wait until startup is complete and display OHASD progress and \n&nbsp;\nstatus messages\n     -cssonly     Start only CSS\n     -noautostart Start only OHAS\n</code></pre>\n<pre><code>\n[root@racp1vm1 ~]# crsctl start crs -excl -nocrs\n</code></pre>\n<p>Then we are able to restore the OCR:</p>\n<pre><code>\n[root@racp1vm1 grid]# ocrconfig -restore /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151123_095343.ocr\n</code></pre>\n<h3>Voting disks</h3>\n<p>Here are my voting disks:</p>\n<pre><code>\n[root@racp1vm1 grid]# crsctl query css votedisk\n$##  STATE    File Universal Id                File Name Disk group\n--  -----    -----------------                --------- ---------\n 1. ONLINE   22bf1a8f5f634fafbf521c83d8bf5982 (/dev/sdb1) [DATA]\nLocated 1 voting disk(s).\n</code></pre>\n<p>I can delete it and re-create it:</p>\n<pre><code>\n[root@racp1vm1 grid]# crsctl delete css votedisk +DATA\nCRS-4611: Successful deletion of voting disk +DATA.\n</code></pre>\n<pre><code>\n[root@racp1vm1 grid]# crsctl replace votedisk +DATA\nSuccessful addition of voting disk 67ad2282347d4f77bf2151e0a7c10105.\nSuccessfully replaced voting disk group with +DATA.\nCRS-4266: Voting file(s) successfully replaced\n</code></pre>\n<h3>ASM spfile</h3>\n<p>Here I&#8217;m removing the ASM spfile withotu having a backup:</p>\n<pre><code>\nASMCMD&gt; spget\n+DATA/ws-dbi/ASMPARAMETERFILE/registry.253.896481653\nASMCMD&gt; rm +DATA/ws-dbi/ASMPARAMETERFILE/registry.253.896481653\n</code></pre>\n<p>But I can get the non-default parameters from the alert.log:</p>\n<pre><code>\n[root@racp1vm1 ~]# adrci exec='set home +ASM1 ; show alert'\nG\n?non-default\n</code></pre>\n<p>and paste them to a pfile. Note that I have to add the instance_type which is not listed as non-default:</p>\n<pre><code>\ncat &gt; /tmp/spfile.txt\n  large_pool_size          = 12M\n  remote_login_passwordfile= \"EXCLUSIVE\"\n  asm_diskgroups           = \"ACFSDG\"\n  asm_diskgroups           = \"FRA\"\n  asm_power_limit          = 1\ninstance_type='asm'\n</code></pre>\n<p>Then re-create spfile:</p>\n<pre><code>\n[grid@racp1vm1 ~]$ sqlplus / as sysasm\n&nbsp;\nSQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 18 21:35:25 2015\n&nbsp;\nCopyright (c) 1982, 2014, Oracle.  All rights reserved.\n&nbsp;\nConnected to:\nOracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production\nWith the Real Application Clusters and Automatic Storage Management options\n&nbsp;\nSQL&gt; create spfile='+DATA' from pfile='/tmp/spfile.txt';\nFile created.\n</code></pre>\n<h3>Now ready to restart the cluster:</h3>\n<pre><code>\n[root@racp1vm1 grid]# crsctl stop crs -f\n[root@racp1vm1 grid]# crsctl start crs\n</code></pre>\n",
    "protected": false
  }
}
