viernes, 5 de julio de 2019

Agregar raw device al oracle rac


En el siguiente ejemplo nos piden agregar 2 luns


 ora1]# rescan-scsi-bus.sh
Scanning SCSI subsystem for new devices
Scanning host 0 for  SCSI target IDs  0 1 2 3 4 5 6 7, all LUNs
 Scanning for device 0 0 0 0 ... 0 ...
OLD: Host: scsi0 Channel: 00 Id: 00 Lun: 00
      Vendor: HP       Model: LOGICAL VOLUME   Rev: 4.52
      Type:   Direct-Access                    ANSI SCSI revision: 05
 Scanning for device 0 3 0 0 ... 0 ...
OLD: Host: scsi0 Channel: 03 Id: 00 Lun: 00
      Vendor: HP       Model: P440ar           Rev: 4.52
      Type:   RAID                             ANSI SCSI revision: 05
Scanning host 1 for  all SCSI target IDs, all LUNs
 Scanning for device 1 0 0 0 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 00
      Vendor: EMC      Model: Invista          Rev: 5520
      Type:   Direct-Access                    ANSI SCSI revision: 04
 Scanning for device 1 0 0 1 ...

ACA CORTO LA SALIDA PORQUE ES MUY LARGA

8 new or changed device(s) found.
        [1:0:0:31]
        [1:0:0:32]
        [1:0:1:31]
        [1:0:1:32]
        [2:0:0:31]
        [2:0:0:32]
        [2:0:1:31]
        [2:0:1:32]
0 remapped or resized device(s) found.
0 device(s) removed.

Si el procedimiento de arriba no funciona o no esta instalado el rescan-scsi-bus.sh , copiar y pegar el script siguiente :

for s in $(ls /sys/class/scsi_host)
        do
        FILE="/sys/class/fc_host/$s/issue_lip"
        if [ -f $FILE ];
        then
                        echo $s "lip"
                        echo "1" > /sys/class/fc_host/$s/issue_lip
        #else
                        #echo "File $FILE no existe"
        fi
        FILE="/sys/class/scsi_host/$s/scan"
        if [ -f $FILE ];
        then
                        echo $s "scan"
                        echo "- - -" > /sys/class/scsi_host/$s/scan
        #else
           #echo "File $FILE does not exist."
        fi
        sleep 3
        done

Ahora chequeo en Ambos Nodos, si en la salida del multipath -ll veo las luns que me asigno storage

[ ora1 ]# multipath -F; multipath -v2
Jul 05 14:19:09 | mp_fra02: map in use
Jul 05 14:19:09 | mp_redo01: map in use
Jul 05 14:19:09 | mp_fra01: map in use
Jul 05 14:19:09 | mp_scannetfs: map in use
Jul 05 14:19:09 | mp_data12: map in use
Jul 05 14:19:09 | mp_data09: map in use
Jul 05 14:19:09 | mp_data11: map in use
Jul 05 14:19:09 | mp_data08: map in use
Jul 05 14:19:09 | mp_data10: map in use
Jul 05 14:19:09 | mp_data07: map in use
Jul 05 14:19:09 | mp_data06: map in use
Jul 05 14:19:09 | mp_data05: map in use
Jul 05 14:19:09 | mp_data04: map in use
Jul 05 14:19:09 | mp_u01: map in use
Jul 05 14:19:09 | mp_ocr03: map in use
Jul 05 14:19:09 | mp_data03: map in use
Jul 05 14:19:09 | mp_u00: map in use
Jul 05 14:19:09 | mp_fra04: map in use
Jul 05 14:19:09 | mp_data02: map in use
Jul 05 14:19:09 | mp_ocr02: map in use
Jul 05 14:19:09 | mp_fra03: map in use
Jul 05 14:19:09 | mp_redo02: map in use
Jul 05 14:19:09 | mp_data01: map in use
Jul 05 14:19:09 | mp_ocr01: map in use
Jul 05 14:19:09 | mpatha: ignoring map
create: mp_data13 (36000144000000010601ec9b99d38f9ec) undef EMC,Invista
size=310G features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
  |- 1:0:0:31 sdct 70:16  undef ready running
  |- 2:0:0:31 sdcx 70:80  undef ready running
  |- 1:0:1:31 sdcv 70:48  undef ready running
  `- 2:0:1:31 sdcz 70:112 undef ready running
create: mp_data14 (36000144000000010601ec9b99d38f9f0) undef EMC,Invista
size=310G features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
  |- 1:0:0:32 sdcu 70:32  undef ready running
  |- 2:0:0:32 sdcy 70:96  undef ready running
  |- 1:0:1:32 sdcw 70:64  undef ready running
  `- 2:0:1:32 sdda 70:128 undef ready running
