How to Change Hostname of a Standalone Oracle Restart ( ASM )

Hi,

I will explain How to Change Hostname of a Standalone Oracle Restart ( ASM ) in this article.

 

Oracle Restart ( ASM )

If you don’t know what is the ASM ( Automatic Storage Management ), you should read following article before this.

Oracle Automatic Storage Management ( ASM ) -1 Add Disk and Drop Disk Operations in Oracle ASM

 

 

Change Hostname of a Standalone Oracle ASM

Sometimes Hostname can be requested to be changed on where Oracle ASM is installed,  in which case there are steps to be taken on Oracle ASM and HAS ( High Availability Services ). Any database which ASM is not installed, you can change the hostname, then reboot and register and open the listener. However, when Oracle ASM is installed for database, some configurations are required.

Now let’s explain them step by step below.

 

Set ASM Profile and go to $ORACLE_HOME/crs/install directory.

 

[root@deveci ~]# . oraenv
ORACLE_SID = [root] ? +ASM
The Oracle base has been set to /u01/app/oracle
[root@deveci ~]#
[root@deveci ~]#
[root@deveci ~]# cd /u01/app/oracle/product/12.1.0/grid/crs/install
[root@deveci install]#
[root@deveci install]#

 

 

Execute roothas.pl script and deconfigure Oracle Restart and High Availability Services

 

[root@deveci install]# ./roothas.pl -deconfig -force
Using configuration parameter file: ./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.
CLSU-00100: operating system function: opendir failed with error data: 2
CLSU-00101: operating system error message: No such file or directory
CLSU-00103: error location: scrsearch1
CLSU-00104: additional error information: cant open scr home dir scls_scr_getval
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
2018/09/27 10:54:49 CLSRSC-337: Successfully deconfigured Oracle Restart stack

 

 

 

Change hostname in this step. I have changed my hostname from deveci to MehmetSalih in the /etc/hosts and /etc/sysconfig/network files.

[root@deveci ~]$ cat /etc/hosts
192.168.56.75 deveci deveci.localdomain

[root@deveci ~]$ cat /etc/sysconfig/network
NETWORKING_IPV6=no
NETWORKING=yes
HOSTNAME=deveci.localdomain
NOZEROCONF=yes

 

 

Reboot server and then check Hostname.

 

[root@MehmetSalih ~]$ cat /etc/hosts
192.168.56.75 MehmetSalih  MehmetSalih .localdomain



[root@MehmetSalih ~]$ cat /etc/sysconfig/network
NETWORKING_IPV6=no
NETWORKING=yes
HOSTNAME=MehmetSalih.localdomain
NOZEROCONF=yes

 

 

Set ASM Profile and go to  $ORACLE_HOME/crs/install directory. Execute roothas.pl script and configure High Availability Services again.

 

[root@MehmetSalih install]# ./roothas.pl
Using configuration parameter file: ./crsconfig_params
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: Node MehmetSalih successfully pinned.
2018/09/27 10:55:59 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.conf' MehmetSalih 2018/09/27 10:56:39 /u01/app/oracle/product/12.1.0/grid/cdata/MehmetSalih/backup_20180927_105639.olr 0
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'MehmetSalih'
CRS-2673: Attempting to stop 'ora.evmd' on 'MehmetSalih'
CRS-2677: Stop of 'ora.evmd' on 'MehmetSalih' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'MehmetSalih' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
2018/09/27 10:56:57 CLSRSC-327: Successfully configured Oracle Restart for a standalone server

 

 

Change Auto Start parameter of ora.cssd ( Cluster Syncronization Services Daemon ) as 1 like following.

 

[root@MehmetSalih install]# crsctl modify resource "ora.cssd" -init -attr "AUTO_START=1"
[root@MehmetSalih install]#
[root@MehmetSalih install]#

 

 

Stop Oracle High Availability Services like following.

 

[root@MehmetSalih install]# crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'MehmetSalih'
CRS-2673: Attempting to stop 'ora.evmd' on 'MehmetSalih'
CRS-2677: Stop of 'ora.evmd' on 'MehmetSalih' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'MehmetSalih' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@MehmetSalih install]#

 

Start Oracle High Availability Services like following.

[root@MehmetSalih install]# crsctl start has
CRS-4123: Oracle High Availability Services has been started.
[root@MehmetSalih install]#

 

 

Now you can startup Oracle ASM Instance like following.

 

[oracle@MehmetSalih dbs]$ sqlplus / as sysasm

SQL*Plus: Release 12.1.0.2.0 Production on Thu Sep 27 11:02:46 2018

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ASM instance started

Total System Global Area 1140850688 bytes
Fixed Size 2933400 bytes
Variable Size 1112751464 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit

 

 

Connect ASMCMD tool and check disk groups.

 

oracle@MehmetSalih :/home/oracle:>asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 512000 510551 0 510551 0 N DATA/
MOUNTED EXTERN N 512 4096 4194304 204800 203272 0 203272 0 Y RECO/
ASMCMD>


 

Do you want to learn Oracle Database for Beginners, then read the following articles.

Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

Leave a Reply

Your email address will not be published. Required fields are marked *