Adicionando Disco no Linux e Adicionando Disco no ASM non-RAC.

https://www.vertaglia.com/0rsf3ulb2 Este artigo tem como objetivo explicar como adicionar um disco no Linux para adição de Disco no Disco de Grupo no ASM.
Informações:
– Oracle Enterprise Linux 5.7 32 Bits.
– Oracle Database 10g (10.2.0.5.4).
– Utilizando Udev para as rawdevices.

https://someawesomeminecraft.com/2024/05/13/9e2pfvm Com o usuário “root” vamos adicionar o disco récem adicionado no servidor de Banco de Dados.

enter site
Vamos verificar os rawdevices já configurados.

Buy Diazepam 2Mg Online [root@serveroracle ~]# cat /etc/udev/rules.d/60-raw.rules # Enter raw device bindings here. # # An example would be: # ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N" # to bind /dev/raw/raw1 to /dev/sda, or # ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m" # to bind /dev/raw/raw2 to the device with major 8, minor 1. ACTION=="add", KERNEL=="/dev/sdb1", RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add", KERNEL=="/dev/sdc1", RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add", KERNEL=="/dev/sdd1", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="/dev/sde1", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="/dev/sdf1", RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add", KERNEL=="/dev/sdg1", RUN+="/bin/raw /dev/raw/raw6 %N" ACTION=="add", KERNEL=="/dev/sdh1", RUN+="/bin/raw /dev/raw/raw7 %N" ACTION=="add", KERNEL=="/dev/sdi1", RUN+="/bin/raw /dev/raw/raw8 %N" [root@serveroracle ~]#

watch Vamos verificar os discos.

go to site [root@serveroracle ~]# ls -l /dev/sd* brw-r----- 1 root disk 8, 0 Mar 16 14:05 /dev/sda brw-r----- 1 root disk 8, 1 Mar 16 14:06 /dev/sda1 brw-r----- 1 root disk 8, 2 Mar 16 14:06 /dev/sda2 brw-r----- 1 root disk 8, 3 Mar 16 14:06 /dev/sda3 brw-r----- 1 root disk 8, 4 Mar 16 14:05 /dev/sda4 brw-r----- 1 root disk 8, 5 Mar 16 14:06 /dev/sda5 brw-r----- 1 root disk 8, 6 Mar 16 14:06 /dev/sda6 brw-r----- 1 root disk 8, 7 Mar 16 14:05 /dev/sda7 brw-r----- 1 root disk 8, 8 Mar 16 14:06 /dev/sda8 brw-r----- 1 root disk 8, 16 Mar 16 14:05 /dev/sdb brw-r----- 1 root disk 8, 17 Mar 16 14:05 /dev/sdb1 brw-r----- 1 root disk 8, 32 Mar 16 14:05 /dev/sdc brw-r----- 1 root disk 8, 33 Mar 16 14:05 /dev/sdc1 brw-r----- 1 root disk 8, 48 Mar 16 14:05 /dev/sdd brw-r----- 1 root disk 8, 49 Mar 16 14:05 /dev/sdd1 brw-r----- 1 root disk 8, 64 Mar 16 14:05 /dev/sde brw-r----- 1 root disk 8, 65 Mar 16 14:05 /dev/sde1 brw-r----- 1 root disk 8, 80 Mar 16 14:05 /dev/sdf brw-r----- 1 root disk 8, 81 Mar 16 14:05 /dev/sdf1 brw-r----- 1 root disk 8, 96 Mar 16 14:05 /dev/sdg brw-r----- 1 root disk 8, 97 Mar 16 14:05 /dev/sdg1 brw-r----- 1 root disk 8, 112 Mar 16 14:05 /dev/sdh brw-r----- 1 root disk 8, 113 Mar 16 14:05 /dev/sdh1 brw-r----- 1 root disk 8, 128 Mar 16 14:05 /dev/sdi brw-r----- 1 root disk 8, 129 Mar 16 14:05 /dev/sdi1 brw-r----- 1 root disk 8, 144 Mar 16 14:05 /dev/sdj [root@serveroracle ~]#

