12C_modify_ip

Posted halberd-lee

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了12C_modify_ip相关的知识,希望对你有一定的参考价值。

ORACLE 12C 修改VIP SCANIP

1 目标确认

首先要确定要改哪些IP,要改成什么

  • 修改前的IP

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    
    # oracle public ip
    192.168.1.14      halberd2
    192.168.1.13      halberd1
    
    #oracle vip
    192.168.1.4      halberd1-vip
    192.168.1.5       halberd2-vip
    
    # oracle priv-ip
    172.26.9.30     halberd1-priv
    172.26.9.31     halberd2-priv
    
    # scan ip
    192.168.1.6       racscan
    192.168.1.7       racscan
    
  • 修改后的IP

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    
    # oracle public ip
    192.168.1.14      halberd2
    192.168.1.13      halberd1
    
    #oracle vip
    192.168.1.6      halberd1-vip
    192.168.1.7       halberd2-vip
    
    # oracle priv-ip
    172.26.9.30     halberd1-priv
    172.26.9.31     halberd2-priv
    
    # scan ip
    192.168.1.4       racscan
    192.168.1.5       racscan
    

2 查看集群信息

root 用户执行

export ORACLE_HOME=/g01/app/12.2.0
export PATH=$PATH:$ORACLE_HOME/bin

 oifcfg getif
eno1  192.168.1.0  global  public
eno3  172.26.9.0  global  cluster_interconnect,asm

srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 192.168.1.0/255.255.255.224/eno1, static
Subnet IPv6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
VIP exists: network number 1, hosting node halberd1
VIP Name: halberd1-vip
VIP IPv4 Address: 192.168.1.4
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
VIP exists: network number 1, hosting node halberd2
VIP Name: halberd2-vip
VIP IPv4 Address: 192.168.1.5
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:


srvctl config scan
SCAN name: racscan, Network: 1
Subnet IPv4: 192.168.1.0/255.255.255.224/eno1, static
Subnet IPv6:
SCAN 1 IPv4 VIP: 192.168.1.6
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
SCAN 2 IPv4 VIP: 192.168.1.7
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:

3 *备份OCR

修改前先备份ocr(2台主机都备份)

ocrconfig -export /home/grid/myocr
PROT-58: successfully exported the Oracle Cluster Registry contents to file ‘/home/grid/myocr‘

4 修改ocr信息

 

4.1 修改网段

只有原IP与目标IP不在一个网段时才需要操作。 本次示例并不需要修改网段,因此下面只是一个示例。

# 删除原有网段配置
oifcfg delif -global eno1/192.168.1.0
# 添加新的网段配置
oifcfg setif -global en8/192.168.2.0:public

修改完,使用下面命令查看是否修改成功 oifcfg getif

4.2 停止SCAN相关

因为本次操作,实际上是VIP 与 SCANIP 对换,因此要停止SCAN相关。

srvctl stop scan_listener

PRCC-1016 : LISTENER_SCAN1 was already stopped
PRCR-1005 : Resource ora.LISTENER_SCAN1.lsnr is already stopped
PRCC-1016 : LISTENER_SCAN2 was already stopped
PRCR-1005 : Resource ora.LISTENER_SCAN2.lsnr is already stopped

srvctl stop scan
srvctl status scan

SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running
SCAN VIP scan2 is enabled
SCAN VIP scan2 is not running

4.3 修改vip

# 停止 VIP
srvctl stop vip -n halberd1 -f
srvctl stop vip -n halberd2 -f
# 修改VIP
srvctl modify nodeapps -n halberd1 -A 192.168.1.6/255.255.255.224/eno1
srvctl modify nodeapps -n halberd2 -A 192.168.1.7/255.255.255.224/eno1
# 查看VIP 修改结果
srvctl config nodeapps -a

# 启动VIP
srvctl start vip -n halberd1
srvctl start vip -n halberd2

4.4 修改scanip

srvctl modify scan -n racscan
srvctl modify scan_listener -u
# 启动scan 和scan监听
srvctl start scan
srvctl start scan_listener

# 检查SCAN-VIP TYPE
crsctl status res -w "TYPE = ora.scan_vip.type" -p|egrep ‘^NAME|^SCAN_NAME|^USR_ORA_VIP‘

NAME=ora.scan1.vip
SCAN_NAME=racscan           ==> scan_name 对应的IP别名或者域名
USR_ORA_VIP=192.168.1.4
NAME=ora.scan2.vip
SCAN_NAME=racscan
USR_ORA_VIP=192.168.1.5

如果scan_name 和vip 地址不对的话,使用下面命令修改

crsctl modify type ora.scan_vip.type -attr "ATTRIBUTE=SCAN_NAME,DEFAULT_VALUE=racscan"

Author: halberd.lee

Created: 2020-05-22 Fri 11:13

Validate

以上是关于12C_modify_ip的主要内容,如果未能解决你的问题,请参考以下文章

VSCode自定义代码片段12——JavaScript的Promise对象

12个用得着的 JQuery 代码片段

JavaScript 有用的代码片段和 trick

2021-12-24:划分字母区间。 字符串 S 由小写字母组成。我们要把这个字符串划分为尽可能多的片段,同一字母最多出现在一个片段中。返回一个表示每个字符串片段的长度的列表。 力扣763。某大厂面试

动态 Rstudio 代码片段

C++ 代码片段执行