Sunday, September 13, 2009

gyaan about hostname that is taken wh...


gyaan about hostname that is taken while installing oracle;


the hostname for the machine while installing any oracle product is taken from the variable "hostname"
Now here is a catch.

When you and I type the command "hostname" manually, then we see some value - which actually may not necessarily be picked by the oracle software!
I burnt my fingers in this and I know that.


When I used to give the command  hostname, it gave the output as octopus.
[oracle@octopus bin]$ hostname
octopus.sungardhe.com


But while checking it in the oracle files, it will show as something else!

eg:

[oracle@octopus bin]$ opmnctl status

Processes in Instance: SEED.localhost.localdomain
-------------------+--------------------+---------+---------
ias-component      | process-type       |     pid | status
-------------------+--------------------+---------+---------
DSA                | DSA                |     N/A | Down
LogLoader          | logloaderd         |     N/A | Down
HTTP_Server        | HTTP_Server        |     N/A | Down
dcm-daemon         | dcm-daemon         |   17855 | Alive
WebCache           | WebCache           |     N/A | Down
WebCache           | WebCacheAdmin      |     N/A | Down
OC4J               | home               |   20902 | Alive
OC4J               | OC4J_BI_Forms      |   20840 | Alive





or

[oracle@octopus bin]$ opmnctl status

Processes in Instance: SEED.m038038.sct.com
-------------------+--------------------+---------+---------
ias-component      | process-type       |     pid | status
-------------------+--------------------+---------+---------
DSA                | DSA                |     N/A | Down
LogLoader          | logloaderd         |     N/A | Down
HTTP_Server        | HTTP_Server        |     N/A | Down
dcm-daemon         | dcm-daemon         |   17855 | Alive
WebCache           | WebCache           |     N/A | Down
WebCache           | WebCacheAdmin      |     N/A | Down
OC4J               | home               |   20902 | Alive
OC4J               | OC4J_BI_Forms      |   20840 | Alive







Solution:

After installing it a couple of times and playing around I found that the oracle software picks it up just like the following command picks up the hostname


ping `hostname`

[root@octopus ~]# ping `hostname`
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.025 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.041 ms




or

[root@octopus ~]# ping `hostname`
PING octopus.sungardhe.com (149.24.38.38) 56(84) bytes of data.
64 bytes from octopus.sungardhe.com (149.24.38.38): icmp_seq=1 ttl=64 time=0.027 ms
64 bytes from octopus.sungardhe.com (149.24.38.38): icmp_seq=2 ttl=64 time=0.048 ms





This ping command takes it up from /etc/hosts.


Therefore, the entries in the /etc/hosts play a very important role in determining what the instance name will be!


I found that the right order in /etc/hosts so that the above ping command gives the right answer is by putting the desired hostname towards the beginning.

[oracle@octopus bin]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
149.24.38.38    octopus.sungardhe.com   octopus
127.0.0.1       octopus.sungardhe.com octopus.sungardhe.com localhost.localdomain localhost
#AJ ::1         localhost6.localdomain6 localhost6
149.24.38.38    m038038.sungardhe.com   m038038




No comments:

Post a Comment