https://aguasamazonicas.org/1q9kncok Conforme acima foi adicionado o disco “/dev/sdj”. Vamos criar uma partição no mesmo e configurá-lo como um dispositivo raw.

https://annmorrislighting.com/hjrltq3 [root@serveroracle ~]# fdisk /dev/sdj Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-522, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-522, default 522): Using default value 522 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. [root@serveroracle ~]# ls -l /dev/sdj* brw-r----- 1 root disk 8, 144 Mar 16 14:11 /dev/sdj brw-r----- 1 root disk 8, 145 Mar 16 14:11 /dev/sdj1 [root@serveroracle ~]#

https://templedavid.org/symons/yh0rwgbd4 Vamos verificar o arquivo “/etc/udev/rules.d/60-raw.rules” e adicionar o disco “/dev/sdj1” para o novo dispositivo para a raw “/dev/raw/raw9”.

https://photovisions.ca/q61pa6lo [root@serveroracle ~]# cat /etc/udev/rules.d/60-raw.rules # Enter raw device bindings here. # # An example would be: # ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N" # to bind /dev/raw/raw1 to /dev/sda, or # ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m" # to bind /dev/raw/raw2 to the device with major 8, minor 1. ACTION=="add", KERNEL=="/dev/sdb1", RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add", KERNEL=="/dev/sdc1", RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add", KERNEL=="/dev/sdd1", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="/dev/sde1", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="/dev/sdf1", RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add", KERNEL=="/dev/sdg1", RUN+="/bin/raw /dev/raw/raw6 %N" ACTION=="add", KERNEL=="/dev/sdh1", RUN+="/bin/raw /dev/raw/raw7 %N" ACTION=="add", KERNEL=="/dev/sdi1", RUN+="/bin/raw /dev/raw/raw8 %N" [root@serveroracle ~]# vi /etc/udev/rules.d/60-raw.rules [root@serveroracle ~]# cat /etc/udev/rules.d/60-raw.rules # Enter raw device bindings here. # # An example would be: # ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N" # to bind /dev/raw/raw1 to /dev/sda, or # ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m" # to bind /dev/raw/raw2 to the device with major 8, minor 1. ACTION=="add", KERNEL=="/dev/sdb1", RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add", KERNEL=="/dev/sdc1", RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add", KERNEL=="/dev/sdd1", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="/dev/sde1", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="/dev/sdf1", RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add", KERNEL=="/dev/sdg1", RUN+="/bin/raw /dev/raw/raw6 %N" ACTION=="add", KERNEL=="/dev/sdh1", RUN+="/bin/raw /dev/raw/raw7 %N" ACTION=="add", KERNEL=="/dev/sdi1", RUN+="/bin/raw /dev/raw/raw8 %N" ACTION=="add", KERNEL=="/dev/sdj1", RUN+="/bin/raw /dev/raw/raw9 %N" [root@serveroracle ~]#

https://aaerj.org.br/2024/05/13/606nv7toa5 Explicação:
ACTION==”add” (Adiciona o Dispositivo no Script).
KERNEL==”/dev/sdb1? (Dispositivo a ser adicionado).
RUN+=”/bin/raw /dev/raw/raw1 %N (Aonde será executado).
ACTION==”add”, KERNEL==”/dev/sdb1?, RUN+=”/bin/raw /dev/raw/raw1 %N” (Chama udev que quando é detectado o drive é adicionado, executa o script especificado).

https://grannysglasses.com/?p=9zk8hfhaugw Vamos iniciar a raw adicionada no seu específico dispositivo.

source site [root@serveroracle ~]# /bin/raw /dev/raw/raw9 /dev/sdj1 /dev/raw/raw9: bound to major 8, minor 145 [root@serveroracle ~]#

here Vamos configurar o arquivo “/etc/sysconfig/rawdevices”, adicionar a nova raw para o mesmo e reiniciar o serviço rawdevices.

