Instalacion de Oracle 26ai- Creacion de ASM

Seguimos con la seria de la instalación de un Oracle 26ai , ahora vamos a por el ASM

El appliance en el que estoy usando de laboratorio es bastante raquítico, con un pequeño disco de 100Gb, por lo que habra que apañarse con lo que tenemos,.
Mi configuracion de disco es :

[root@gigabyte u01]# fdisk -l
Disk /dev/sda: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: KINGSTON SUV400S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00fde38f

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048 156250111 156248064 74.5G 83 Linux
/dev/sda2       156250112 181415935  25165824   12G 82 Linux swap / Solaris

Asi que vamos a crear dos discos pequeños de 5 Gb que pondremos en /dev/sda3 y /dev/sda4 para poder hacer ver que tenemos un DATA y FRA , el disco quedará:

[root@gigabyte ~]# fdisk -l
Disk /dev/sda: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: KINGSTON SUV400S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00fde38f

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048 156250111 156248064 74.5G 83 Linux
/dev/sda2       156250112 181415935  25165824   12G 82 Linux swap / Solaris
/dev/sda3       181415936 191180799   9764864  4.7G 83 Linux
/dev/sda4       191180800 200945663   9764864  4.7G 83 Linux

Descargaremos el asmlib desde
https://www.oracle.com/linux/downloads/linux-asmlib-v9-downloads.html e instalaremos los paquetes.
Una vez instalados,configuraremos el orcleasm

[root@gigabyte ~]# oracleasm configure -i
Configuring the Oracle ASM system service.
This will configure the on-boot properties of the Oracle ASM system
service.  The following questions will determine whether the service
is started on boot and what permissions it will have.  The current
values will be shown in brackets ('[]').  Hitting  without
typing an answer will keep that current value.  Ctrl-C will abort.
Default user to own the ASM disk devices []: grid
Default group to own the ASM disk devices []: asmdba
Start Oracle ASM system service on boot (y/n) [y]: y
Scan for Oracle ASM disks when starting the oracleasm service (y/n) [y]: y
Maximum number of ASM disks that can be used on system [2048]:
Enable iofilter if kernel supports it (y/n) [y]: y
Writing Oracle ASM system service configuration: done

Configuration changes only come into effect after the Oracle ASM
system service is restarted.  Please run 'systemctl restart oracleasm'
after making changes.

WARNING: All of your Oracle and ASM instances must be stopped prior
to restarting the oracleasm service.

[root@gigabyte ~]# systemctl stop oracleasm
[root@gigabyte ~]# systemctl start oracleasm
[root@gigabyte ~]# systemctl status oracleasm
● oracleasm.service - Oracle ASM Service
     Loaded: loaded (/usr/lib/systemd/system/oracleasm.service; enabled; preset: disabled)
     Active: active (exited) since Wed 2026-01-28 17:06:33 CET; 4s ago
    Process: 5027 ExecStartPre=/usr/bin/udevadm settle -t 120 (code=exited, status=0/SUCCESS)
    Process: 5028 ExecStart=/usr/sbin/oracleasm.init start (code=exited, status=0/SUCCESS)
   Main PID: 5028 (code=exited, status=0/SUCCESS)
        CPU: 378ms

Jan 28 17:06:33 gigabyte.pamplona.name systemd[1]: Starting Oracle ASM Service...
Jan 28 17:06:33 gigabyte.pamplona.name oracleasm.init[5042]: Mounting oracleasm driver filesystem: Not applicable with UEK8
Jan 28 17:06:33 gigabyte.pamplona.name oracleasm.init[5053]: Reloading disk partitions: done
Jan 28 17:06:33 gigabyte.pamplona.name oracleasm.init[5053]: Cleaning any stale ASM disks...
Jan 28 17:06:33 gigabyte.pamplona.name oracleasm.init[5053]: Setting up iofilter map for ASM disks: done
Jan 28 17:06:33 gigabyte.pamplona.name oracleasm.init[5065]: Scanning system for ASM disks...
Jan 28 17:06:33 gigabyte.pamplona.name oracleasm.init[5081]: Disk scan successful
Jan 28 17:06:33 gigabyte.pamplona.name systemd[1]: Finished Oracle ASM Service.