[ora1]#

[ora1]# multipath -F; multipath -v2
Jul 05 14:20:57 | mp_fra02: map in use
Jul 05 14:20:57 | mp_redo01: map in use
Jul 05 14:20:57 | mp_fra01: map in use
Jul 05 14:20:57 | mp_scannetfs: map in use
Jul 05 14:20:57 | mp_data12: map in use
Jul 05 14:20:57 | mp_data09: map in use
Jul 05 14:20:57 | mp_data11: map in use
Jul 05 14:20:57 | mp_data08: map in use
Jul 05 14:20:57 | mp_data10: map in use
Jul 05 14:20:57 | mp_data07: map in use
Jul 05 14:20:57 | mp_data06: map in use
Jul 05 14:20:57 | mp_data05: map in use
Jul 05 14:20:57 | mp_data04: map in use
Jul 05 14:20:57 | mp_u01: map in use
Jul 05 14:20:57 | mp_data03: map in use
Jul 05 14:20:57 | mp_ocr03: map in use
Jul 05 14:20:57 | mp_u00: map in use
Jul 05 14:20:57 | mp_fra04: map in use
Jul 05 14:20:57 | mp_data02: map in use
Jul 05 14:20:57 | mp_ocr02: map in use
Jul 05 14:20:57 | mp_fra03: map in use
Jul 05 14:20:57 | mp_redo02: map in use
Jul 05 14:20:57 | mp_data01: map in use
Jul 05 14:20:57 | mp_ocr01: map in use
Jul 05 14:20:57 | mpatha: ignoring map
create: mp_data13 (36000144000000010601ec9b99d38f9ec) undef EMC,Invista
size=310G features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
  |- 1:0:0:31 sdct 70:16  undef ready running
  |- 2:0:0:31 sdcx 70:80  undef ready running
  |- 1:0:1:31 sdcv 70:48  undef ready running
  `- 2:0:1:31 sdcz 70:112 undef ready running
create: mp_data14 (36000144000000010601ec9b99d38f9f0) undef EMC,Invista
size=310G features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
  |- 1:0:0:32 sdcu 70:32  undef ready running
  |- 2:0:0:32 sdcy 70:96  undef ready running
  |- 1:0:1:32 sdcw 70:64  undef ready running
  `- 2:0:1:32 sdda 70:128 undef ready running
[ora1]#

[~]# multipath -ll|grep -i 00010601ec9b99d38f9ec
mpathz (36000144000000010601ec9b99d38f9ec) dm-57 EMC,Invista
[root@plscannetora1 ~]# multipath -ll|grep -i 00010601ec9b99d38f9f0
mpathaa (36000144000000010601ec9b99d38f9f0) dm-58 EMC,Invista
[ora1]#

Chequeo lo mismo en el otro nodo del rac

[ora2 ~]# multipath -ll|grep -i 00010601ec9b99d38f9ec
mpathz (36000144000000010601ec9b99d38f9ec) dm-57 EMC,Invista
[root@plscannetora2 ~]# multipath -ll|grep -i 00010601ec9b99d38f9f0
mpathaa (36000144000000010601ec9b99d38f9f0) dm-58 EMC,Invista
[ora2 ~]#

En ambos nodos del rac, hago un bkp del multipath.conf

[ora1]# cp multipath.conf multipath.conf.ant

[ora2 ]# ls -l multipath.conf
-rw-r--r-- 1 root root 6433 May 22  2018 multipath.conf
[ora2 ]# cp multipath.conf multipath.conf.ant


En AMBOS nodos del rac ,edito el multipath.conf , y agrego la lun con el nombre que me indico base de datos, en este ejemplo el nombre que pidieron fue mp_data13 y mp_data14

multipath {
                wwid                    36000144000000010601ec9b99d38f9ec
                alias                   mp_data13
        }
        multipath {
                wwid                    36000144000000010601ec9b99d38f9f0
                alias                   mp_data14
        }


Luego en uno de los nodos ejecuto el fdisk pero con la opcion -u para poder generar :

[ora1 ~]# fdisk -u /dev/mapper/mp_data13

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c').

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First sector (63-650119679, default 63): 128
Last sector, +sectors or +size{K,M,G} (128-650119679, default 650119679):
Using default value 650119679

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 83

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 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[ora1 ~]#