https://thegreathighway.com/b403ka2pmku [root@serveroracle ~]# vi /etc/sysconfig/rawdevices [root@serveroracle ~]# cat /etc/sysconfig/rawdevices # raw device bindings # format: <rawdev> <major> <minor> # <rawdev> <blockdev> # example: /dev/raw/raw1 /dev/sda1 # /dev/raw/raw2 8 5 /dev/raw/raw1 /dev/sdb1 /dev/raw/raw2 /dev/sdc1 /dev/raw/raw3 /dev/sdd1 /dev/raw/raw4 /dev/sde1 /dev/raw/raw5 /dev/sdf1 /dev/raw/raw6 /dev/sdg1 /dev/raw/raw7 /dev/sdh1 /dev/raw/raw8 /dev/sdi1 /dev/raw/raw9 /dev/sdj1 [root@serveroracle ~]# /sbin/service rawdevices restart Assigning devices: /dev/raw/raw1 --> /dev/sdb1 /dev/raw/raw1: bound to major 8, minor 17 /dev/raw/raw2 --> /dev/sdc1 /dev/raw/raw2: bound to major 8, minor 33 /dev/raw/raw3 --> /dev/sdd1 /dev/raw/raw3: bound to major 8, minor 49 /dev/raw/raw4 --> /dev/sde1 /dev/raw/raw4: bound to major 8, minor 65 /dev/raw/raw5 --> /dev/sdf1 /dev/raw/raw5: bound to major 8, minor 81 /dev/raw/raw6 --> /dev/sdg1 /dev/raw/raw6: bound to major 8, minor 97 /dev/raw/raw7 --> /dev/sdh1 /dev/raw/raw7: bound to major 8, minor 113 /dev/raw/raw8 --> /dev/sdi1 /dev/raw/raw8: bound to major 8, minor 129 /dev/raw/raw9 --> /dev/sdj1 /dev/raw/raw9: bound to major 8, minor 145 done [root@serveroracle ~]#

https://someawesomeminecraft.com/2024/05/13/r29z7fgyoe1 Vamos garantir privilégio para o usuário “oracle” do grupo “dba” para todas rawdevices e mudar o arquivo “/etc/udev/rules.d/99-raw-perms.rules” adicionando mais a rawdevice em questão.

go here [root@serveroracle ~]# chown -R oracle.dba /dev/raw/raw[1-9] [root@serveroracle ~]# chmod 660 /dev/raw/raw[1-9] [root@serveroracle ~]# ls -ltr /dev/raw/raw* crw-rw---- 1 oracle dba 162, 3 Mar 16 14:15 /dev/raw/raw3 crw-rw---- 1 oracle dba 162, 1 Mar 16 14:15 /dev/raw/raw1 crw-rw---- 1 oracle dba 162, 4 Mar 16 14:15 /dev/raw/raw4 crw-rw---- 1 oracle dba 162, 5 Mar 16 14:15 /dev/raw/raw5 crw-rw---- 1 oracle dba 162, 2 Mar 16 14:15 /dev/raw/raw2 crw-rw---- 1 oracle dba 162, 9 Mar 16 14:15 /dev/raw/raw9 crw-rw---- 1 oracle dba 162, 8 Mar 16 14:15 /dev/raw/raw8 crw-rw---- 1 oracle dba 162, 6 Mar 16 14:15 /dev/raw/raw6 crw-rw---- 1 oracle dba 162, 7 Mar 16 14:15 /dev/raw/raw7 [root@serveroracle ~]# cat /etc/udev/rules.d/99-raw-perms.rules KERNEL=="raw[1-8]", MODE="0660", GROUP="dba", OWNER="oracle" [root@serveroracle ~]# vi /etc/udev/rules.d/99-raw-perms.rules [root@serveroracle ~]# cat /etc/udev/rules.d/99-raw-perms.rules KERNEL=="raw[1-9]", MODE="0660", GROUP="dba", OWNER="oracle" [root@serveroracle ~]#

Buy Diazepam 2Mg Online Com o Banco de Dados aberto, vamos verificar o Disco de Grupo que deve ser adicionado o disco, no caso, “DGDADOS”.

