The Pakistani Spectator

A Candid Blog



Oracle 11g on Linux : How to Change Hostname of Server

By Sharafat • May 16th, 2009 • Category: Technology • One Response

Following are the steps to change the hostname of the server where Oracle database 11g is installed on Linux platform.

1. Edit the following file as root:
/etc/sysconfig/network
# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=oracle.com

to

# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=oracle-new.com

Change the line below to match the new hostname/domain name:
HOSTNAME=<hostname>.<domain_name> ( eg: ora2-new.oracle-new.com )

Save the file

2. Edit the ‘/etc/hosts’ file as root to ensure that it contains the new hostname and/or domain name.
# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.78.110 ora2.oracle.com ora2

to
# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.78.110 ora2-new.oracle-new.com ora2-new

make sure you have configured other services for the new hostname and/or domain name ( eg: h
ttpd )

3. Restart the O/S
# reboot

4. Verify that you can ping the host from another host in your network. Be sure to ping using the new hostname to make sure
everything is resolving properly.
# ping ora2-new.oracle-new.com
PING ora2-new.oracle-new.com (192.168.78.110) 56(84) bytes of data.
64 bytes from ora1 (192.168.78.110): icmp_seq=1 ttl=64 time=4.27 ms
64 bytes from ora1 (192.168.78.110): icmp_seq=2 ttl=64 time=0.165 ms
64 bytes from ora1 (192.168.78.110): icmp_seq=3 ttl=64 time=0.186 ms
64 bytes from ora1 (192.168.78.110): icmp_seq=4 ttl=64 time=0.151 ms

— ora2-new.oracle-new.com ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.151/1.194/4.274/1.778 ms


Trackback URL

Tagged as: , , , , ,

Click For More Articles By Sharafat
All posts by Sharafat
You can follow any responses to this entry through the RSS 2.0 feed.

One Response »

  1. Excellent solution! Without this correction in /etc/hosts I see error
    —————————-
    sqlplus /nolog

    SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 11 12:24:49 2010

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

    SQL> connect sys as sysdba
    Enter password:
    Connected to an idle instance.
    SQL>
    SQL> startup
    ORA-00119: invalid specification for system parameter LOCAL_LISTENER
    ORA-00130: invalid listener address ‘(ADDRESS=(PROTOCOL=TCP)(HOST=fox3)(PORT=1521))’
    SQL>
    —————————-
    Thank you!!!

Leave a Reply (Read Comment Policy)

TPS has started observing minimal and mainly automatic comments moderation. Our automatic moderation tool tries to moderate comments on the basis of inappropriate keywords. If you feel that your valid and proper comment has been moderated, then please let us know, and we will promptly look into it. If you feel that an inappropriate comment has been ignored by tool, then let us know please, and we will check it. Thanks for your visit and help.