Operating System - Linux
1752786 Members
5926 Online
108789 Solutions
New Discussion юеВ

Re: an oracle question on Linux forum

 
Maaz
Valued Contributor

an oracle question on Linux forum

I know this question is purely a Oracle question, but I am posting it here, because I know a lot many persons here are also well aware with oracle.

server1 hostname dbhost1
server2 hostname dbhost2

I ran the Oracle(oracle10gR2) installer on server1(dbnode1), and install/place every thing(db and oracle binaries) on file system "/oracle" which is on SAN.
After installation completes, I unmount the /oracle(SAN), and then mount /oracle on server2(dbnode2), but oracle gives error and does not starts.

To start Oracle on server2, I have to change the hostname of server2 from 'dbnode2' to 'dbnode1'.(dbnode1 is server, where I ran the oracle installer)

is there any specific method to install oracle(any special option I have to provide to the 'runInstaller' ) so that I can start oracle on/from either node ?

on both, dbnode1 and dbnode2, /etc/hosts is following
# cat /etc/hosts
dbnode1 192.168.0.236
dbnode2 192.168.0.238

Regards
Maaz
6 REPLIES 6
Ivan Ferreira
Honored Contributor

Re: an oracle question on Linux forum

You could set the same hostname to both hosts, and configure an alias IP. Resolving by DNS you could have a entry for each host with it's IP address, and a generic entry for the virtual IP. For example:

host1:
/etc/sysconfig/network
db.domain.com

/etc/hosts
192.168.0.1 dbnode1.domain.com
192.168.0.2 dbnode2.domain.com
192.168.0.3 db.domain.com

/etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=192.168.0.1

/etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0
IPADDR=192.168.0.3
ONBOOT=NO

host2:
/etc/sysconfig/network
db.domain.com

/etc/hosts
192.168.0.1 dbnode1.domain.com
192.168.0.2 dbnode2.domain.com
192.168.0.3 db.domain.com

/etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=192.168.0.2

/etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0
IPADDR=192.168.0.3
ONBOOT=NO


When you perform a "failover", you just need to:

node1# ifdown eth0:0
node2# ifup eth0:0

To avoid confusion, set the PROMPT manually on each host.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Patrick Wallek
Honored Contributor

Re: an oracle question on Linux forum

>>, but oracle gives error and does not starts.

What error did it give?
Maaz
Valued Contributor

Re: an oracle question on Linux forum

Hi Ivan thank for help
>You could set the same hostname to both hosts
but I need to set the unique hostname for both server.
Actually I have to configure a two node active/passive Linux HA
cluster... and to configure a cluster all the member nodes must
have a unique name.
So I have to install Oracle in such a way, that Oracle bind itself
to virtual-hostname/virtual-IP, and doesnt bind/attached itself to
the physical hostname of any node.

e.g on both nodes

/etc/hosts
192.168.0.1 dbnode1 ## physical hostname and IP of server1
192.168.0.2 dbnode2 ## physical hostname and IP of server2

192.168.0.2 dbserver ## virtual hostname and IP of Cluster

and I want to install oracle in such a way, that Oracle bind itself with the virtual-hostname(dbserver) and not with the physical hostname of the machine
where I run the OUI(runInstaller)

I have done a active/passive Linux HA cluster of SAP, and normally
SAP also binds itself to the physical hostname of machine where we run
the SAP installer, but we if we provide the
SET_VIRTUAL_HOSTNAME=virtualhostname option to the installer
then SAP binds itself to virtual-hostname provided, and not with the
physical-hostname(default)

I am looking for the method to install Oracle so that Oracle bind
itself with virtual-hostname, and not with the physical hostname.

Hi Patrick
>> but oracle gives error and does not starts.
>>
>What error did it give?

when I try to start listner service on dbnode2, I got the following error. To avoid this error, and to start oracle I have to set the hostname of this machine as 'dbnode1'

oracle@dbnode-2:~> lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 22-NOV-2009 14:52:59

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Starting /oracle/product/10.2/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/product/10.2/db_1/network/admin/listener.ora
Log messages written to /oracle/product/10.2/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbnode-1.site)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
Linux Error: 99: Cannot assign requested address

Listener failed to start. See the error message(s) above.
emha_1
Valued Contributor

Re: an oracle question on Linux forum

Hi,

Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbnode-1.site)(PORT=1521)))


you are logged on dbnode-2 and tries to start listener listening on dbnode-1, what is of course not possible.

it's not problem of how did you install oracle, it's just listener configuration problem.

however, I would as well suggest let listener to work on virtual hostname and IP. if you move your instance between nodes you have to move this virtual hostname and IP as well. this is quite common configuration. it's possible to tweak listener or its starting scripts to bind to physical hostname/IP but then your client's configuration has to consider that as well and try to connect to both nodes everytime (what can casue unwanted delays).


emha.
Maaz
Valued Contributor

Re: an oracle question on Linux forum

Thanks Ivan, Patrick, and emha for help/support. I always appreciate your valuable feedbacks and help.

I have found the solution :)

Solution:
--------

server1 physical hostname = dbnode1
server2 physical hostname = dbnode2
virtual hostname = dbserver

on both hosts
# cat /etc/hosts
dbnode1 192.168.0.236 ## Phys hostname
dbnode2 192.168.0.238 ## Phys hostname
dbserver 192.168.0.245 ## virtual/cluster hosyname and IP

before running the 'runInstaller', on dbnode1, temporarily set the physical hostname of server1 from 'dbnode1' to 'dbserver'

# echo dbserver > /proc/sys/kernel/hostname

then temporarily assign the virtual/cluster IP to the server1.

# ip address add 192.168.0.245 brd + dev eth0

now run the OUI(runInstaller), and place every thing(db, and oracle binaries) on SAN.
Once the installation completes, remove the virtual IP and virtual hostname from server1.

now before starting oracle, just assign the virtual IP, to the node(either dbnode1 or dbnode2), and listner/oracle will start without complains. ;-)

Regards
Maaz
Maaz
Valued Contributor

Re: an oracle question on Linux forum

see the above post