Como formatear los discos

crearemos los discos, en mi caso, al ser un pequeño sistema de prueba,estos han de ser particiones en un disco, en el caso de produccion,creariamos una particion única para cada disco.

[root@gigabyte ~]# oracleasm  createdisk DATA01 /dev/sda3
Writing disk header: done
Instantiating disk: done
[root@gigabyte ~]# oracleasm  createdisk FRA01 /dev/sda4
Writing disk header: done
Instantiating disk: done

[root@gigabyte ~]# oracleasm  scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Setting up iofilter map for ASM disks: done
Scanning system for ASM disks...

[root@gigabyte ~]# oracleasm  listdisks
DATA01
FRA01

Evitar problemas con SElinux

Para evitar problemas en los siguientes pasos con con SeLinux, ejecutaremos :

semanage fcontext -a -e /bin /u01/app/grid/bin
semanage fcontext -a -e /lib /u01/app/grid/lib
semanage fcontext -a -e /etc /etc/oracle/scls_scr

Configurar el CRS/HAS

Una vez tenemos los discos creados, procederemos a configurar el CRS,para eso, como root
ejecutaremos:

[root@gigabyte ~]# export GI_HOME=/u01/app/grid
[root@gigabyte ~]#  $GI_HOME/perl/bin/perl -I $GI_HOME/perl/lib -I $GI_HOME/crs/install $GI_HOME/crs/install/roothas.pl
Using configuration parameter file: /u01/app/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/oracle/crsdata/gigabyte/crsconfig/roothas_2026-01-28_05-21-47PM.log
2026/01/28 17:21:52 CLSRSC-363: User ignored prerequisites during installation
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
2026/01/28 17:23:12 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'

gigabyte     2026/01/28 17:25:07     /u01/app/oracle/crsdata/gigabyte/olr/backup_20260128_172507.olr     2107015493
2026/01/28 17:25:09 CLSRSC-327: Successfully configured Oracle Restart for a standalone server

configuracion de oracle net

Como usuario grid iremos a $ORACLE_HOME/network/admin y crearemos los ficheros
sqlnet.ora

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
DIAG_ADR_ENABLED=ON
SQLNET.EXPIRE_TIME= 10
SQLNET.INBOUND_CONNECT_TIMEOUT=60

listener.ora

LISTENER =
   (DESCRIPTION_LIST =
    (DESCRIPTION =
       (ADDRESS = (PROTOCOL = TCP)(HOST = gigabyte.pamplona.name)(PORT = 1521))
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      )
   )
USE_SID_AS_SERVICE_LISTENER=ON
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON
VALID_NODE_CHECKING_REGISTRATION_LISTENER=ON
LOG_FILE_SIZE_LISTENER=50
LOG_FILE_NUM_LISTENER=365

Y despues, crearemos el servicio del listner

grid@gigabyte admin]$ $GI_HOME/bin/srvctl add listener -listener LISTENER -oraclehome  $GI_HOME

grid@gigabyte admin]$ $GI_HOME/bin/srvctl start listener

[grid@gigabyte admin]$ $GI_HOME/bin/crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       gigabyte                 STABLE
ora.ons
               OFFLINE OFFLINE      gigabyte                 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        OFFLINE OFFLINE                               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       gigabyte                 STABLE
--------------------------------------------------------------------------------

creacion del ASM

Ahora crearemos el ASM con:

[grid@gigabyte admin]$ $GI_HOME/bin/asmca -silent \
      -configureASM \
      -sysAsmPassword CHANGE.me.26ai \
      -asmsnmpPassword CHANGE.me.26ai \
      -diskString "ORCL:*"  \
      -diskGroupName DATA \
      -disk "ORCL:DATA*" \
      -param ASM_POWER_LIMIT=1 \
      -param DIAGNOSTIC_DEST=$ORACLE_BASE \
      -param AUDIT_SYS_OPERATIONS=TRUE \
      -redundancy EXTERNAL



