暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

【RAC添加节点】oracle 19c RAC添加节点

原创 yang 2023-02-05
1700

一、修改所有节点的hosts文件

#plublic ip

192.168.162.60 19c01

192.168.162.61 19c02

192.168.162.65 19c03

#private ip

10.10.10.100    19c01-priv

10.10.10.200    19c02-priv

10.10.10.205    19c03-priv

#virtual ip

192.168.162.62  19c01-vip

192.168.162.63  19c02-vip

192.168.162.66  19c03-vip

#scan ip

192.168.162.64  cluster-19c-scan

 

二、新增节点(19c03)识别共享存储

[root@19c03 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.162.99

[root@19c03 ~]# iscsiadm -m discovery -t sendtargets -p 10.10.10.99

 

[root@19c03 ~]# iscsiadm --mode node --targetname iqn.2006-01.com.openfiler:tsn.f3225f4adcf4 --portal 192.168.162.99:3260 --login

[root@19c03 ~]# iscsiadm --mode node --targetname iqn.2006-01.com.openfiler:tsn.f3225f4adcf4 --portal 10.10.10.99:3260 --login

 

将节点1的multipath.conf和99-oracle-asmdevices.rules传输到节点3

[root@19c01 ~]# scp /etc/multipath.conf 19c03:/etc/

[root@19c01 ~]# scp /etc/udev/rules.d/99-oracle-asmdevices.rules 19c03:/etc/udev/rules.d/99-oracle-asmdevices.rules

 

启动multipathd.service,使udev规则生效

[root@19c03 ~]# systemctl restart multipathd.service

[root@19c03 ~]# udevadm trigger

 

三、配置新增节点(19c03)用户环境变量

su - oracle

vi .bash_profile

export PATH

export ORACLE_SID=orcl3

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=/u01/app/oracle/product/19.3.0/db_1

export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

 

su - grid

vi .bash_profile

export PATH

export ORACLE_SID=+ASM3

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/19.3.0/grid

export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

 

四、各个节点配置互信(oracle、grid)

新增节点(19c03)执行:

mkdir ~/.ssh

chmod 700 ~/.ssh

cd .ssh/

ssh-keygen -t dsa

ssh-keygen -t rsa

 

节点一执行:

ssh 19c03 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

ssh 19c03 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

scp ~/.ssh/authorized_keys 19c02:~/.ssh/authorized_keys

scp ~/.ssh/authorized_keys 19c03:~/.ssh/authorized_keys

 

检查各节点间互信:

ssh 19c01 date

ssh 19c02 date

ssh 19c03 date

ssh 19c01-priv date

ssh 19c02-priv date

ssh 19c03-priv date

 

五、新增节点(19c03)安装前预检查

[grid@19c01 bin]$ cluvfy comp peer -refnode 19c01 -n 19c03 -verbose

 

六、新增GI节点

[grid@19c01 grid]$ export DISPLAY=192.168.162.1:0.0

[grid@19c01 grid]$ ./gridSetup.sh

Launching Oracle Grid Infrastructure Setup Wizard...

 








 

执行/u01/app/oraInventory/orainstRoot.sh脚本:

[root@19c03 .ssh]# /u01/app/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

 

Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

[root@19c03 .ssh]#

 

[root@19c03 .ssh]# /u01/app/19.3.0/grid/root.sh

Performing root user operation.

 

The following environment variables are set as:

    ORACLE_OWNER= grid

    ORACLE_HOME=  /u01/app/19.3.0/grid

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...

 

 

Creating /etc/oratab file...

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Relinking oracle with rac_on option

Using configuration parameter file: /u01/app/19.3.0/grid/crs/install/crsconfig_params

The log of current session can be found at:

  /u01/app/grid/crsdata/19c03/crsconfig/rootcrs_19c03_2022-11-22_06-56-27PM.log

2022/11/22 18:56:40 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.

2022/11/22 18:56:40 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.

2022/11/22 18:56:40 CLSRSC-363: User ignored prerequisites during installation

2022/11/22 18:56:40 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.

2022/11/22 18:56:41 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.

2022/11/22 18:56:49 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.

2022/11/22 18:56:49 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.

2022/11/22 18:56:53 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.

2022/11/22 18:56:55 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.

2022/11/22 18:56:56 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.

2022/11/22 18:57:09 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.

2022/11/22 18:57:09 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.

2022/11/22 18:57:12 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.

2022/11/22 18:57:12 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'

2022/11/22 18:57:20 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.

2022/11/22 18:57:45 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.

2022/11/22 18:57:49 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.

2022/11/22 18:57:52 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.

2022/11/22 18:57:55 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.

2022/11/22 18:58:13 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.

2022/11/22 19:00:26 CLSRSC-343: Successfully started Oracle Clusterware stack

2022/11/22 19:00:26 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.

clscfg: EXISTING configuration version 19 detected.

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

2022/11/22 19:02:10 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.

2022/11/22 19:03:16 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

[root@19c03 .ssh]#

 

[root@19c03 .ssh]# /u01/app/19.3.0/grid/bin/crsctl stat res -t -init

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.asm

      1        ONLINE  ONLINE       19c03                    STABLE

ora.cluster_interconnect.haip

      1        ONLINE  ONLINE       19c03                    STABLE

ora.crf

      1        ONLINE  ONLINE       19c03                    STABLE

ora.crsd

      1        ONLINE  ONLINE       19c03                    STABLE

ora.cssd

      1        ONLINE  ONLINE       19c03                    STABLE

ora.cssdmonitor

      1        ONLINE  ONLINE       19c03                    STABLE

ora.ctssd

      1        ONLINE  ONLINE       19c03                    OBSERVER,STABLE

ora.diskmon

      1        OFFLINE OFFLINE                               STABLE

ora.evmd

      1        ONLINE  ONLINE       19c03                    STABLE

ora.gipcd

      1        ONLINE  ONLINE       19c03                    STABLE

ora.gpnpd

      1        ONLINE  ONLINE       19c03                    STABLE

ora.mdnsd

      1        ONLINE  ONLINE       19c03                    STABLE

ora.storage

      1        ONLINE  ONLINE       19c03                    STABLE

--------------------------------------------------------------------------------

[root@19c03 .ssh]#

 

[root@19c03 .ssh]# /u01/app/19.3.0/grid/bin/crsctl stat res -t

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.LISTENER.lsnr

               ONLINE  ONLINE       19c01                    STABLE

               ONLINE  ONLINE       19c02                    STABLE

               ONLINE  ONLINE       19c03                    STABLE

ora.chad

               ONLINE  ONLINE       19c01                    STABLE

               ONLINE  ONLINE       19c02                    STABLE

               ONLINE  ONLINE       19c03                    STABLE

ora.net1.network

               ONLINE  ONLINE       19c01                    STABLE

               ONLINE  ONLINE       19c02                    STABLE

               ONLINE  ONLINE       19c03                    STABLE

ora.ons

               ONLINE  ONLINE       19c01                    STABLE

               ONLINE  ONLINE       19c02                    STABLE

               ONLINE  ONLINE       19c03                    STABLE

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.19c01.vip

      1        ONLINE  ONLINE       19c01                    STABLE

ora.19c02.vip

      1        ONLINE  ONLINE       19c02                    STABLE

ora.19c03.vip

      1        ONLINE  ONLINE       19c03                    STABLE

ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)

      1        ONLINE  ONLINE       19c02                    STABLE

      2        ONLINE  ONLINE       19c01                    STABLE

      3        ONLINE  ONLINE       19c03                    STABLE

