Infrastructure at your Service

Franck Pachot

OCM 12c preparation: restore Voting disks, OCR and ASM spfile

By Franck Pachot

.
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

OCR

Here are the OCR backups:


[[email protected] ~]# ocrconfig -showbackuploc
The Oracle Cluster Registry backup location is [/u01/app/12.1.0/grid_1/cdata/]
[[email protected] ~]# 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     0

We need to stop Grid Infrastructure on all nodes


[[email protected] ~]# crsctl stop crs -f
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
 
[[email protected] ~]# 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


[[email protected] ~]# 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

[[email protected] ~]# crsctl start crs -excl -nocrs

Then we are able to restore the OCR:


[[email protected] grid]# ocrconfig -restore /u01/app/12.1.0/grid_1/cdata/ws-dbi/backup_20151123_095343.ocr

Voting disks

Here are my voting disks:


[[email protected] 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:


[[email protected] grid]# crsctl delete css votedisk +DATA
CRS-4611: Successful deletion of voting disk +DATA.

[[email protected] 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

ASM spfile

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.896481653

But I can get the non-default parameters from the alert.log:


[[email protected] ~]# adrci exec='set home +ASM1 ; show alert'
G
?non-default

and 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:


[[email protected] ~]$ 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.

Now ready to restart the cluster:


[[email protected] grid]# crsctl stop crs -f
[[email protected] grid]# crsctl start crs

One Comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Franck Pachot
Franck Pachot

Principal Consultant / Database Evangelist