ASM has been created and started successfully.

[DBT-30001] Disk groups created successfully. Check /u01/app/oracle/cfgtoollogs/asmca/asmca-260128PM053656.log for details.

Luego, craremos los otros diskgroups al estilo de

$GI_HOME/bin/asmca -silent \
      -createDiskGroup \
      -sysAsmPassword CHANGE.me.26ai \
      -asmsnmpPassword CHANGE.me.26ai \
      -diskString "ORCL:*"  \
      -diskGroupName FRA \
      -disk "ORCL:FRA*" \
      -param ASM_POWER_LIMIT=1 \
      -param DIAGNOSTIC_DEST=$ORACLE_BASE \
      -param AUDIT_SYS_OPERATIONS=TRUE \
      -redundancy EXTERNAL
[DBT-30001] Disk groups created successfully. Check /u01/app/oracle/cfgtoollogs/asmca/asmca-260128PM053938.log for details.

Con esto, ya tendremos el asm creado e instalado en nuestra versio

[grid@gigabyte admin]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       gigabyte                 STABLE
ora.FRA.dg
               ONLINE  ONLINE       gigabyte                 STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       gigabyte                 STABLE
ora.asm
               ONLINE  ONLINE       gigabyte                 Started,STABLE
ora.ons
               OFFLINE OFFLINE      gigabyte                 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       gigabyte                 STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       gigabyte                 STABLE
--------------------------------------------------------------------------------
[grid@gigabyte admin]$ asmcmd lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  1048576      4768     4701                0            4701              0             N  DATA/
MOUNTED  EXTERN  N         512             512   4096  1048576      4768     4704                0            4704              0             N  FRA/

Siguiente paso.. creación de una base de datos 26ai

Usando los bloques logicos en ASM

Hoy vamos a ver una entrada que nos puede causar grandes dolores de cabeza .

Uno de los problemas con los que nos podemos encontrar cuando se modifica la tecnología de los discos físicos utilizados en el ASM es el cambio del tamaño de bloque lógico.

Supongamos que nos ofrecen un nuevo disco /dev/xvdz

Nosotros intentamos añadirlo al ASM, pero recibimos un error ORA-01378

Errors in file /u01/app/oracle/diag/rdbms/test/TEST/trace/TEST_ora_40862.trc:
ORA-01378: The logical block size (512) of file +REDO is not compatible with the disk sector size 
(media sector size is 4096 and host sector size is 4096)

Veamos las características de este disco

sudo fdisk -l /dev/xvdz
Disk /dev/xvdd: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Y veamos ahora otro de los discos que tenemos

The other disks  have sector size 512
Disk /dev/xvdp: 2147.5 GB, 2147483648000 bytes
255 heads, 63 sectors/track, 261083 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Si nos fijamos, el problema que tenemos es que el sector size de nuestro nuevo disco es 8 veces mayor que el del disco viejo (521 / 4096) .

Como solucionamos ahora nuestro problema?

Tal y como indican el el blog flashdba ASM tiene un parámetro en el fichero de configuración llamado ORACLEASM_USE_LOGICAL_BLOCK_SIZE que por defecto esta a false, que era el parámetro por defecto de oracleasm-support-2.1.8.
Podemos ver su valor en el fichero /etc/sysconfig/oracleasm

# ORACLEASM_USE_LOGICAL_BLOCK_SIZE: 'true' means use the logical block size
# reported by the underlying disk instead of the physical. The default
# is 'false'
ORACLEASM_USE_LOGICAL_BLOCK_SIZE=false

Lo que vamos ha hacer es modificarlo a TRUE, de manera que el ASM sea capaz de usar los bloques de manera lógica y no se aferre a la configuración física de los mismos, esto lo hacemos con el script
oracleasm-configure.sh

  • -b|—logical-blocks sets logical blocksize usage
  • -p|—physical-blocks set physical blocksize usage

