【RAC】OIFCFG 工具的使用

简介: The Oracle Interface Configuration Tool(OIFCFG) command-line interface 命令行工具可以用来定义和管理网卡信息配置:1 Allocate and deallocate network inte...
The Oracle Interface Configuration Tool(OIFCFG) command-line interface 命令行工具可以用来定义和管理网卡信息配置:
1 Allocate and deallocate network interfaces to components
2 Direct components to use specific network interfaces
3 Retrieve component configuration information
grid@rac1:/home/grid>oifcfg -h
Name:
        oifcfg - Oracle Interface Configuration Tool.
Usage:  oifcfg iflist [-p [-n]]
        -p: Displays a heuristic assumption of the interface type (PRIVATE, PUBLIC, or UNKNOWN)
        -n: Displays the netmask
        oifcfg setif {-node | -global} {/:}...
        oifcfg getif [-node | -global] [ -if [/] [-type ] ]
        oifcfg delif {{-node | -global} [[/]] [-force] | -force}
        oifcfg [-help]

-为通信网络所知的主机名 /etc/hosts里面的定义的hostname
- 系统中配置的接口的名称 比如 eth0,eth1
 - 接口的子网地址
- 接口类型 { cluster_interconnect | public }
A network interface can be stored as a global interface (as reported by the iflist command) or as a node-specific interface:
An interface is stored as a global interface when all of the nodes of an Oracle Real Application Clusters (Oracle RAC) cluster have the same interface connected to the same subnet. The global interface (and configuring all nodes with the same network interface for each public subnet and the same network interface for each private subnet) is not only the recommended configuration, but it is also the default installation configuration.
An interface can be stored as a node-specific (local) interface.
Note:
oracle现在还不支持不同节点使用不同的网段。建议rac节点配置public ip和private ip时使用对应的相同的网段。
Oracle currently does not support having different network interfaces for each node in the cluster. 
The best practice is to configure all nodes with the same network interface for each public subnet and the same network interface for each private subnet.
getif查看当前节点的网卡配置属性:
grid@rac1:/home/grid>oifcfg getif
网卡名 子网               接口类型
eth0  10.250.7.0  global  public               公网ip
eth1  10.250.7.0  global  cluster_interconnect 私有ip
iflist显示网卡列表
grid@rac1:/home/grid>oifcfg iflist
eth0  10.250.7.0
eth1  10.250.7.0
eth1  169.254.0.0
grid@rac1:/home/grid>
setif 修改RAC的ip:
Note:
确保当使用setif 命令的时候,所有节点都是正常运行的,因为oracle 不能对down 机的节点的Grid Plug and Play profiles 进行更新
比如修改私有IP
grid@rac1:/home/grid>oifcfg setif -global  eth1/10.10.10.0:cluster_interconnect
grid@rac1:/home/grid>oifcfg getif
eth0  10.250.7.0  global  public
eth1  10.250.7.0  global  cluster_interconnect
eth1  10.10.10.0  global  cluster_interconnect
删除私有ip
Note:
Use the oifcfg delif command to delete the stored configuration for global or node-specific interfaces. A specific node-specific or global interface can be deleted by supplying the interface name, with an optional subnet, on the command line.
Note:
如果执行不带任何对象的oifcfg delif 命令,那么 OIFCFG 集群中所有的网卡配置信息(这个我就不做测试了)
grid@rac1:/home/grid>oifcfg delif -global eth1
PRIF-31: Failed to delete the specified network interface because it is the last private interface
解决办法: Add new private interface first before deleting the old private interface.
对于重复的情况,要具体指定要删除的私有ip
grid@rac1:/home/grid>oifcfg delif -global  eth1/10.250.7.0:cluster_interconnect   
grid@rac1:/home/grid>oifcfg getif 
eth0  10.250.7.0  global  public
eth1  10.10.10.0  global  cluster_interconnect
OIFCFG 使用注意事项:
1 Oracle Universal Installer使用OIFCFG来识别并显示可用的网卡。
2 修改网卡名称的影响视修改的类型(public,private)不同而不同,不论是否同时修改网卡对应ip。 
  比如:In cases where you change only the interface names, the ramifications are minor. 
  如果要修改public类型的网卡对应的name,注意此名称存储在OCR中,必须同时要修改所有节点中的nodeapps。因此必须重启nodeapps以便修改生效
3 当使用global参数修改的时候,必须重启集群中的所有节点;对于本地的修改,则只要重启本地节点就可以了。 
 Interconnect changes for the database occur at instance startup. However, the interconnect for Oracle Clusterware might be different.
4 因为内联心跳是在实例启动的时候被使用,在正在运行的系统上仅仅执行OIFCFG命令并不能立即生效。当且仅当受oifcfg 修改命令影响的组件重启之后,修改生效。
5 对Clusterware层的变更,需要整个集群处于正常运行状态,因为oracle 不能对down 机的节点的Grid Plug and Play profiles 进行更新
crs 没有起来的话会遇到:
grid@rac1:/home/grid>oifcfg getif
PRIF-10: failed to initialize the cluster registry
目录
相关文章
|
存储 文字识别 Oracle
RAC日常管理(10G)
RAC日常管理(10G)
110 0
RAC日常管理(10G)
|
存储 Oracle 网络协议
Oracle10g RAC的安装部署
以前很喜欢Oracle RAC架构,留个笔记。
|
存储 Oracle 关系型数据库
RAC静默安装与DG搭建
1rac静默安装 2、搭建dg
4390 0
|
Oracle 关系型数据库 网络安全
|
SQL Oracle 关系型数据库
|
Oracle 关系型数据库 Linux
|
Oracle 关系型数据库 测试技术
|
Oracle 关系型数据库 Shell
|
存储 Oracle 关系型数据库
|
Oracle 关系型数据库 数据库管理