Comunidad Oracle Hispana

Instalar Oracle ASM 11g Oracle Linux 7.1 (requiere parche)

Para instalar ASM en Linux 7.1 se debe instalar un parche para configurar los servicios.

Estos son los pasos para realizar la instalacion

Crear el usuario grid, agregarlo al grupo oinstall

 [root]# groupadd oinstall  [root]# useradd -G oinstall grid  [root]# paswd grid

Instalar la librería oracleasm, que permite la creación de los discos ASM

 [root]$ yum install oracleasm-support

 Verificar si el servicio asm esta activado

[root]$ systemctl is-enabled oracleasm.service

 Verificar si el modulo del kernel esta activado

[root]$ modinfo oracleasm

 Inicializar el módulo de oracleasm

[root]$ /usr/sbin/oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

Configurar el ASM

 [root]# oracleasm configure -i
Configuring the Oracle ASM library driver.
 This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
 Default user to own the driver interface []: grid
Default group to own the driver interface []: oinstall
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

Formatear los discos para el asm

 [root@localhost ~]# fdisk -l
Disk /dev/sda: 32.7 GB, 32686047232 bytes, 63839936 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: 0x000992bc
    Device Boot     Start         End     Blocks   Id System
/dev/sda1   *       2048     1026047     512000   83 Linux
/dev/sda2         1026048   63838207   31406080   8e Linux LVM
Disk /dev/sdb: 12.9 GB, 12884901888 bytes, 25165824 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 /dev/sdc: 12.9 GB, 12884901888 bytes, 25165824 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 /dev/mapper/ol-root: 30.0 GB, 29964107776 bytes, 58523648 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 /dev/mapper/ol-swap: 2147 MB, 2147483648 bytes, 4194304 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
 

Los discos /dev/sdb y /dev/sdc son los que asignamos para el asm, hay que darle formato a estos discos para usarlos en el ASM

[root]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
 Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x618db416.

Command (m for help): n ->Crear una nueva particion

Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended

Select (default p): p -> particion primaria

Partition number (1-4, default 1):
First sector (2048-25165823, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-25165823, default 25165823):
Using default value 25165823
Partition 1 of type Linux and of size 12 GiB is set
->Dejar los valores por defecto para que cree la partición del tamaño de todo el disco

Command (m for help): w -> guardar la tabla de particiones

The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
  • Lo mismo para el otro disco

 [root]# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.23.2).
 Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x2614de16.
 Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-25165823, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-25165823, default 25165823):
Using default value 25165823
Partition 1 of type Linux and of size 12 GiB is set
 Command (m for help): w
The partition table has been altered!
 Calling ioctl() to re-read partition table.
Syncing disks.

 Crear los discos ASM

[root@localhost ~]# oracleasm createdisk ASM1 /dev/sdb1
[root@localhost ~]# oracleasm createdisk ASM2 /dev/sdc1

 Listar los discos ASM

[root@localhost ~]# oracleasm listdisks
ASM1
ASM2

 Crear el directorio para la instalacion del home del grid

[grid@localhost grid]$ sudo mkdir -p /oracle/grid

Poner como dueño del directorio /oracle el usuario grid y el grupo oinstall

[grid@localhost grid]$ sudo chown -R grid:oinstall /oracle

Instalar el grid home con el usuario grid (ver video)

 Después de la instalación se ejecutan estos scripts con root

[grid@localhost ~]$ sudo sh /oracle/oraInventory/orainstRoot.sh
[sudo] password for grid:
Changing permissions of /oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 Changing groupname of /oracle/oraInventory to grid.
The execution of the script is complete.

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

grid@localhost ~]$ sudo sh /oracle/grid/product/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g
 The following environment variables are set as:
   ORACLE_OWNER= grid
   ORACLE_HOME= /oracle/grid/product/11.2.0/grid
 Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
 Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /oracle/grid/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
/oracle/grid/product/11.2.0/grid/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory
Failed to create keys in the OLR, rc = 127, Message:
Failed to create keys in the OLR at /oracle/grid/product/11.2.0/grid/crs/install/crsconfig_lib.pm line 7660.
/oracle/grid/product/11.2.0/grid/perl/bin/perl -I/oracle/grid/product/11.2.0/grid/perl/lib -I/oracle/grid/product/11.2.0/grid/crs/install /oracle/grid/product/11.2.0/grid/crs/install/roothas.pl execution failed
 

Si sale este error se deben instalar las siguientes librerías

sudo yum install libaio  sudo yum install elfutils  sudo yum install elfutils-libelf-devel  sudo yum install compat-libcap1*

 Luego de instalar estas librerías, se realiza nuevamente la configuración

[grid@localhost install]$ sudo /oracle/grid/product/11.2.0/grid/perl/bin/perl  /oracle/grid/product/11.2.0/grid/crs/install/roothas.pl -deconfig -force
[sudo] password for grid:
Using configuration parameter file: /oracle/grid/product/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
Failure in execution (rc=-1, 0, No such file or directory) for command /etc/init.d/ohasd deinstall
Successfully deconfigured Oracle Restart stack