Veamos ahora cual es la información que nos dará nuestro ASM

[oracle@testserver ~]$ sysasm
 SQL> select NAME,SECTOR_SIZE,BLOCK_SIZE,DATABASE_COMPATIBILITY,COMPATIBILITY,((TOTAL_MB-FREE_MB)*100/TOTAL_MB) PERCENT_USED from v$asm_diskgroup;

NAME         SECTOR_SIZE BLOCK_SIZE DATABASE_COMPATIBILI COMPATIBILITY        PERCENT_USED
-------------------- --------- ---------- -------------------- -------------------- ------------
REDO               4096       4096 10.1.0.0.0           10.1.0.0.0             .249023438
FRA                 512       4096 10.1.0.0.0           12.1.0.0.0             44.1858724
DATA                512       4096 11.2.0.0.0           11.2.0.0.0             90.4637587

Como podeis ver, es un problema que se nos puede dar en bases de datos con ASM antiguos en los que llevemos a cabo un cambio de tecnología física.

Mas informacion en

Oracle ASMLib: Physical and Logical Blocksize

kernel.panic_on_oops : Nuevo parametro de la 12c

Hoy vamos a ver otra de estas pequeñas sorpresas de Oracle en las nuevas versiones
En los requisitos de la instalacion de la version 12c de Oracle nos encontramos con la siguiente nota

Note: 
The below Kernel Parameter "panic_on_oops=1" is being Introduced and required
 from 12.1.0.2.0 onwards.
kernel.panic_on_oops=1

Que es lo que hace este parametro del Kernel?
Este parametro simplemente controla el comportamiento del kernec cuando un oops or bug es detectado.

Los valores que puede tomar es:

  • 0: INtenta continuar la operacion
  • 1: Entra en panic , ademas de este panica, si el sysctl es distnto de cero, entonces el servidor se reiniciara

Como veis, un parametro bastante inocuo… hasta que buscamos la causa de por que el servidor se ha reiniciado

Alarmas ioctl 2285 en Linux

Hoy vamos a ver una entrada rápida para tranquilizarnos ante algunos errores.
Tras las Entradas anteriores en las que usabamos una particion y ASMlib para los discos ASM, he recibido preguntas de administradores que se encuentran en el dmesg o en el messajes con erroers del tipo

oracle: sending ioctl 2285 to a partition!
oracle: sending ioctl 2285 to a partition!
oracle: sending ioctl 2285 to a partition!
oracle: sending ioctl 2285 to a partition!
oracle: sending ioctl 2285 to a partition!
oracle: sending ioctl 2285 to a partition!
oracle: sending ioctl 2285 to a partition!
oracle: sending ioctl 2285 to a partition!
oracle: sending ioctl 2285 to a partition!

Estos mensajes que en un principio pueden asustar un poco, pueden ser ignorados con tranquilidad.
Parece ser que son errores específicos si usamos la version UEK del kernel Enterprise Kernel for Oracle Linux y que están solventados en el 2.6.39-400.100.0.el6uek

Más información

Limpiando kernels antiguos (vaciar /boot)

Hoy vamos a ver una entrada muy rápida sobre como vaciar el /boot en Oracle Linux.

A medida que vamos actualizando nuestro servidor puede darse el caso de que tengamos varias versiones antiguas del kernel y se nos llene la particion dedicada /boot
Como solucionamos esto?
Con una utilidad muy sencilla llamada package-cleanup

Si queremos mantener 2 kernels en el /boot solo habremos de ejeutar

[root@server ~]#  package-cleanup --oldkernels --count=2
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-504.1.3.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved
.
.

Remove        1 Package(s)

Installed size: 124 M
Is this ok [y/N]: Y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : kernel-2.6.32-504.1.3.el6.x86_64                                                                                                                                                                                          1/1
  Verifying  : kernel-2.6.32-504.1.3.el6.x86_64                                                                                                                                                                                          1/1

Removed:
  kernel.x86_64 0:2.6.32-504.1.3.el6

Complete!

Como véis, rápido y sencillo