[ora1 ~]# fdisk -u /dev/mapper/mp_data14

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c').

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First sector (63-650119679, default 63): 128
Last sector, +sectors or +size{K,M,G} (128-650119679, default 650119679):
Using default value 650119679

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 83

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 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[ora1 ~]#

Solo en uno de los nodos , por ultimo ejecutar

[ora1 ~]# partprobe /dev/mapper/mp_data13
[ora1 ~]# partprobe /dev/mapper/mp_data14

chequeamos en el /dev/mapper/ como quedaron o si tienen reglas udev ( si las tienen aparece como owner oracle:grid , en ese caso hay que agregar en el /etc/udev...)

[ora1 ~]# ls -ltr /dev/mapper/mp_data1*
lrwxrwxrwx 1 root root 8 Jan  8 08:14 /dev/mapper/mp_data10 -> ../dm-11
lrwxrwxrwx 1 root root 8 Jan  8 08:14 /dev/mapper/mp_data11 -> ../dm-13
lrwxrwxrwx 1 root root 8 Jan  8 08:14 /dev/mapper/mp_data12 -> ../dm-28
lrwxrwxrwx 1 root root 8 Jan  8 08:15 /dev/mapper/mp_data10p1 -> ../dm-30
lrwxrwxrwx 1 root root 8 Jan  8 08:15 /dev/mapper/mp_data11p1 -> ../dm-36
lrwxrwxrwx 1 root root 8 Jan  8 08:15 /dev/mapper/mp_data12p1 -> ../dm-43
lrwxrwxrwx 1 root root 8 Jul  5 14:46 /dev/mapper/mp_data13p1 -> ../dm-59
lrwxrwxrwx 1 root root 8 Jul  5 14:46 /dev/mapper/mp_data13 -> ../dm-57
lrwxrwxrwx 1 root root 8 Jul  5 14:46 /dev/mapper/mp_data14p1 -> ../dm-60
lrwxrwxrwx 1 root root 8 Jul  5 14:46 /dev/mapper/mp_data14 -> ../dm-58
[ora1 ~]# 

En el otro nodo del rac, ejecutar un multipath -F ; multipath -v2 para que tome lo que ejecute en el otro nodo cuando hice el partprobe

[ora2 ~]# multipath -F; multipath -v2
Jul 05 15:25:38 | mp_fra02: map in use
Jul 05 15:25:38 | mp_redo01: map in use
Jul 05 15:25:38 | mp_fra01: map in use
Jul 05 15:25:38 | mp_scannetfs: map in use
Jul 05 15:25:38 | mp_data12: map in use
Jul 05 15:25:38 | mp_data09: map in use
Jul 05 15:25:38 | mp_data11: map in use
Jul 05 15:25:38 | mp_data08: map in use
Jul 05 15:25:38 | mp_data10: map in use
Jul 05 15:25:38 | mp_data07: map in use
Jul 05 15:25:38 | mp_data06: map in use
Jul 05 15:25:38 | mp_data05: map in use
Jul 05 15:25:38 | mp_data04: map in use
Jul 05 15:25:38 | mp_u01: map in use
Jul 05 15:25:38 | mp_data03: map in use
Jul 05 15:25:38 | mp_ocr03: map in use
Jul 05 15:25:38 | mp_u00: map in use
Jul 05 15:25:38 | mp_fra04: map in use
Jul 05 15:25:38 | mp_data02: map in use
Jul 05 15:25:38 | mp_ocr02: map in use
Jul 05 15:25:38 | mp_fra03: map in use
Jul 05 15:25:38 | mp_redo02: map in use
Jul 05 15:25:38 | mp_data01: map in use
Jul 05 15:25:38 | mp_ocr01: map in use
Jul 05 15:25:38 | mpatha: ignoring map
create: mp_data13 (36000144000000010601ec9b99d38f9ec) undef EMC,Invista
size=310G features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
  |- 1:0:0:31 sdct 70:16  undef ready running
  |- 2:0:0:31 sdcx 70:80  undef ready running
  |- 1:0:1:31 sdcv 70:48  undef ready running
  `- 2:0:1:31 sdcz 70:112 undef ready running
create: mp_data14 (36000144000000010601ec9b99d38f9f0) undef EMC,Invista
size=310G features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
  |- 1:0:0:32 sdcu 70:32  undef ready running
  |- 2:0:0:32 sdcy 70:96  undef ready running
  |- 1:0:1:32 sdcw 70:64  undef ready running
  `- 2:0:1:32 sdda 70:128 undef ready running
[ora2 ~]# 

No hay comentarios:

Publicar un comentario

Comentarios