ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Modifying RAC

Modifying RAC

原创 Linux操作系统 作者:ygzhou518 时间:2012-01-02 09:56:57 0 删除 编辑
Modifying the VIP or VIP Hostname of a 10g or 11g Oracle Clusterware Node [ID 276434.1]
                         Modified 19-DEC-2011     Type BULLETIN     Status PUBLISHED  
In this Document
  Purpose
  Scope and Application
  Modifying the VIP or VIP Hostname of a 10g or 11g Oracle Clusterware Node
     Planning for VIP changes
     Gathering Current VIP Configuration
     Stopping Resources
     Modifying VIP and Its Associated Attributes
     Restarting Resources
     Others
  References

Applies to:

Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 11.2.0.0 - Release: 10.1 to 11.2
Information in this document applies to any platform.
Purpose

The purpose of this note is to illustrate how to change a Virtual IP Address (VIP), VIP hostname or other VIP attributes in an Oracle Clusterware/Grid Infrastructure environment.

Caution: This note does not cover changing the public hostname or the public host IP address. 
Scope and Application

Oracle Database 10g and 11g use VIPs (Virtual IP) in clustered environments for clients to connect to the database. These VIPs are static IP addresses associated with (virtual) hostnames and resolved through DNS (except when using 11gR2 GNS).

During the installation of the Oracle Clusterware users are prompted to enter a Virtual IP and Virtual hostname for each of the node in the cluster. These are stored within the OCR (Oracle Cluster Registry) and different components within the HA framework depend on these VIPs. If for some reason the need arises to change either the VIP, the VIP hostname, or the subnet, netmask etc, this procedure should be followed.

Note: With Grid Infrastructure 11.2, SCAN and SCAN VIP were introduced for client connections. To modify the SCAN VIP, please refer to Note 952903.1.

Modifying the VIP or VIP Hostname of a 10g or 11g Oracle Clusterware Node

Planning for VIP changes
In general, VIP modification should be done during a scheduled, complete cluster outage.
However in some cases, downtime is not required. For example,if the VIP IP for 1 node was entered incorrectly in DNS,then the modification would need to occur only on that node. From 10.2.0.3 onwards, the ASM/database instance dependency on the VIP resource is removed, so the VIP could be modified without having to take down the ASM/database instance, only client connections to this node will be impacted during this time.

Gathering Current VIP Configuration

1. Gather the existing setup
for 10g and 11gR1, as CRS owner:

$ srvctl config nodeapps -n -a
eg:
$ srvctl config nodeapps -n racnode1 -a
VIP exists.: /racnode1-vip/101.17.80.184/255.255.254.0/eth1

for 11gR2, as Grid owner:
$ srvctl config nodeapps -a
eg:
$ srvctl config nodeapps -a
Network exists: 1/101.17.80.0/255.255.254.0/eth1, type static
VIP exists: /racnode1-vip/101.17.80.184/101.17.80.0/255.255.254.0/eth1, hosting node racnode1
VIP exists: /racnode2-vip/101.17.80.186/101.17.80.0/255.255.254.0/eth1, hosting node racnode2

2. Verify VIP status
$ crs_stat -t (or $ crsctl stat res -t for 11gR2)
- it should show VIPs are ONLINE

$ ifconfig -a
(netstat -in for HP and ipconfig /all for Windows)
- VIP logical interface is bind to the public network interface

Stopping Resources

3. Stop the nodeapps resources and all dependent resources (stop ASM/DB instance only required for full outage):

10g and 11gR1, as CRS owner:
$ srvctl stop asm -n
$ srvctl stop instance -d -i
$ srvctl stop nodeapps -n
eg, 
$ srvctl stop asm -n racnode1
$ srvctl stop instance -d RACDB -i RACDB1
$ srvctl stop nodeapps -n racnode1

11gR2, as Grid owner:
$ srvctl stop instance -d -n
$ srvctl stop vip -n -f
eg, 
$ srvctl stop instance -d RACDB -n racnode1
$ srvctl stop vip -n racnode1 -f

Note: The -f option is required for 11gR2, otherwise following error will occur:
PRCR-1014 : Failed to stop resource ora.racnode1.vip
PRCR-1065 : Failed to stop resource ora.racnode1.vip
CRS-2529: Unable to act on 'ora.racnode1.vip' because that would require stopping or relocating 'ora.LISTENER.lsnr', but the force option was not specified
...

To prevent the automatic startup of ASM or database instances until the change has been verified, one might want to disable the corresponding resources:

$ srvctl disable database -d
$ srvctl disable asm -n  (only applicable for pre-11.2)
$ srvctl disable nodeapps  (only applicable for 11.2+)


4. Verify VIP is now OFFLINE and the interface is no longer bound to the public network interface
$ crs_stat -t (or $ crsctl stat res -t for 11gR2)

$ ifconfig -a
(netstat -in for HP and ipconfig /all for windows)

Modifying VIP and Its Associated Attributes

5. Determine the new VIP IP/subnet/netmask or VIP hostname, make the network change on OS first, ensure the new VIP is registered in DNS or modified in 

/etc/hosts (for Unix/Linux) and \WINDOWS\System32\drivers\etc\hosts file (for Windows). If the network interface is changed, ensure the new interface is 

available on the server before proceeding with the modification.

For example:
New VIP is: 110.11.70.11 racnode1-nvip
new subnet is 110.11.70.0
new netmask is 255.255.255.0
new interface is eth2

6. Modify the VIP resource

as root user:
# srvctl modify nodeapps -n -A //<[if1[if2...]]>

eg:
# srvctl modify nodeapps -n racnode1 -A racnode1-nvip/255.255.255.0/eth2

* A special case for 11gR2 modifying the VIP hostname only without changing the IP address.
For example: only VIP hostname changes from racnode1-vip to racnode1-nvip, IP and other attributes remain same.

If IP address is not changed, above modify command will not change the USR_ORA_VIP value in 'crsctl stat res ora.racnode1.vip -p' output. To workaround:

1. modify VIP to use another valid hostname, for example node2 VIP host:
# srvctl modify nodeapps -n racnode1 -A racnode2-vip/255.255.255.0/eth2

2. modify VIP again to use the new VIP hostname
# srvctl modify nodeapps -n racnode1 -A racnode1-nvip/255.255.255.0/eth2

3. Verify the changes for USR_ORA_VIP field:
# crsctl stat res ora.racnode1.vip -p

Note 1: For Windows platform, the interface name needs to be in quote (") if there is space in between, eg:
As administrator user or software install user:
> srvctl modify nodeapps -n racnode1 -A 110.11.70.11/255.255.255.0/"Local Area Connection 1"

Note 2: Starting with 11.2, the VIP depends on network resource (ora.net1.network), the OCR only records the VIP hostname or the IP address associated with 

the VIP resource. The network attributes (subnet/netmask) is recorded with the network resource.

From 11.2.0.2 onwards, if only subnet/netmask change is required, network resource can be modified directly via srvctl modify network command.

as root user:
# srvctl modify network -k ] [-S /[/if1[|if2...]]
eg:
# srvctl modify network -k 1 -S 110.11.70.0/255.255.255.0/eth2

There is no need to modify VIP or SCAN if other attributes are not changed.


7. Verify the change

$ srvctl config nodeapps -n -a (10g and 11gR1)
$ srvctl config nodeapps -a (11gR2)
eg:
$ srvctl config nodeapps -n racnode1 -a
VIP exists.: /racnode1-nvip/110.11.70.11/255.255.255.0/eth2

Restarting Resources

8. Start the nodeapps and the other resources

If resources are disabled before, they can be enabled now with
$ srvctl enable nodeapps
$ srvctl enable asm -n
$ srvctl enable database -d

As CRS or Grid Infrastructure user:

$ srvctl start nodeapps -n
$ srvctl start instance -d -i
$ srvctl start asm -n
eg:
$ srvctl start nodeapps -n racnode1
$ srvctl start instance -d RACDB -i RACDB1
$ srvctl start asm -n racnode1

9. Verify the new VIP is ONLINE and bind to the public network interface

$ crs_stat -t (or $ crsctl stat res -t for 11gR2)

$ ifconfig -a
(netstat -in for HP or ipconfig /all for windows)

10. Repeat the same steps for the rest nodes in the cluster only if the similar change is required.

Others

11. Modify listener.ora and tnsnames.ora for release prior to 11gR2 to reflect the VIP change if necessary.

12. Check oifcfg getif, make necessary change as required. Please refer to Note 283684.1

References

NOTE:283684.1 - How to Change Interconnect/Public Network (Interface or Subnet) in Oracle Clusterware
NOTE:952903.1 - How to update the IP address of the SCAN VIP resources (ora.scan.vip)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24867586/viewspace-714343/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Long run transtaction
请登录后发表评论 登录
全部评论

注册时间:2011-02-11

  • 博文量
    167
  • 访问量
    360364