2009-10-29 12:02:52| 分类: oracle RAC技术 | 标签: |举报 |字号大中小 订阅
普通IP用oifcfg来更改
VIP如下更改
How to change VIP and VIP/Hostname in a 10g RAC/CRS environment.
PURPOSE
-------
To illustrate the changing of a Virtual IP Address (VIP) in an Oracle10g RAC/CRS environment.
-------
Oracle 10g use VIP (Virtual IP) for clients to connect to the database. VIP solves all time-outs entering the TCP/IP stack resulting
higher application availability. This VIP is a static IP with a hostname defined and resolved thru DNS. During the installation
of CRS users where prompted to enter a Virtual IP and Virtual Hostname for each of the node in the cluster. These are stored in
OCR and different components within 10g HA framework depends on these VIPs. If for reason customer wants to change either the VIP or the VIP/Hostname use the following procedure.
SCOPE & APPLICATION
-------------------
Customers and support analysts who need to change the VIP or VIP/Hostname.
Note:
Changing the VIP involves modification of the nodeapps, which includes the Virtual IP address, the GSD, the Listener, and Oracle Notification Services (ON
The VIP can be modified while the nodeapps are running, however changes will not take effect until the VIP, and hence the nodeapps, are restarted.
Other resources on a node, such as database instances and ASM instances, are dependent on the VIP,
so stopping the nodeapps will on
How to change the VIP address on
This example assumes that the host name associated with the VIP will not change - just the IP address itself.
1. Stop all resources that are dependent on the VIP on a given node.
This includes all RAC database instances on that node, as well as the ASM
instance on that node, if it exists and is being used:
1a). Stop database instances:
$ srvctl stop instance -d grid -i grid1
Where the database name is specified via the '-d' option, and the instance
on the appropriate node is specified with the '-i' option.
Alternatively, to stop the entire database, on all nodes, you can issue
the stop database command:
$ srvctl stop database -d grid
1b). To stop the ASM instance on the node, issue the following command:
$ srvctl stop asm -n rmsclnxclu1
Note: It is not necessary to use srvctl to stop the database and ASM
instance these resources can be stopped via SQL*Plus and/or, on the Windows
platform by stopping the associated services.
2. Confirm the current IP address for the VIP by running the command 'ifconfig -a'
This should show you the current VIP, bound to on
In the example below, it shows as 'eth0:1'
=============================
eth0:1 Link encap:Ethernet HWaddr 00:01:03:2C:69:BB
inet addr:192.168.1.125 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
...
...
=============================
Note: On the Windows platform, run the command 'ipconfig /all'. This will
list all IP addresses bound to a given adapter, including the VIP.
3. Stop the nodeapps using srvctl commands:
$ srvctl stop nodeapps -n rmsclnxclu1
/etc/init.d/init.crs disable
Yast2 runlevel 取消自动启动 修改/etc/hosts文件 然后重启
Note: This will stop the VIP, GSD, Listener, and ON
4. Verify that the VIP is no longer running by executing the 'ifconfig -a' command
again, and confirm that the interface (in our example it was 'eth0:1' is
no longer listed in the output. (Again, on Windows, run the command 'ipconfig /all')
If the interface still shows as on
is dependent on the VIP is still running. The crs_stat command can help to show
resources that are still on
5. Make any changes necessary to all nodes' /etc/hosts files (on Unix), or the
\WINNT\System32\drivers\etc\hosts file (on Windows) and/or make the necessary
DNS changes, to associate the new IP address with the old host name.
6. Modify the nodeapps and provide the new virtual IP address.
Use the srvctl modify nodeapps command with the following syntax:
$/etc/init.d/init.crs start
$ srvctl modify nodeapps -n rmsclnxclu1 -A 192.168.2.125/255.255.255.0/eth0
(在各自节点运行root下)
Note: This command should be run as root. Attempting to run this command as the 'oracle' user or software owner will result in the following error:
PRKO-2117 : This command should be executed as the system privilege user.
7. Start node-level applications.
8.
$ srvctl start nodeapps -n rmsclnxclu1
Repeat the same steps for all the nodes in the cluster.
Since SRVCTL is a cluster wide management tool, you can accomplish these tasks for
any specific nodes from on
Note: If on
to the LISTENER.ORA and TNSNAMES.ORA, provided they are using the vip hostnames for
the 'HOST=' entries.
If changing both the hostname and the VIP for a node, it will be necessary
to modify the LISTENER.ORA and change the 'HOST=' entries to the new VIP hostname.
This can be dopne manually, or by using the NETCA to remove the old listener and
create a new listener. In addition, changes will need to be made to the TNSNAMES.ORA
of any clients connecting to the old HOSTNAME.
SRVCTL commands are documented in Appendix B of the RAC Admin Guide at:
http://download-west.oracle.com/ ... .101/b10765/toc.htm
评论