cd /oracle/grid/product/11.2.0/grid  [root@localhost grid]# sh root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
   ORACLE_OWNER= grid
   ORACLE_HOME= /oracle/grid/product/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
 
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /oracle/grid/product/11.2.0/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'grid'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node localhost successfully pinned.
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2016-06-28 08:50:22.206:
[client(9233)]CRS-2101:The OLR was formatted using version 3.
[client(9521)]CRS-10001:28-Jun-16 08:54 ACFS-9459: ADVM/ACFS is not supported on this OS version: 'unknown'
[client(9523)]CRS-10001:28-Jun-16 08:54 ACFS-9201: Not Supported
2016-06-28 08:54:43.717:
[client(9650)]CRS-2101:The OLR was formatted using version 3.
2016-06-28 08:54:49.306:
[client(9673)]CRS-1001:The OCR was formatted using version 3.
 
ohasd failed to start at /oracle/grid/product/11.2.0/grid/crs/install/roothas.pl line 377, <ALERTLOG> line 8.
/oracle/grid/product/11.2.0/grid/perl/bin/perl -I/oracle/grid/product/11.2.0/grid/perl/lib -I/oracle/grid/product/11.2.0/grid/crs/install /oracle/grid/product/11.2.0/grid/crs/install/roothas.pl execution failed

 

Para corregir este error se debe aplicar un parche, por la versión de Sistema operativo que se utiliza

Se descarga el parche del Oracle support

Se verifica la versión del opatch

cd $GRID_HOME/OPatch
opatch lsinventory   -> para determinar la version del opatch que tiene

[grid@localhost OPatch]$ ./opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home       : /oracle/grid/product/11.2.0/grid
Central Inventory : /oracle/oraInventory
   from           : /oracle/grid/product/11.2.0/grid/oraInst.loc
OPatch version   : 11.2.0.3.4
OUI version      : 11.2.0.4.0
Log file location : /oracle/grid/product/11.2.0/grid/cfgtoollogs/opatch/opatch2016-06-28_08-58-49AM_1.log
Lsinventory Output file location : /oracle/grid/product/11.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2016-06-28_08-58-49AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Grid Infrastructure 11g                                       11.2.0.4.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.

Instalar la última versión del opatch:

Se declaran variables de entorno cono GRID_HOME y PATH para el usuario grid

export GRID_HOME=/oracle/grid/product/11.2.0/grid  export PATH=$PATH:$GRID_HOME/bin

Se descarga la ultima versión del opatch, se copia en el GRID_HOME y se descomprime

cp /media/oracle/p6880880_112000_Linux-x86-64.zip $GRID_HOME  cd $GRID_HOME  unzip p6880880_112000_Linux-x86-64.zip

Se copia el parche que se va a aplicar en la carpeta OPatch y se descomprime

cp /media/oracle/p20485808_112040_Linux-x86-64.zip $GRID_HOME/OPatch
cd $GRID_HOME/OPatch
unzip p20485808_112040_Linux-x86-64.zip

Se aplica el parche

[grid@localhost OPatch]$ ./opatch napply 20485808/ -oh $GRID_HOME
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation. All rights reserved.
Oracle Home       : /oracle/grid/product/11.2.0/grid
Central Inventory : /oracle/oraInventory
   from           : /oracle/grid/product/11.2.0/grid/oraInst.loc
OPatch version   : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /oracle/grid/product/11.2.0/grid/cfgtoollogs/opatch/opatch2016-06-28_09-41-03AM_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   17478514 18031668 18522509 19121551 19769489 20299013 20299019 20420937
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/oracle/grid/product/11.2.0/grid')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '17478514' to OH '/oracle/grid/product/11.2.0/grid'
ApplySession: Optional component(s) [ oracle.sdo, 11.2.0.4.0 ] , [ oracle.sysman.agent, 10.2.0.4.5 ] , [ oracle.xdk, 11.2.0.4.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.rdbms.rsf, 11.2.0.4.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...
Patching component oracle.sdo.locator, 11.2.0.4.0...
Patching component oracle.nlsrtl.rsf, 11.2.0.4.0...
Patching component oracle.xdk.rsf, 11.2.0.4.0...
Patching component oracle.rdbms.rman, 11.2.0.4.0...
Applying sub-patch '18031668' to OH '/oracle/grid/product/11.2.0/grid'
ApplySession: Optional component(s) [ oracle.precomp.common, 11.2.0.4.0 ] not present in the Oracle Home or a higher version is found.
Composite patch 20299013 successfully applied.
Patches 20299019,20420937 successfully applied.
Log file location: /oracle/grid/product/11.2.0/grid/cfgtoollogs/opatch/opatch2016-06-28_09-41-03AM_1.log
OPatch succeeded.

Volver a configurar

[root@localhost grid]# /oracle/grid/product/11.2.0/grid/perl/bin/perl  /oracle/grid/product/11.2.0/grid/crs/install/roothas.pl -deconfig –force
[root@localhost grid]# sh root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
   ORACLE_OWNER= grid
   ORACLE_HOME= /oracle/grid/product/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /oracle/grid/product/11.2.0/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'grid'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node localhost successfully pinned.
Adding Clusterware entries to oracle-ohasd.service
localhost     2016/06/28 09:54:21     /oracle/grid/product/11.2.0/grid/cdata/localhost/backup_20160628_095421.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server

Luego se continua con la instalación

Para verificar que todos los servicios quedaron iniciados se ejecuta el comando

crsctl stat res –t

Visitas: 184

Comentario

¡Tienes que ser miembro de Comunidad Oracle Hispana para agregar comentarios!

Participar en Comunidad Oracle Hispana

© 2017   Creado por Fernando Garcia.   Tecnología de

Insignias  |  Informar un problema  |  Términos de servicio