ora.DATA.dg(ora.asmgroup)

      1        ONLINE  ONLINE       19c02                    STABLE

      2        ONLINE  ONLINE       19c01                    STABLE

      3        ONLINE  ONLINE       19c03                    STABLE

ora.FRA.dg(ora.asmgroup)

      1        ONLINE  ONLINE       19c02                    STABLE

      2        ONLINE  ONLINE       19c01                    STABLE

      3        ONLINE  ONLINE       19c03                    STABLE

ora.LISTENER_SCAN1.lsnr

      1        ONLINE  ONLINE       19c02                    STABLE

ora.OCR.dg(ora.asmgroup)

      1        ONLINE  ONLINE       19c02                    STABLE

      2        ONLINE  ONLINE       19c01                    STABLE

      3        ONLINE  ONLINE       19c03                    STABLE

ora.OCRNEW.dg(ora.asmgroup)

      1        ONLINE  ONLINE       19c02                    STABLE

      2        ONLINE  ONLINE       19c01                    STABLE

      3        ONLINE  ONLINE       19c03                    STABLE

ora.asm(ora.asmgroup)

      1        ONLINE  ONLINE       19c02                    Started,STABLE

      2        ONLINE  ONLINE       19c01                    Started,STABLE

      3        ONLINE  ONLINE       19c03                    Started,STABLE

ora.asmnet1.asmnetwork(ora.asmgroup)

      1        ONLINE  ONLINE       19c02                    STABLE

      2        ONLINE  ONLINE       19c01                    STABLE

      3        ONLINE  ONLINE       19c03                    STABLE

ora.cvu

      1        ONLINE  ONLINE       19c02                    STABLE

ora.orcl.db

      1        ONLINE  ONLINE       19c01                   Open,HOME=/u01/app/o

                                                             racle/product/19.3.0

                                                             /db_1,STABLE

      2        ONLINE  ONLINE       19c02                    Open,HOME=/u01/app/o

                                                             racle/product/19.3.0

                                                             /db_1,STABLE

ora.qosmserver

      1        ONLINE  ONLINE       19c02                    STABLE

ora.scan1.vip

      1        ONLINE  ONLINE       19c02                    STABLE

--------------------------------------------------------------------------------

[root@19c03 .ssh]#

 


七、新增oracle软件节点

[root@19c01 .ssh]# su - oracle

Last login: Fri Nov 18 20:25:03 CST 2022 on pts/3

[oracle@19c01 ~]$ export DISPLAY=192.168.162.1:0.0

[oracle@19c01 ~]$

[oracle@19c01 ~]$ cd $ORACLE_HOME/addnode

[oracle@19c01 addnode]$ ls

addnode_oraparam.ini  addnode_oraparam.ini.sbs  addnode.pl  addnode.sh

[oracle@19c01 addnode]$

[oracle@19c01 addnode]$ ./addnode.sh "CLUSTER_NEW_NODES={19c03}"











 

执行/u01/app/oracle/product/19.3.0/db_1/root.sh脚本:

[root@19c03 .ssh]# /u01/app/oracle/product/19.3.0/db_1/root.sh

Performing root user operation.

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/19.3.0/db_1

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The contents of "dbhome" have not changed. No need to overwrite.

The contents of "oraenv" have not changed. No need to overwrite.

The contents of "coraenv" have not changed. No need to overwrite.

 

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

[root@19c03 .ssh]#

 

 

八、dbca新增oracle实例

[oracle@19c01 ~]$ export DISPLAY=192.168.162.1:0.0

[oracle@19c01 addnode]$ dbca









[root@19c03 ~]# /u01/app/19.3.0/grid/bin/crsctl stat res -t

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.LISTENER.lsnr

               ONLINE  ONLINE       19c01                    STABLE

               ONLINE  ONLINE       19c02                    STABLE

               ONLINE  ONLINE       19c03                    STABLE

ora.chad

               ONLINE  ONLINE       19c01                    STABLE

               ONLINE  ONLINE       19c02                    STABLE

               ONLINE  ONLINE       19c03                    STABLE

ora.net1.network

               ONLINE  ONLINE       19c01                    STABLE

               ONLINE  ONLINE       19c02                    STABLE

               ONLINE  ONLINE       19c03                    STABLE

ora.ons

               ONLINE  ONLINE       19c01                    STABLE

               ONLINE  ONLINE       19c02                    STABLE

               ONLINE  ONLINE       19c03                    STABLE

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.19c01.vip

      1        ONLINE  ONLINE       19c01                    STABLE

ora.19c02.vip

      1        ONLINE  ONLINE       19c02                    STABLE

ora.19c03.vip

      1        ONLINE  ONLINE       19c03                    STABLE

ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)

      1        ONLINE  ONLINE       19c01                    STABLE

      2        ONLINE  ONLINE       19c03                    STABLE

      3        ONLINE  ONLINE       19c02                    STABLE

ora.DATA.dg(ora.asmgroup)

      1        ONLINE  ONLINE       19c01                    STABLE

      2        ONLINE  ONLINE       19c03                    STABLE

      3        ONLINE  ONLINE       19c02                    STABLE

ora.FRA.dg(ora.asmgroup)

      1        ONLINE  ONLINE       19c01                    STABLE

      2        ONLINE  ONLINE       19c03                    STABLE

      3        ONLINE  ONLINE       19c02                    STABLE

ora.LISTENER_SCAN1.lsnr

      1        ONLINE  ONLINE       19c03                    STABLE

ora.OCR.dg(ora.asmgroup)

      1        ONLINE  ONLINE       19c01                    STABLE

      2        ONLINE  ONLINE       19c03                    STABLE

      3        ONLINE  ONLINE       19c02                    STABLE

ora.asm(ora.asmgroup)

      1        ONLINE  ONLINE       19c01                    Started,STABLE

      2        ONLINE  ONLINE       19c03                    Started,STABLE

      3        ONLINE  ONLINE       19c02                    Started,STABLE

ora.asmnet1.asmnetwork(ora.asmgroup)

      1        ONLINE  ONLINE       19c01                    STABLE

      2        ONLINE  ONLINE       19c03                    STABLE

      3        ONLINE  ONLINE       19c02                    STABLE

ora.cvu

      1        ONLINE  ONLINE       19c03                    STABLE

ora.orcl.db

      1        ONLINE  ONLINE       19c01                    Open,HOME=/u01/app/o

                                                             racle/product/19.3.0

                                                             /db_1,STABLE

      2        ONLINE  ONLINE       19c02                    Open,HOME=/u01/app/o

                                                             racle/product/19.3.0

                                                             /db_1,STABLE

      3        ONLINE  ONLINE       19c03                    Open,HOME=/u01/app/o

                                                             racle/product/19.3.0

                                                             /db_1,STABLE

ora.qosmserver

      1        ONLINE  ONLINE       19c03                    STABLE

ora.scan1.vip

      1        ONLINE  ONLINE       19c03                    STABLE

--------------------------------------------------------------------------------

[root@19c03 ~]#

 

新增节点(19c03)完成。

最后修改时间:2023-02-10 14:00:26
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论