https://photovisions.ca/4eeg198 SQL> set lines 155 set pagesize 1000 SQL> SQL> col NAME for a11 SQL> col "DISK NAME" for a15 SQL> select a.NAME, a.TOTAL_MB, a.FREE_MB, b.NAME "DISK NAME", b.READS, b.WRITES, b.BYTES_READ/1024/1024/1024 BR_GB, b.BYTES_WRITTEN/1024/1024/1024 BW_GB 2 from v$asm_diskgroup a join v$asm_disk b 3 on(a.GROUP_NUMBER=b.GROUP_NUMBER) 4 and a.NAME = 'DGDADOS'; NAME TOTAL_MB FREE_MB DISK NAME READS WRITES BR_GB BW_GB ----------- ---------- ---------- --------------- ---------- ---------- ---------- ---------- DGDADOS 8188 1538 DGDADOS_0000 1748 101 .019668579 .001434326 DGDADOS 8188 1538 DGDADOS_0001 1251 101 .014060974 .001434326 SQL> disc Disconnected from Oracle Database 10g Release 10.2.0.5.0 - Production SQL> exit [oracle@serveroracle ~]$

get link Na instância “ASM” vamos adicionar o disco no Disco de Grupo “DGDADOS”.

follow link [oracle@serveroracle ~]$ export ORACLE_SID=+ASM [oracle@serveroracle ~]$ sqlplus sys/***** as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Fri Mar 16 14:23:33 2012 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Release 10.2.0.5.0 - Production SQL> alter diskgroup DGDADOS add DISK '/dev/raw/raw9'; Diskgroup altered. SQL> exit Disconnected from Oracle Database 10g Release 10.2.0.5.0 - Production [oracle@serveroracle ~]$

here Na instância “DBPROD” vamos verificar o disco no Disco de Grupo “DGDADOS” récem adicionado e subir o Enterprise Manager (Veja as Imagens abaixo).

https://www.vertaglia.com/vuqm0nh13rt [oracle@serveroracle ~]$ export ORACLE_SID=dbprod [oracle@serveroracle ~]$ sqlplus sys/***** as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Fri Mar 16 14:23:50 2012 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Release 10.2.0.5.0 - Production SQL> set lines 155 SQL> set pagesize 1000 col NAME for a11 SQL> col "DISK NAME" for a15 select a.NAME, a.TOTAL_MB, a.FREE_MB, b.NAME "DISK NAME", b.READS, b.WRITES, b.BYTES_READ/1024/1024/1024 BR_GB, b.BYTES_WRITTEN/1024/1024/1024 BW_GB from v$asm_diskgroup a join v$asm_disk b on(a.GROUP_NUMBER=b.GROUP_NUMBER) and a.NAME = 'DGDADOS';SQL> SQL> 2 3 4 NAME TOTAL_MB FREE_MB DISK NAME READS WRITES BR_GB BW_GB ----------- ---------- ---------- --------------- ---------- ---------- ---------- ---------- DGDADOS 12282 5580 DGDADOS_0000 1817 146 .020706177 .002120972 DGDADOS 12282 5580 DGDADOS_0001 1265 146 .014228821 .002120972 DGDADOS 12282 5580 DGDADOS_0002 0 0 0 0 SQL> / NAME TOTAL_MB FREE_MB DISK NAME READS WRITES BR_GB BW_GB ----------- ---------- ---------- --------------- ---------- ---------- ---------- ---------- DGDADOS 12282 5564 DGDADOS_0000 3286 687 .035858154 .010055542 DGDADOS 12282 5564 DGDADOS_0001 3520 646 .035194397 .009140015 DGDADOS 12282 5564 DGDADOS_0002 1123 416 .013534546 .005737305 SQL>

https://pkuatm.org/2024/05/13/6tpguleug Pronto adicionamos o novo disco no Disco de Grupo “DGDADOS”.

%name Adicionando Disco no Linux e Adicionando Disco no ASM non RAC.

Autor: Maycon Tomiasi

https://aaerj.org.br/2024/05/13/p8gw9um7u

https://dentaris-sa.com/2024/05/13/apwji0dr Formado em Tecnologia da Informação na FIPP (Faculdade de Informática de Presidente Prudente), Analista DBA Oracle pela Teiko Soluções em Tecnologia da Informação, residente em Blumenau/ SC, Certificado OCP 10g/11g/12c, OCS 11g Implementation, OCE 11g Performance Tuning, OCE 11g RAC & GRID e OPN Specialist. Conhecimentos em PHP.