Reconfigurar HAS, CSS and ASM (Oracle Restart) 12.2.0.1
If you want to change the machine’s name of its IP, you need to reconfigure the next.
First, you check if everything is started ok:
[oracle@dg1 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE dg1 STABLE ora.LISTENER.lsnr ONLINE ONLINE dg1 STABLE ora.asm ONLINE ONLINE dg1 Started,STABLE ora.ons OFFLINE OFFLINE dg1 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.cssd 1 ONLINE ONLINE dg1 STABLE ora.diskmon 1 OFFLINE OFFLINE STABLE ora.driver.afd 1 ONLINE ONLINE dg1 STABLE ora.evmd 1 ONLINE ONLINE dg1 STABLE --------------------------------------------------------------------------------
Next, you check same useful information for later steps:
[oracle@dg1 ~]$ srvctl config listener Nombre: LISTENER Tipo: Database Listener Directorio raíz: /u01/app/12.2.0.1/grid Puntos finales: TCP:1521 El listener está activado. [oracle@dg1 ~]$ srvctl config asm -a Directorio raíz de ASM: <CRS home> Archivo de contraseña: +DATA/orapwasm Backup of Password file: Listener de ASM: LISTENER Spfile: +DATA/ASM/ASMPARAMETERFILE/registry.253.947162183 Cadena de detección de grupo de discos de ASM: AFD:* ASM está activada. ASM está activado individualmente en los nodos: ASM está desactivado individualmente en los nodos:
1) Deconfigure HAS
You can check the note Reconfigure HAS and CSS for nonRAC ASM on 11.2 (Doc ID 887658.1)
Important!! do you notice the change in the last parameter? (-deconfig):
[root@dg1 ~]# export ORACLE_HOME=/u01/app/12.2.0.1/grid/ [root@dg1 ~]# $ORACLE_HOME/perl/bin/perl -I $ORACLE_HOME/perl/lib -I $ORACLE_HOM/crs/install $ORACLE_HOME/crs/install/roothas.pl -deconfig Using configuration parameter file: /u01/app/12.2.0.1/grid/crs/install/crsconfig_params The log of current session can be found at: /u01/app/12.2.0.1/crsdata/dg1/crsconfig/hadeconfig.log 2017/06/22 10:55:34 CLSRSC-332: CRS resources for listeners are still configured CRS-2791: Iniciando cierre de los recursos gestionados por los Servicios de Alta Disponibilidad de Oracle en 'dg1' CRS-2673: Intentando parar ''ora.evmd'' en ''dg1'' CRS-2673: Intentando parar ''ora.DATA.dg'' en ''dg1'' CRS-2677: La parada de ''ora.DATA.dg'' en ''dg1'' se ha realizado correctamente CRS-2673: Intentando parar ''ora.asm'' en ''dg1'' CRS-2677: La parada de ''ora.evmd'' en ''dg1'' se ha realizado correctamente CRS-2677: La parada de ''ora.asm'' en ''dg1'' se ha realizado correctamente CRS-2673: Intentando parar ''ora.cssd'' en ''dg1'' CRS-2677: La parada de ''ora.cssd'' en ''dg1'' se ha realizado correctamente CRS-2673: Intentando parar ''ora.driver.afd'' en ''dg1'' CRS-2677: La parada de ''ora.driver.afd'' en ''dg1'' se ha realizado correctamente CRS-2793: Ha terminado el cierre de los recursos gestionados por los Servicios de Alta Disponibilidad de Oracle en 'dg1' CRS-4133: Se ha parado Servicios de Alta Disponibilidad de Oracle. 2017/06/22 10:56:20 CLSRSC-337: Successfully deconfigured Oracle Restart stack
2) /etc/hosts
Modify the file and change the name:
[root@dg1 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.111 dg1 dg1.localdomain [root@dg1 ~]# vi /etc/hosts [root@dg1 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.112 dg2 dg2.localdomain
3) Network
Modify the IP:
[root@dg1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s3 |grep IPADDR IPADDR="192.168.1.111" [root@dg1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 [root@dg1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s3 |grep IPADDR IPADDR="192.168.1.112"
Restart the network:
[root@dg1 ~]# systemctl restart network
Check the new IP:
[root@dg1 ~]# ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 08:00:27:dd:fc:8d brd ff:ff:ff:ff:ff:ff inet 192.168.1.112/24 brd 192.168.1.255 scope global enp0s3 valid_lft forever preferred_lft forever inet6 fe80::31c2:79e4:db9:5eb3/64 scope link valid_lft forever preferred_lft forever
4) Hostname
Check the current name:
[root@dg1 ~]# hostname dg1.localdomain [root@dg1 ~]# cat /etc/hostname dg1.localdomain [root@dg1 ~]# hostnamectl status Static hostname: dg1.localdomain Icon name: computer-vm Chassis: vm Machine ID: 4c65d4ef42ac45108f4b23474764c90b Boot ID: f4850d43d99a49ce8a7a49cbe3605ea1 Virtualization: kvm Operating System: Oracle Linux Server 7.3 CPE OS Name: cpe:/o:oracle:linux:7:3:server Kernel: Linux 4.1.12-94.3.6.el7uek.x86_64 Architecture: x86-64
Modify the name:
[root@dg1 ~]# hostname dg2.localdomain [root@dg1 ~]# vi /etc/hostname [root@dg1 ~]# cat /etc/hostname dg2.localdomain [root@dg1 ~]# hostnamectl status Static hostname: dg1.localdomain Transient hostname: dg2.localdomain Icon name: computer-vm Chassis: vm Machine ID: 4c65d4ef42ac45108f4b23474764c90b Boot ID: f4850d43d99a49ce8a7a49cbe3605ea1 Virtualization: kvm Operating System: Oracle Linux Server 7.3 CPE OS Name: cpe:/o:oracle:linux:7:3:server Kernel: Linux 4.1.12-94.3.6.el7uek.x86_64 Architecture: x86-64
The hostname changes automatically a few seconds later:
[root@dg1 ~]# hostnamectl status Static hostname: dg2.localdomain Icon name: computer-vm Chassis: vm Machine ID: 4c65d4ef42ac45108f4b23474764c90b Boot ID: f4850d43d99a49ce8a7a49cbe3605ea1 Virtualization: kvm Operating System: Oracle Linux Server 7.3 CPE OS Name: cpe:/o:oracle:linux:7:3:server Kernel: Linux 4.1.12-94.3.6.el7uek.x86_64 Architecture: x86-64
5) Listener
Change the hostname in the listener.ora:
[root@dg2 ~]# export ORACLE_HOME=/u01/app/12.2.0.1/grid [root@dg2 ~]# cat $ORACLE_HOME/network/admin/listener.ora #Backup file is /u01/app/12.2.0.1/grid/srvm/admin/listener.ora.bak.dg1 line added by Agent # listener.ora Network Configuration File: /u01/app/12.2.0.1/grid/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dg1)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) [root@dg2 ~]# vi $ORACLE_HOME/network/admin/listener.ora [root@dg2 ~]# cat $ORACLE_HOME/network/admin/listener.ora #Backup file is /u01/app/12.2.0.1/grid/srvm/admin/listener.ora.bak.dg1 line added by Agent # listener.ora Network Configuration File: /u01/app/12.2.0.1/grid/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dg2)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )
6) Create HAS
[root@dg2 ~]# $ORACLE_HOME/perl/bin/perl -I $ORACLE_HOME/perl/lib -I $ORACLE_HOME/crs/install $ORACLE_HOME/crs/install/roothas.pl Using configuration parameter file: /u01/app/12.2.0.1/grid/crs/install/crsconfig_params The log of current session can be found at: /u01/app/12.2.0.1/crsdata/dg2/crsconfig/roothas_2017-06-22_11-19-43AM.log 2017/06/22 11:19:44 CLSRSC-363: User ignored prerequisites during installation LOCAL ADD MODE Creating OCR keys for user 'oracle', privgrp 'oinstall'.. Operation successful. LOCAL ONLY MODE Successfully accumulated necessary OCR keys. Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. CRS-4664: Se ha hecho pin al nodo dg2 correctamente. 2017/06/22 11:20:09 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service' CRS-2791: Iniciando cierre de los recursos gestionados por los Servicios de Alta Disponibilidad de Oracle en 'dg2' CRS-2673: Intentando parar ''ora.evmd'' en ''dg2'' CRS-2677: La parada de ''ora.evmd'' en ''dg2'' se ha realizado correctamente CRS-2793: Ha terminado el cierre de los recursos gestionados por los Servicios de Alta Disponibilidad de Oracle en 'dg2' CRS-4133: Se ha parado Servicios de Alta Disponibilidad de Oracle. CRS-4123: Se ha iniciado Servicios de Alta Disponibilidad de Oracle. dg2 2017/06/22 11:21:11 /u01/app/12.2.0.1/grid/cdata/dg2/backup_20170622_112111.olr 0 2017/06/22 11:21:14 CLSRSC-327: Successfully configured Oracle Restart for a standalone server
7) Reconfigure HAS
By default you have these resources:
[root@dg2 ~]# $ORACLE_HOME/bin/crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ons OFFLINE OFFLINE dg2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.cssd 1 OFFLINE OFFLINE STABLE ora.diskmon 1 OFFLINE OFFLINE STABLE ora.driver.afd 1 ONLINE ONLINE dg2 STABLE ora.evmd 1 ONLINE ONLINE dg2 STABLE --------------------------------------------------------------------------------
7.1) Add Listener
[oracle@dg2 ~]$ srvctl add listener [oracle@dg2 ~]$ srvctl start listener [oracle@dg2 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE dg2 STABLE ora.ons OFFLINE OFFLINE dg2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.cssd 1 OFFLINE OFFLINE STABLE ora.diskmon 1 OFFLINE OFFLINE STABLE ora.driver.afd 1 ONLINE ONLINE dg2 STABLE ora.evmd 1 ONLINE ONLINE dg2 STABLE --------------------------------------------------------------------------------
7.2) Add ASM
[oracle@dg2 ~]$ srvctl add asm -d 'AFD:*' -p '+DATA/ASM/ASMPARAMETERFILE/registry.253.947162183' [oracle@dg2 ~]$ srvctl start asm [oracle@dg2 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE dg2 STABLE ora.LISTENER.lsnr ONLINE ONLINE dg2 STABLE ora.asm ONLINE ONLINE dg2 Started,STABLE ora.ons OFFLINE OFFLINE dg2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.cssd 1 ONLINE ONLINE dg2 STABLE ora.diskmon 1 OFFLINE OFFLINE STABLE ora.driver.afd 1 ONLINE ONLINE dg2 STABLE ora.evmd 1 ONLINE ONLINE dg2 STABLE --------------------------------------------------------------------------------
Adding value with Arumel!!