Archive for February, 2011

restoring OCR and Voting disks in 11g R2 after Disk group corruption

February 9, 2011 Leave a comment

In oracle clusterware 11g Release 2 you no longer have to backup the voting disk , The voting disk is automatically backed up in the OCR as part of the configuration change and is automatically restored to any voting disk added.

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

Stop the database and the cluster

-- stop the database

#srvctl stop database -d tstracdb

-- List the nodes in your cluster by running the following


-- stop the clusterware by running the following command as root on all nodes 

#crsctl stop crs

-- if the preceding command fails due to OCR corruption , run the following command as root

#crsctl stop crs -f

-- if the processes still fail to stop  disable the cluster AUTO start and reboot

#crsctl disable crs


Recreate ASM Diskgroup

--This command FAILS because asmca is not able to update the OCR:
asmca -silent -createDiskGroup -diskGroupName OCRVOTING  -disk '/dev/oracle/asm.25.lun' -disk '/dev/oracle/asm.26.lun'  -disk '/dev/oracle/asm.27.lun'  -disk '/dev/oracle/asm.28.lun'  -disk '/dev/oracle/asm.29.lun'  -redundancy HIGH -compatible.asm ''  -compatible.rdbms '' -compatible.advm ''

--Create the Diskgroup Using SQLPLUS Create Diskgroup and save the ASM spfile inside:
create Diskgroup OCRVOTING high redundancy disk '/dev/oracle/asm.25.lun',
'/dev/oracle/asm.26.lun', '/dev/oracle/asm.27.lun',
'/dev/oracle/asm.28.lun', '/dev/oracle/asm.29.lun'
ATTRIBUTE  'compatible.asm'='', 'compatible.rdbms'='';

create spfile='+OCRVOTING' from pfile='/tmp/asm_pfile.ora';
File created.
SQL> shut immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 1069252608 bytes
Fixed Size                  2154936 bytes
Variable Size            1041931848 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted

Restore ocr and voting disk from backup

--List backup

#ocrconfig -showbackup

-- check intregity of the backup

#ocrdump -backupfile  <backup_file_name> 

-- restore OCR from backup

#/u01/GRID/11.2/bin/ocrconfig -restore /u01/GRID/11.2/cdata/cluster01/backup00.ocr

--Check the OCR status after restore:

-- Restore the voting Disk

# /u01/GRID/11.2/bin/crsctl replace votedisk +OCRVOTING

-- Re_enable CRS auto startup

# /u01/GRID/11.2/bin/crsctl enable crs

-- start CRS on host1

# /u01/GRID/11.2/bin/crsctl start crs

--Start CRS on host2

# /u01/GRID/11.2/bin/crsctl start crs

-- Check all the resources are running

#/u01/GRID/11.2/bin/crsctl stat res -t
Categories: Oracle Rac

ORA-01157: cannot identify/lock data file

February 6, 2011 Leave a comment



SQL> alter database open;
alter database open

ERROR at line 1:
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/u01/app/oracle/product/11.2.0/db_1/dbs/soe.dbf'

If you come across the above  error and the datafile does not exist on the filesystem and you cant open the database , either recover the datafile using rman or so the following


SQL>alter database datafile 7 OFFLINE DROP;
SQL>alter database open;

Categories: Oracle

Fixing ORA-19809: limit exceeded for recovery files

February 4, 2011 Leave a comment

happens when the flash recovery is full

two options

1. make the flash recovery area larger,

2. remove some files from the flash recovery area using rman

Explanation on how to do this is decribed on this site

Categories: Oracle