• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Move OCR, Vote Disk File, ASM SPILE to new Diskgroup

by admin

The goal here is to move OCR, voting disk file and ASM spfile in a Grid Infrastructure with RAC cluster to a new ASM disk group. One example would be that you have created these components in the +DATA diskgroup and you wish to move the OCR, Vote File and ASM spfile to a NORMAL or HIGH redundant diskgroup. Basic steps to move to the new diskgroup are outlined below:

  1. Create New diskgroup(CRS) with suitable redundancy for OCR and Voting files.
  2. Ensure that the new diskgroup is mounted on all cluster nodes.
  3. Move OCR and Vote file from [Current diskgroup] to [CRS].
  4. Change ASM SPFILE location from [current diskgroup] to [CRS] Diskgroup.
  5. Mount new [CRS] diskgroup in all nodes and restart CRS in all Nodes to Startup CRS using New SPFILE from [CRS] Diskgroup.
  6. Verify mount of disks and diskgroups.
  7. Ensure ALL Cluster Resources are started successfully .

Assumptions

Below assumptions are made:
1. OCR,Voting Disks and ASM SPFILE is originally stored in a Diskgroup +DATA.
2. $ORACLE_HOME points to GRID HOME.
3. Cluster is up and running in all nodes of RAC.

NOTE: In the examples the disks name/paths are specific to ASMLIB configuration on Linux platform. Your configuration disks path could be different, depending on the platform/OS you use.

Create New CRS Disk Group

Login as SYSASM using SQLPLUS into ASM instance on one of the nodes and run below command:

SQL> create diskgroup CRS normal redundancy disk 'ORCL:DISK4' ,'ORCL:DISK5' ,'ORCL:DISK6' 
attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0';

Diskgroup created.

Mount the CRS Disk Group on all the nodes

If the diskgroup you are moving the OCR to is not online on all nodes, then the ocr.loc file on those nodes where the Diskgroup is not online will not be updated. This will prevent CRS from restarting on those nodes that the diskgroup is not online. And the ocr.loc file may need manual intervention. Thus make sure the diskgroup is mounted on all the nodes.

SQL> alter diskgroup CRS mount;
SQL> select name, state, type from v$asm_diskgroup;

Move OCR and Vote file from [Current diskgroup] to [CRS]

Next step is to move the OCT and Voting Disk files from the current disk group to the new disk group we have just created. Follow the below commands to perform the movement.
Run as Root user

# $ORACLE_HOME/bin/ocrconfig -add +CRS
# $ORACLE_HOME/bin/ocrconfig -delete +DATA
# $ORACLE_HOME/bin/crsctl replace votedisk +CRS

Successful addition of voting disk 9d351cfdbef64facbfe2d1519880ef33.
Successful addition of voting disk 302c23b19e864f92bfa68eda9045e5cc.
Successful addition of voting disk 6eeca4920acb4f8fbf6ec5a4e2b8ea7b.
Successful deletion of voting disk 32f7d65cf17d4fa3bf2932998251635f.
Successful deletion of voting disk 10c31fb0891d4f5abfb38ef34cd49f4d.
Successful deletion of voting disk 7d6f7d6480554f01bfc2621a3adb8f5f.
Successfully replaced voting disk group with +CRS.
CRS-4266: Voting file(s) successfully replaced
 $ORACLE_HOME/bin/crsctl query css votedisk

## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 9d351cfdbef64facbfe2d1519880ef33 (ORCL:DISK4) [CRS]
2. ONLINE 302c23b19e864f92bfa68eda9045e5cc (ORCL:DISK5) [CRS]
3. ONLINE 6eeca4920acb4f8fbf6ec5a4e2b8ea7b (ORCL:DISK6) [CRS]
Located 3 voting disk(s).
# $ORACLE_HOME/bin/ocrcheck

Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2804
Available space (kbytes) : 259316
ID : 1778064925
Device/File Name : +CRS
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 succeeded

Change the ASM spfile location

1. Next is to Change ASM SPFILE location from [Current diskgroup] to [CRS] Diskgroup. Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:

SQL> create pfile='/tmp/init/init' from spfile;
SQL> create spfile='+CRS' from pfile='/tmp/init/init';

2. Now GPNPTOOL will get updated with new ASM SPFILE location. That can be verified by below command:
As grid user or root

$ORACLE_HOME/bin/gpnptool get
How to move ASM spfile to a different disk group

Restart CRS

1. Double check if you have mounted the CRS disk group in all the RAC nodes. If not, mount using below command.

SQL> alter diskgroup CRS mount;

2. Restart CRS in all nodes to startup CRS using new SPFILE from [CRS] diskgroup:

$ crsctl stop crs
$ crsctl start crs

Verify the mounting of CRS disk group

Verify the mount of the CRS diskgroup and its disks using the below commands:

SQL> select name,path,group_number,header_status,total_mb,free_mb from v$asm_disk;

NAME PATH GROUP_NUMBER HEADER_STATU TOTAL_MB FREE_MB
------------------------------ ------------------------------ ------------ ------------ ---------- ----------
DATA1 ORCL:DATA1 2 MEMBER 15109 9982
DATA2 ORCL:DATA2 2 MEMBER 15109 9982
DATA3 ORCL:DATA3 1 MEMBER 15109 9982
DATA4 ORCL:DATA4 3 MEMBER 15109 9982
DISK4 ORCL:DISK4 3 MEMBER 860 576
DISK5 ORCL:DISK5 3 MEMBER 668 376
DISK6 ORCL:DISK6 3 MEMBER 668 372
SQL> select name,state,usable_file_mb,total_mb,free_mb,required_mirror_free_mb from v$asm_diskgroup;

NAME STATE USABLE_FILE_MB TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB
------------------------------ ----------- -------------- ---------- ---------- -----------------------
DATA MOUNTED 9982 15109 9982 0
CRS MOUNTED 552 2448 1400 296

Verify all cluster resources

Ensure ALL Cluster resources are started successfully using below commands:

$ORACLE_HOME/bin/crsctl stat res -init -t
$ORACLE_HOME/bin/crsctl check cluster -all
$ORACLE_HOME/bin/crsctl stat res -t
How to Migrate ASM Disk Groups to another Storage Online [When ASMLIB Devices Are Involved]
How to Migrate ASM Disk Groups to another Storage Online [non ASMLIB Devices]

Filed Under: ASM, oracle, Oracle 11g, oracle 12c

Some more articles you might also be interested in …

  1. How to Use Startup, Shutdown, and Alter Database commands in Oracle 12c
  2. Queries to find out the SQL which is using these temporary tablespace
  3. Beginners Guide to Oracle Password Management Policy
  4. How To Add New Disk to An Existing Diskgroup on RAC Cluster or Standalone ASM Configuration
  5. How to Rename Diskgroup having OCR, Vote File and SPILE
  6. Extend rule sets by using factors in Oracle Database Vault
  7. How to Rename the Default JSESSIONID in WebLogic
  8. Where to find ASMLib / oracleasm RPMs for CentOS/RHEL, SUSE, OEL
  9. How to Drop/Truncate Multiple Partitions in Oracle 12C
  10. SQL*Plus Editing Commands

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright