Get the App
SLTechnology News&Howtos  ›  Database  › 

ORACLE RAC11G changes IP address

Shulou Source: shulou.com Published: 2022-06-01 12:30:56 10月14日 Update

Environment: oracle 11.2.0.4 rac

IP address before modification

# public ip

192.168.2.71 db1

192.168.2.72 db2

192.168.2.76 db3

# priv ip

200.100.100.11 db1-priv

200.100.100.12 db2-priv

200.100.100.13 db3-priv

# vip ip

192.168.2.73 db1-vip

192.168.2.74 db2-vip

192.168.2.77 db3-vip

# scan ip

192.168.2.75 db-scan

Modified IP address

# public ip

192.168.1.71 db1

192.168.1.72 db2

192.168.1.76 db3

# priv ip

100.100.100.11 db1-priv

100.100.100.12 db2-priv

100.100.100.13 db3-priv

# vip ip

192.168.1.73 db1-vip

192.168.1.74 db2-vip

192.168.1.77 db3-vip

# scan ip

192.168.1.75 db-scan

1. View the backup of ocr

[root@db1 bin] #. / ocrconfig-showbackup

2. Backup OCR

[root@db1 bin] #. / ocrconfig-manualbackup

Db3 2015-01-29 19:58:22 / u01/app/11.2.0/grid/cdata/db-scan/backup_20150129_195822.ocr

3. Close the database

Srvctl stop database-d db

4. Modify on any node:

Here I operate on Node 1.

[root@db1 ~] # cd / u01/app/11.2.0/grid/bin/

[root@db1 bin] #. / oifcfg getif

Eth0 192.168.2.0 global public

Eth2 200.100.100.0 global cluster_interconnect

[root@db1 bin] #. / oifcfg delif-global eth0

[root@db1 bin] #. / oifcfg setif-global eth0/192.168.1.0:public

[root@db1 bin] #. / oifcfg getif

Eth2 200.100.100.0 global cluster_interconnect

Eth0 192.168.1.0 global public

[root@db1 bin] #. / oifcfg delif-global eth2

PRIF-31: Failed to delete the specified network interface because it is the last private interface

Deleting the last private interface is not allowed here. You can add a private interface first and then delete it.

[root@db1 bin] #. / oifcfg setif-global eth2/200.100.100.0:cluster_interconnect

[root@db1 bin] #. / oifcfg getif

Eth2 100.100.100.0 global cluster_interconnect

Eth0 192.168.2.0 global public

Eth2 200.100.100.0 global cluster_interconnect

[root@db1 bin] #. / oifcfg delif-global eth2/100.100.100.0:cluster_interconnect

[root@db1 bin] #. / oifcfg getif

Eth0 192.168.2.0 global public

Eth2 200.100.100.0 global cluster_interconnect

Stop the oracle high-availability service at a node

[root@db1 bin] #. / crsctl stop cluster-all

5. Modify the IP address and / etc/hosts file and test

6. Restart all services on all nodes

[root@db1 bin] #. / crsctl start cluster-all

7. Stop scan_listener and scan

[root@db1 bin] #. / srvctl stop scan_listener

[root@db1 bin] #. / srvctl stop scan

8. Delete scan_listener and scan

[root@db1 bin] #. / srvctl remove scan_listener-f

[root@db1 bin] #. / srvctl remove scan-f

9. Add scan and scan_listener

[root@db1 bin] #. / srvctl add scan-n db-scan-k 2-S 192.168.1.0/255.255.255.0/eth0

Description: an error will be reported if-k is 1 (network number) in the above command, because it has been used before

[root@db1 bin] #. / srvctl config scan

SCAN name: db-scan, Network: 2/192.168.1.0/255.255.255.0/eth0

SCAN VIP name: scan1, IP: / db-scan/192.168.1.75

[root@db1 bin] #. / srvctl add scan_listener

10. Start scan and scan_listener

[root@db1 bin] #. / srvctl start scan

[root@db1 bin] #. / srvctl start scan_listener

11. Stop VIP resources

[root@db1 bin] #. / crsctl stop resource ora.db1.vip-f

[root@db1 bin] #. / crsctl stop resource ora.db2.vip-f

[root@db1 bin] #. / crsctl stop resource ora.db3.vip-f

You can view the status of vip here with the following command

[root@db1 bin] #. / crsctl stat res-t

Ora.db1.vip

1 OFFLINE OFFLINE

Ora.db2.vip

1 OFFLINE OFFLINE

Ora.db3.vip

1 OFFLINE OFFLINE

12. Modify vip address

[root@db1 bin] #. / srvctl modify nodeapps-A 192.168.1.73/255.255.255.0/eth0-n db1

[root@db1 bin] #. / srvctl modify nodeapps-A 192.168.1.74/255.255.255.0/eth0-n db2

[root@db1 bin] #. / srvctl modify nodeapps-A 192.168.1.77/255.255.255.0/eth0-n db3

13. Start the VIP resource:

[root@db1 bin] #. / crsctl start resource ora.db1.vip-f

CRS-2672: Attempting to start 'ora.db1.vip' on' db1'

CRS-2676: Start of 'ora.db1.vip' on' db1' succeeded

[root@db1 bin] #. / crsctl start resource ora.db2.vip-f

CRS-2672: Attempting to start 'ora.db2.vip' on' db2'

CRS-2676: Start of 'ora.db2.vip' on' db2' succeeded

[root@db1 bin] #. / crsctl start resource ora.db3.vip-f

CRS-2672: Attempting to start 'ora.db3.vip' on' db3'

CRS-2676: Start of 'ora.db3.vip' on' db3' succeeded

After the VIP resource is started, local listening has already been started. The following step 14 may not be performed.

14. Start local monitoring:

[root@db1 bin] #. / srvctl start listener-n db1

[root@db1 bin] #. / srvctl start listener-n db2

[root@db1 bin] #. / srvctl start listener-n db3

Problem: execute oifcfg getif after the operation is complete, which appears in the prompt below

[grid@db1 peer] $oifcfg getif

Eth0 192.168.1.0 global public

Eth2 100.100.100.0 global cluster_interconnect

Only in OCR: eth2: 100.100.100.0 global cluster_interconnect

PRIF-30: Network information in OCR and GPnP profile differs

It is said that the network information is inconsistent between OCR and GPnP. You can reconfigure it here.

[grid@db1 peer] $oifcfg setif-global eth2/100.100.100.0:cluster_interconnect

[grid@db1 peer] $oifcfg getif

Eth0 192.168.1.0 global public

Eth2 100.100.100.0 global cluster_interconnect

Tags: Address node resource information command backup interface service monitor private consistent can be passed data database file is in status environment say network problem Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia MySQL Microsoft Apple