Ask Me

Oracle RAC OCR and Voting Disk Replacement

 1. Currently i am having one voting disk, Since the diskgroup data configured with External Redundancy .I could not add new voting disk.


[oragrid@node2 ~]$ crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   463612408dbd4f0cbf65955f3ac3ef9c (/dev/oracleasm/disks/ASMDISK5) [DATA]

Located 1 voting disk(s).

[oragrid@node2 ~]$ exit


2. So I need to create  separate diskgroup with Normal redudancy ( It will have 2 mirror copy mean 2 failed group for each disk) 

so we can have 3 Votedisk files.


3. Added a disk /dev/sdd in to my VM and created logical partion .

[root@node2 ~]# fdisk -l /dev/sdd


Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x539955a3


   Device Boot      Start         End      Blocks   Id  System

/dev/sdd1            2048     2097151     1047552    5  Extended

/dev/sdd5            4096      686079      340992   83  Linux

/dev/sdd6          688128     1370111      340992   83  Linux

/dev/sdd7         1372160     2054143      340992   83  Linux


4. Create asm disks.


[root@node2 ~]# oracleasm createdisk OCRVD1 /dev/sdd5

Writing disk header: done

Instantiating disk: done

[root@node2 ~]# oracleasm createdisk OCRVD2 /dev/sdd6

Writing disk header: done

Instantiating disk: done

[root@node2 ~]# oracleasm createdisk OCRVD3 /dev/sdd7

Writing disk header: done

Instantiating disk: done

[root@node2 ~]# oracleasm scandisks

Reloading disk partitions: done

Cleaning any stale ASM disks...

Scanning system for ASM disks...

[root@node2 ~]# oracleasm listdisks

ASMDISK10

ASMDISK11

ASMDISK12

ASMDISK13

ASMDISK14

ASMDISK5

ASMDISK6

ASMDISK7

ASMDISK8

ASMDISK9

OCRVD1

OCRVD2

OCRVD3

[root@node2 ~]#

[root@node2 ~]#


5.  CREATE DISKGROUP OCRVD NORMAL REDUNDANCY  DISK '/dev/oracleasm/disks/OCRVD1' SIZE 333M

 DISK '/dev/oracleasm/disks/OCRVD2' SIZE 333M

 DISK '/dev/oracleasm/disks/OCRVD3' SIZE 333M


SQL> select NAME,STATE,TYPE,TOTAL_MB from v$asm_diskgroup;


NAME                           STATE       TYPE     TOTAL_MB

------------------------------ ----------- ------ ----------

DATA                           MOUNTED     EXTERN      18432

OCRVD                          MOUNTED     NORMAL      996


SQL>


6. Replace new votedisk.


[oragrid@node2 trace]$ crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   463612408dbd4f0cbf65955f3ac3ef9c (/dev/oracleasm/disks/ASMDISK5) [DATA]

Located 1 voting disk(s).

[oragrid@node2 trace]$ crsctl replace votedisk +OCRVD

Successful addition of voting disk 4219d4f7a49b4fb3bf9601cc89f87794.

Successful addition of voting disk 95cb9d0d75384fc3bf0a5aae2752b422.

Successful addition of voting disk 715d2fbc57e44f62bf959e61915db38a.

Successful deletion of voting disk 463612408dbd4f0cbf65955f3ac3ef9c.

Successfully replaced voting disk group with +OCRVD.

CRS-4266: Voting file(s) successfully replaced

[oragrid@node2 trace]$ crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   4219d4f7a49b4fb3bf9601cc89f87794 (/dev/oracleasm/disks/OCRVD1) [OCRVD]

 2. ONLINE   95cb9d0d75384fc3bf0a5aae2752b422 (/dev/oracleasm/disks/OCRVD2) [OCRVD]

 3. ONLINE   715d2fbc57e44f62bf959e61915db38a (/dev/oracleasm/disks/OCRVD3) [OCRVD]

Located 3 voting disk(s).

[oragrid@node2 trace]$



7. OCR addition:


[oragrid@node2 trace]$ ocrcheck

Status of Oracle Cluster Registry is as follows :

         Version                  :          4

         Total space (kbytes)     :     491684

         Used space (kbytes)      :      84440

         Available space (kbytes) :     407244

         ID                       :  939418504

         Device/File Name         :      +DATA

                                    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 bypassed due to non-privileged user


[oragrid@node2 trace]$ ocrconfig -add +OCRVD

PROT-20: Insufficient permission to proceed. Require privileged user

[oragrid@node2 trace]$ which ocrconfig

/opt/app/grid19c/bin/ocrconfig

[oragrid@node2 trace]$ exit

logout

[root@node2 ~]# /opt/app/grid19c/bin/ocrconfig -add +OCRVD

[root@node2 ~]# /opt/app/grid19c/bin/ocrcheck

Status of Oracle Cluster Registry is as follows :

         Version                  :          4

         Total space (kbytes)     :     491684

         Used space (kbytes)      :      84440

         Available space (kbytes) :     407244

         ID                       :  939418504

         Device/File Name         :      +DATA

                                    Device/File integrity check succeeded

         Device/File Name         :     +OCRVD

                                    Device/File integrity check succeeded


                                    Device/File not configured


                                    Device/File not configured


                                    Device/File not configured


         Cluster registry integrity check succeeded


         Logical corruption check succeeded


[root@node2 ~]#

[root@node2 ~]# /opt/app/grid19c/bin/ocrconfig -replace +DATA -replacement +OCRVD

PROT-34: The Oracle Cluster Registry location to be deleted is not configured.

[root@node2 ~]# /opt/app/grid19c/bin/ocrconfig -add +DATA

[root@node2 ~]# /opt/app/grid19c/bin/ocrconfig -delete +OCRVD

[root@node2 ~]# /opt/app/grid19c/bin/ocrcheck

Status of Oracle Cluster Registry is as follows :

         Version                  :          4

         Total space (kbytes)     :     491684

         Used space (kbytes)      :      84440

         Available space (kbytes) :     407244

         ID                       :  939418504

         Device/File Name         :      +DATA

                                    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


[root@node2 ~]# /opt/app/grid19c/bin/ocrconfig -replace +DATA -replacement +OCRVD

PROT-28: Cannot delete or replace the only configured Oracle Cluster Registry location.

[root@node2 ~]# /opt/app/grid19c/bin/ocrconfig -add +DATA

PROT-29: The Oracle Cluster Registry location is already configured

[root@node2 ~]# /opt/app/grid19c/bin/ocrconfig -add +OCRVD

[root@node2 ~]# /opt/app/grid19c/bin/ocrconfig -delete +DATA

[root@node2 ~]# /opt/app/grid19c/bin/ocrcheck

Status of Oracle Cluster Registry is as follows :

         Version                  :          4

         Total space (kbytes)     :     491684

         Used space (kbytes)      :      84440

         Available space (kbytes) :     407244

         ID                       :  939418504

         Device/File Name         :     +OCRVD

                                    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


[root@node2 ~]#

[root@node2 ~]#



Linux : Create filesystem using LVM

 Linux : Create filesystem using LVM

  1. Add disk to your host , here for an example i have added new disk (/dev/sdd)
  2. pvcreate initializes PhysicalVolume for later use by the Logical Volume Manager (LVM). Each PhysicalVolume can be a disk partition, whole disk, meta device, or loopback file              pvcreate /dev/sdd
  3. See the physical volumes by running
                [root@node1 ~]# pvs
                  PV         VG   Fmt  Attr PSize   PFree
                  /dev/sda2  rhel lvm2 a--  <19.51g     0
                  /dev/sdb   op   lvm2 a--  <30.00g 96.00m
                  /dev/sdd        lvm2 ---   30.00g 30.00
   4. Create Volume group 
            [root@node1 ~]# vgcreate oradumps /dev/sdd
              Volume group "oradumps" successfully created
            [root@node1 ~]# vgs
              VG       #PV #LV #SN Attr   VSize   VFree
              op         1   1   0 wz--n- <30.00g  96.00m
              oradumps   1   0   0 wz--n- <30.00g <30.00g
              rhel       1   3   0 wz--n- <19.51g      0
   5.  Create Logical volume group.
       [root@node1 ~]# lvcreate -L 29.9G -n oradumps1 oradumps
          Rounding up size to full physical extent 29.90 GiB
          Logical volume "oradumps1" created.
       [root@node1 ~]# lvs
           LV      VG    Attr       LSize   Pool Origin Data%  Meta%             Move Log Cpy%Sync Convert
          op-app    op       -wi-ao----  29.90g
          oradumps1 oradumps -wi-a-----  29.90g
          root      rhel     -wi-ao---- <14.51g
          swap      rhel     -wi-ao----   3.00g
          tmp       rhel     -wi-ao----   2.00g
   6. Format the filesystem with xfs formating.
    [root@node1 ~]# mkfs.xfs /dev/oradumps/oradumps1
    meta-data=/dev/oradumps/oradumps1 isize=512    agcount=4, agsize=1959680 blks
             =                       sectsz=512   attr=2, projid32bit=1
             =                       crc=1        finobt=0, sparse=0
    data     =                       bsize=4096   blocks=7838720, imaxpct=25
             =                       sunit=0      swidth=0 blks
    naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
    log      =internal log           bsize=4096   blocks=3827, version=2
             =                       sectsz=512   sunit=0 blks, lazy-count=1
    realtime =none                   extsz=4096   blocks=0, rtextents=0

7. Create a directory and mount the filesystem and add to /etc/fstab for permanent mount

[root@node1 ~]# mkdir /oradumps

[root@node1 ~]# mount /dev/oradumps/oradumps1 /oradumps

[root@node1 ~]# df -h /oradumps

Filesystem                      Size  Used Avail Use% Mounted on

/dev/mapper/oradumps-oradumps1   30G   33M   30G   1% /oradumps

[root@node1 ~]# grep oradumps /etc/fstab

/dev/oradumps/oradumps1 /oradumps               xfs     defaults        0 0

[root@node1 ~]#


Note : Command to validate the list of device with partitions.
[root@node1 ~]# lsblk
NAME                 MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                    8:0    0   20G  0 disk
├─sda1                 8:1    0  500M  0 part /boot
└─sda2                 8:2    0 19.5G  0 part
  ├─rhel-root        253:0    0 14.5G  0 lvm  /
  ├─rhel-swap        253:2    0    3G  0 lvm  /swap
  └─rhel-tmp         253:3    0    2G  0 lvm  /tmp
sdb                    8:16   0   30G  0 disk
└─op-op--app         253:1    0 29.9G  0 lvm  /opt/app
sdc                    8:32   0   30G  0 disk
├─sdc1                 8:33   0    1K  0 part
├─sdc5                 8:37   0    3G  0 part
├─sdc6                 8:38   0    3G  0 part
├─sdc7                 8:39   0    3G  0 part
├─sdc8                 8:40   0    3G  0 part
├─sdc9                 8:41   0    3G  0 part
├─sdc10                8:42   0    3G  0 part
├─sdc11                8:43   0    3G  0 part
├─sdc12                8:44   0    3G  0 part
├─sdc13                8:45   0    3G  0 part
└─sdc14                8:46   0    3G  0 part
sdd                    8:48   0   30G  0 disk
└─oradumps-oradumps1 253:4    0 29.9G  0 lvm
sr0                   11:0    1 1024M  0 rom

Popular Posts