Separando o OCR e o Voting Disk em um novo Diskgroup (Grid 11g,12c,18c,19c)




Este procedimento está sendo realizado em um ambiente Oracle Grid 19c. Porém é possível ser realizado desde a versão 11g.

Vale lembrar que por questão se disponibilidade e melhores praticas o diskgroup do OCR e Votting Disk devem ter redundância tanto no ASM quanto no storage.

Inicialmente para verificar o diskgroup onde o OCR está localizado deve-se exportar as variáveis do Grid e executar o comando ocrcheck

Conforme abaixo, podemos constatar que o mesmo está localizado no DGREDO.

[oracle@lamimdb01 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          4
         Total space (kbytes)     :     491684
         Used space (kbytes)      :      84536
         Available space (kbytes) :     407148
         ID                       : 1014714349
         Device/File Name         :    +DGREDO
                                    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

[oracle@lamimdb01 ~]$

Através do comando crsctl query css votedisk podemos validar o caminho do voting disk. Neste caso também no DGREDO.

[oracle@lamimdb01 ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   457bc5592a044f68bf2e84d7ccb705a7 (/dev/oracleasm/disks/DGREDO003) [DGREDO]
Located 1 voting disk(s).
[oracle@lamimdb01 ~]$

Estarei criando um novo diskgroup chamado DGOCR com os discos que havia criado via oracleasm em outra oportunidade.

[oracle@lamimdb01 ~]$ oracleasm listdisks | grep DGOCR
DGOCR001
DGOCR002
DGOCR003
[oracle@lamimdb01 ~]$

Para criar o diskgroup é necessário conectar no grid com as sysasm.

[oracle@lamimdb01 ~]$ sqlplus / as sysasm

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 7 19:53:50 2020
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> set line 210
col path for a45
select name, mount_status, header_status, mode_status, label, path, total_mb, free_mb from v$asm_disk where PATH like '%DGOCR%';
SQL> SQL>
NAME                           MOUNT_S HEADER_STATU MODE_ST LABEL                           PATH                                            TOTAL_MB    FREE_MB
------------------------------ ------- ------------ ------- ------------------------------- --------------------------------------------- ---------- ----------
                               CLOSED  PROVISIONED  ONLINE                                  /dev/oracleasm/disks/DGOCR002                          0          0
                               CLOSED  PROVISIONED  ONLINE                                  /dev/oracleasm/disks/DGOCR001                          0          0
                               CLOSED  PROVISIONED  ONLINE                                  /dev/oracleasm/disks/DGOCR003                          0          0

SQL> CREATE DISKGROUP DGOCR NORMAL REDUNDANCY DISK '/dev/oracleasm/disks/DGOCR001','/dev/oracleasm/disks/DGOCR002','/dev/oracleasm/disks/DGOCR003';

Diskgroup created.

SQL> !
[oracle@lamimdb01 ~]$

Vale lembrar que o diskgroup criado vai estar disponível apenas no node onde o processo foi executado. Sendo necessário iniciar e ativar nos demais nodes do cluster.

[oracle@lamimdb01 ~]$ srvctl status diskgroup -g DGOCR
Disk Group DGOCR is running on lamimdb01
[oracle@lamimdb01 ~]$ srvctl start diskgroup -g DGOCR -n lamimdb02
[oracle@lamimdb01 ~]$ srvctl enable diskgroup -g DGOCR -n lamimdb02
[oracle@lamimdb01 ~]$
[oracle@lamimdb01 ~]$  srvctl status diskgroup -g DGOCR
Disk Group DGOCR is running on lamimdb01,lamimdb02
[oracle@lamimdb01 ~]$

Inicialmente vamos adicionar o novo diskgroup ao OCR e posteriormente remover o antigo. Este processo deve ser executado com o root, exportando as variáveis do Grid.

[root@lamimdb01 ~]# . /etc/ambiente_ora_grid.sh
[root@lamimdb01 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          4
         Total space (kbytes)     :     491684
         Used space (kbytes)      :      84556
         Available space (kbytes) :     407128
         ID                       : 1014714349
         Device/File Name         :    +DGREDO
                                    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@lamimdb01 ~]# ocrconfig -add +DGOCR
[root@lamimdb01 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          4
         Total space (kbytes)     :     491684
         Used space (kbytes)      :      84556
         Available space (kbytes) :     407128
         ID                       : 1014714349
         Device/File Name         :    +DGREDO
                                    Device/File integrity check succeeded
         Device/File Name         :     +DGOCR
                                    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@lamimdb01 ~]# ocrconfig -delete +DGREDO
[root@lamimdb01 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          4
         Total space (kbytes)     :     491684
         Used space (kbytes)      :      84556
         Available space (kbytes) :     407128
         ID                       : 1014714349
         Device/File Name         :     +DGOCR
                                    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@lamimdb01 ~]#

Por fim, iremos mover o Voting Disk. Este processo também deve ser executado com o root.

[root@lamimdb01 ~]# crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   457bc5592a044f68bf2e84d7ccb705a7 (/dev/oracleasm/disks/DGREDO003) [DGREDO]
Located 1 voting disk(s).
[root@lamimdb01 ~]# crsctl replace votedisk +DGOCR
Successful addition of voting disk f70a8f1d25784fe6bf3c21b9b76fd744.
Successful addition of voting disk 1ccc821b66294fa4bfd9208e834d8435.
Successful addition of voting disk 0887878f5dce4fccbf876b79455e2a78.
Successful deletion of voting disk 457bc5592a044f68bf2e84d7ccb705a7.
Successfully replaced voting disk group with +DGOCR.
CRS-4266: Voting file(s) successfully replaced
[root@lamimdb01 ~]# crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   f70a8f1d25784fe6bf3c21b9b76fd744 (/dev/oracleasm/disks/DGOCR001) [DGOCR]
 2. ONLINE   1ccc821b66294fa4bfd9208e834d8435 (/dev/oracleasm/disks/DGOCR002) [DGOCR]
 3. ONLINE   0887878f5dce4fccbf876b79455e2a78 (/dev/oracleasm/disks/DGOCR003) [DGOCR]
Located 3 voting disk(s).
[root@lamimdb01 ~]#


Comentários