Let's take a look at the two sections in the Oracle official document:
(1) Can I change the public hostname in my Oracle Database 10g Cluster using Oracle Clusterware?
Hostname changes are not supported in Oracle Clusterware (CRS), unless you want to perform a deletenode followed by a new addnode operation.
The hostname is used to store among other things the flag files and Oracle Clusterware stack will not start if hostname is changed.
(2) Does the hostname have to match the public name or can it be anything else?
When there is no vendor clusterware, only Oracle Clusterware, then the public node name must match the host name. when vendor clusterware is present, it determines the public node names, and the installer doesn' t present an opportunity to change them. so, when you have a choice, always choose the hostname.
From: Metalink Note 220970.1 RAC Frequently Asked Questions:
Based on the two paragraphs on the official website, we can see two points:
(1) Once the RAC environment is installed, the host name cannot be modified unless you delete the node and modify the Hostname before adding the node.
(2) The host name must be the same as the public name. This is particularly emphasized in the installation documentation.
The related modification method is not found on Metalink of Oracle, except that the deletion node mentioned above is added. In fact, there is also a very simple method, that is, re-run the CRS configuration file (/u01/app/oracle/product/crs/install/rootconfig), re-format OCR and Voting disk, then re-create the CRS resource.
These operations must first disable CRS. Therefore, this operation is generally not performed on the production database. Production system maintenance is stable first. But as a knowledge point, we can learn it.
Test Platform: RedHat 5.4 + Multipath + RAW + ASM + Oracle 10gR2
Perform the following operations:
1. Stop CRS
Run the $ ORA_CRS_HOME/bin/crsctl stop crs command.
After the command is executed, all databases, listeners, and other resources registered in CRS will be stopped.
2. Modify the Host Name
Original host name:
[Root @ rac1 bin] # hostname
Rac1
[Root @ rac2 bin] # hostname
Rac2
Change the host name to racdb1 and racdb2.
Modify Node 1 to the following:
[Root @ rac1 bin] # hostname racdb1
[Root @ rac1 bin] # hostname
Racdb1
[Root @ rac1 bin] # cat/etc/sysconfig/network
NETWORKING = yes
NETWORKING_IPV6 = no
HOSTNAME = racdb1
GATEWAY = 192.168.6.254
[Root @ rac1 bin] # cat/etc/hosts
# Do not remove the following line, or various programs
# That require network functionality will fail.
127.0.0.1 localhost
# Public Network-(eth0)
192.168.6.223 racdb1
192.168.6.226 racdb2
# Private Interconnect-(eth1)
192.168.6.20.racdb1-priv
192.168.6.227 racdb2-priv
# Public Virtual IP (VIP) addresses-(eth0: 1)
192.168.6.225 racdb1-vip
192.168.6.228 racdb2-vip
In Node 2, it is the same as in node 1.