Friday, July 16, 2010

ONS configuration doesn't get the full hostname

On Oracle 11gR1 clusterware after a fresh installation (11.1.0.6) and even after upgrading to 11.1.0.7 clusterware, the ONS configuration doesn't have the full hostname given by the hostname command on linux. Even if the full hostname is given during the clusterware installation. Only the 'short' hostname will appear without the domain values.
$CRS_HOME/bin/onsctl ping
Number of onsconfiguration retrieved, numcfg = 2
onscfg[0]
{node = db01, port = 6251}
Adding remote host db01:6251
onscfg[1]
{node = db02, port = 6251}
Adding remote host db02:6251
ons is running ...

$ hostname
db02.edsa.local
ONS config information could also be seen in the ocrdump as well. This mismatch is noted in metalink notes 744849.1,754619.1 and 759895.1. It is important that hostname in the ons config and hostname given by the linux hostname command match. It is vital for Fast Connection Failover (FCF metalink note 566573.1) used in java applications with jdbc.
If the hostname is a mismatch the FCF will not work.
To fix it simply remove the invalid hostname entry and add the full hostname
# racgons remove_config short_hostname
# racgons add_config full_hostname:6251