19C RAC节点删除新增
标签: 19C RAC节点删除新增
2023-07-03 18:23:27 355浏览
19C RAC节点删除新增
19C RAC节点删除新增
一、节点删除
要删除节点为节点2,节点名称:ptadg2 实例名称:bship2
1.1 删除前环境检查
1.1.1 集群状态检查
[grid@ptadg1 grid]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE ptadg1 STABLE
ONLINE ONLINE ptadg2 STABLE
ora.chad
ONLINE ONLINE ptadg1 STABLE
ONLINE ONLINE ptadg2 STABLE
ora.net1.network
ONLINE ONLINE ptadg1 STABLE
ONLINE ONLINE ptadg2 STABLE
ora.ons
ONLINE ONLINE ptadg1 STABLE
ONLINE ONLINE ptadg2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ARCH.dg(ora.asmgroup)
1 ONLINE ONLINE ptadg1 STABLE
2 ONLINE ONLINE ptadg2 STABLE
3 OFFLINE OFFLINE STABLE
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE ptadg1 STABLE
2 ONLINE ONLINE ptadg2 STABLE
3 ONLINE OFFLINE STABLE
ora.CRS.dg(ora.asmgroup)
1 ONLINE ONLINE ptadg1 STABLE
2 ONLINE ONLINE ptadg2 STABLE
3 OFFLINE OFFLINE STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE ptadg1 STABLE
2 ONLINE ONLINE ptadg2 STABLE
3 OFFLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE ptadg2 STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE ptadg1 Started,STABLE
2 ONLINE ONLINE ptadg2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE ptadg1 STABLE
2 ONLINE ONLINE ptadg2 STABLE
3 OFFLINE OFFLINE STABLE
ora.bship.db
1 ONLINE ONLINE ptadg1 Open,HOME=/u01/app/o
racle/product/19.3.0
.0/db_1,STABLE
2 ONLINE ONLINE ptadg2 Open,HOME=/u01/app/o
racle/product/19.3.0
.0/db_1,STABLE
ora.cvu
1 ONLINE ONLINE ptadg2 STABLE
ora.ptadg1.vip
1 ONLINE ONLINE ptadg1 STABLE
ora.ptadg2.vip
1 ONLINE ONLINE ptadg2 STABLE
ora.qosmserver
1 ONLINE ONLINE ptadg2 STABLE
ora.scan1.vip
1 ONLINE ONLINE ptadg2 STABLE
--------------------------------------------------------------------------------
1.1.2 集群构成
[grid@ptadg1 grid]$ olsnodes -s -t
ptadg1 Active Unpinned
ptadg2 Active Unpinned
1.2 备份
1.2.1 OCR手动备份
[grid@ptadg1 grid]$ ocrconfig -showbackup
ptadg2 2023/07/03 10:37:54 +CRS:/ptadg-cluster/OCRBACKUP/backup00.ocr.258.1141209461 724960844
ptadg2 2023/07/03 06:37:39 +CRS:/ptadg-cluster/OCRBACKUP/backup01.ocr.265.1141195047 724960844
ptadg2 2023/07/03 02:37:24 +CRS:/ptadg-cluster/OCRBACKUP/backup02.ocr.262.1141180631 724960844
ptadg2 2023/07/02 02:35:54 +CRS:/ptadg-cluster/OCRBACKUP/day.ocr.259.1141094155 724960844
ptadg2 2023/06/22 02:20:56 +CRS:/ptadg-cluster/OCRBACKUP/week.ocr.260.1140142859 724960844
PROT-25: Manual backups for the Oracle Cluster Registry are not available
这里提示没有手动备份,我们可以用下面命令手动备份一份:
[grid@ptadg1 grid]$ ocrconfig -manualbackup
1.2.2 做好数据库数据备份
略。。。
1.3 删除数据库实例
Oracle用户删除实例(在一个保留节点上运行)
**[oracle@ptadg1 ~]$ dbca -silent -deleteInstance -nodeList ptadg2 -gdbName bship -instanceName bship2 -sysDBAUserName sys -sysDBAPassword manager**
参数含义:
-nodeList(删除实例所在的节点) -gdbName(表示数据库的名字) -instanceName(表示要删除的实例名字) -sysDBAUserName(表示超级管理员) -sysDBAPassword(管理员密码)
[WARNING] [DBT-19203] The Database Configuration Assistant will delete the Oracle instance and its associated OFA directory structure. All information about this instance will be deleted.
Prepare for db operation
40% complete
Deleting instance
48% complete
52% complete
56% complete
60% complete
64% complete
68% complete
72% complete
76% complete
80% complete
Completing instance management.
100% complete
Instance "bship2" deleted successfully from node "ptadg2".
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/bship/bship.log" for further details.
此时看集群状态,能看到节点2 实例已经从集群中移除。
[oracle@ptadg1 ~]$ srvctl config database -d bship
Database unique name: bship
Database name: bship
Oracle home: /u01/app/oracle/product/19.3.0.0/db_1
Oracle user: oracle
Spfile: +DATA/BSHIP/PARAMETERFILE/spfile.268.1138968553
Password file: +DATA/BSHIP/PASSWORD/pwdbship.256.1138966917
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances: bship1 --只剩节点一实例
Configured nodes: ptadg1
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed
1.4 删除数据库软件
1.4.1 更新inventory(在被删除节点执行)
[oracle@ptadg2 bin]$ cd $ORACLE_HOME/oui/bin --注意这里的runInstaller目录,不是和安装数据库同一个。
[oracle@ptadg2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={ptadg2}" -local
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 131068 MB Passed
The inventory pointer is located at /etc/oraInst.loc
1.4.2 删除数据库软件(在被删除节点执行)
[oracle@ptadg2 deinstall]$ cd $ORACLE_HOME/
[oracle@ptadg2 db_1]$ cd deinstall/
[oracle@ptadg2 deinstall]$ ls
bootstrap_files.lst bootstrap.pl deinstall deinstall.pl deinstall.xml jlib readme.txt response sshUserSetup.sh utl
[oracle@ptadg2 deinstall]$ ./deinstall -local
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /u01/app/oraInventory/logs/
############ ORACLE DECONFIG TOOL START ############
######################### DECONFIG CHECK OPERATION START #########################
## [START] Install check configuration ##
Checking for existence of the Oracle home location /u01/app/oracle/product/19.3.0.0/db_1
Oracle Home type selected for deinstall is: Oracle Real Application Cluster Database
Oracle Base selected for deinstall is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/19.3.0.0/grid
The following nodes are part of this cluster: ptadg2,ptadg1
Checking for sufficient temp space availability on node(s) : 'ptadg2'
## [END] Install check configuration ##
Network Configuration check config START
Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2023-07-03_03-10-54PM.log
Network Configuration check config END
Database Check Configuration START
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check2023-07-03_03-10-54PM.log
Use comma as separator when specifying list of values as input
Specify the list of database names that are configured locally on this node for this Oracle home. Local configurations of the discovered databases will be removed []: --直接回车
Database Check Configuration END
######################### DECONFIG CHECK OPERATION END #########################
####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/19.3.0.0/grid
The following nodes are part of this cluster: ptadg2,ptadg1
The cluster node(s) on which the Oracle home deinstallation will be performed are:ptadg2
Oracle Home selected for deinstall is: /u01/app/oracle/product/19.3.0.0/db_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Do you want to continue (y - yes, n - no)? [n]: y --选y
A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2023-07-03_03-10-46-PM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2023-07-03_03-10-46-PM.err'
######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2023-07-03_03-10-54PM.log
Network Configuration clean config START
Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2023-07-03_03-10-54PM.log
Network Configuration clean config END
######################### DECONFIG CLEAN OPERATION END #########################
####################### DECONFIG CLEAN OPERATION SUMMARY #######################
#######################################################################
############# ORACLE DECONFIG TOOL END #############
Using properties file /tmp/deinstall2023-07-03_03-10-20PM/response/deinstall_2023-07-03_03-10-46-PM.rsp
Location of logs /u01/app/oraInventory/logs/
############ ORACLE DEINSTALL TOOL START ############
####################### DEINSTALL CHECK OPERATION SUMMARY #######################
A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2023-07-03_03-10-46-PM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2023-07-03_03-10-46-PM.err'
######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to ptadg2
Setting CLUSTER_NODES to ptadg2
Setting CRS_HOME to false
Setting oracle.installer.invPtrLoc to /tmp/deinstall2023-07-03_03-10-20PM/oraInst.loc
Setting oracle.installer.local to true
## [END] Preparing for Deinstall ##
Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START
Detach Oracle home '/u01/app/oracle/product/19.3.0.0/db_1' from the central inventory on the local node : Done
Delete directory '/u01/app/oracle/product/19.3.0.0/db_1' on the local node : Done
The Oracle Base directory '/u01/app/oracle' will not be removed on local node. The directory is not empty. User needs to manually cleanup this directory.
Oracle Universal Installer cleanup was successful.
Oracle Universal Installer clean END
## [START] Oracle install clean ##
## [END] Oracle install clean ##
######################### DEINSTALL CLEAN OPERATION END #########################
####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/oracle/product/19.3.0.0/db_1' from the central inventory on the local node.
Successfully deleted directory '/u01/app/oracle/product/19.3.0.0/db_1' on the local node.
Oracle Universal Installer cleanup was successful.
Review the permissions and contents of '/u01/app/oracle' on nodes(s) 'ptadg2'.
If there are no Oracle home(s) associated with '/u01/app/oracle', manually delete '/u01/app/oracle' and its contents.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################
############# ORACLE DEINSTALL TOOL END #############
1.4.3 更新inventory(在保留的节点上执行)
[oracle@ptadg1 db_1]$ cd $ORACLE_HOME/oui/bin
[oracle@ptadg1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES=ptadg1" -local
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 131071 MB Passed
The inventory pointer is located at /etc/oraInst.loc
此时在删除节点上执行:
[oracle@ptadg2 deinstall]$ cd $ORACLE_HOME
-bash: cd: /u01/app/oracle/product/19.3.0.0/db_1: No such file or directory
--表示已经删除干净了
1.5 删除GRID软件
1.5.1 集群构成
[grid@ptadg2 ~]$ olsnodes -s -t
ptadg1 Active Unpinned
ptadg2 Active Unpinned
--
1.5.2 禁用集群资源(被删除节点root执行)
[root@ptadg2 ~]# cd /u01/app/19.3.0.0/grid/crs/install/
[root@ptadg2 install]# ./rootcrs.sh -deconfig -force
Using configuration parameter file: /u01/app/19.3.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/ptadg2/crsconfig/crsdeconfig_ptadg2_2023-07-03_03-33-44PM.log
2023/07/03 15:35:10 CLSRSC-4006: Removing Oracle Trace File Analyzer (TFA) Collector.
2023/07/03 15:37:23 CLSRSC-4007: Successfully removed Oracle Trace File Analyzer (TFA) Collector.
2023/07/03 15:37:24 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node
1.5.3 更新inventory(被删除节点)
[grid@ptadg2 ~]$ cd $ORACLE_HOME/oui/bin
[grid@ptadg2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES=ptadg2" CRS=TRUE -silent -local
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 131068 MB Passed
The inventory pointer is located at /etc/oraInst.loc
You can find the log of this install session at:
/u01/app/oraInventory/logs/UpdateNodeList2023-07-03_03-38-38PM.log
'UpdateNodeList' was successful.
1.5.4 删除grid软件(被删除节点)
[grid@ptadg2 bin]$ $ORACLE_HOME/deinstall/deinstall -local --一定要加-local参数啊,不然会删掉所有节点
Checking for required files and bootstrapping ...
Please wait ...
。
。
。
Oracle Universal Installer cleanup completed with errors.
Oracle Universal Installer clean END
## [START] Oracle install clean ##
## [END] Oracle install clean ##
######################### DEINSTALL CLEAN OPERATION END #########################
####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/19.3.0.0/grid' from the central inventory on the local node.
Failed to delete directory '/u01/app/19.3.0.0/grid' on the local node due to error : Either user has no permission to delete or file is in use.
Review the permissions and manually delete '/u01/app/19.3.0.0/grid' on local node.
Failed to delete directory '/u01/app/oraInventory' on the local node due to error : Either user has no permission to delete or file is in use.
Review the permissions and manually delete '/u01/app/oraInventory' on local node.
Oracle Universal Installer cleanup completed with errors.
Run 'rm -r /etc/oraInst.loc' as root on node(s) 'ptadg2' at the end of the session.
Run 'rm -r /opt/ORCLfmap' as root on node(s) 'ptadg2' at the end of the session.
Run 'rm -r /etc/oratab' as root on node(s) 'ptadg2' at the end of the session.
Review the permissions and contents of '/u01/app/grid' on nodes(s) 'ptadg2'.
If there are no Oracle home(s) associated with '/u01/app/grid', manually delete '/u01/app/grid' and its contents.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################
############# ORACLE DEINSTALL TOOL END #############
1.5.5 清除残余文件
先kill掉集群相关进程:
[root@ptadg2 install]# ps -ef |grep ora |awk '{print $2}' |xargs kill -9
kill: sending signal to 75763 failed: No such process
[root@ptadg2 install]# ps -ef |grep grid |awk '{print $2}' |xargs kill -9
kill: sending signal to 75768 failed: No such process
[root@ptadg2 install]# ps -ef |grep asm |awk '{print $2}' |xargs kill -9
kill: sending signal to 75773 failed: No such process
[root@ptadg2 install]# ps -ef |grep storage |awk '{print $2}' |xargs kill -9
kill: sending signal to 75778 failed: No such process
[root@ptadg2 install]# ps -ef |grep ohasd |awk '{print $2}' |xargs kill -9
kill: sending signal to 75784 failed: No such process
[root@ptadg2 install]#
[root@ptadg2 install]# ps -ef |grep grid
root 75801 45673 0 15:58 pts/0 00:00:00 grep --color=auto grid
[root@ptadg2 install]# ps -ef |grep ora
root 75803 45673 0 15:58 pts/0 00:00:00 grep --color=auto ora
[root@ptadg2 install]# ps -ef |grep asm
root 75805 45673 0 15:58 pts/0 00:00:00 grep --color=auto asm
上一步删除集群软件,提示有些文件要手动删除,这里我们也一并删除一下:
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/app/19.0.0.0/grid/
cd $ORACLE_HOME
rm -rf *
cd $ORACLE_BASE
rm -rf *
rm -rf /etc/rc5.d/S96ohasd
rm -rf /etc/rc3.d/S96ohasd
rm -rf /rc.d/init.d/ohasd
rm -rf /etc/oracle
rm -rf /etc/ora*
rm -rf /etc/oratab
rm -rf /etc/oraInst.loc
rm -rf /opt/ORCLfmap/
rm -rf /u01/app/oracle/oraInventory
rm -rf /usr/local/bin/dbhome
rm -rf /usr/local/bin/oraenv
rm -rf /usr/local/bin/coraenv
rm -rf /tmp/*
rm -rf /var/tmp/.oracle
rm -rf /var/tmp
rm -rf /home/grid/*
rm -rf /home/oracle/*
rm -rf /etc/init/oracle*
rm -rf /etc/init.d/ora
rm -rf /tmp/.*
1.5.6 从集群中移除节点(保留节点中执行)
[root@ptadg1 bin]# crsctl delete node -n ptadg2
CRS-4661: Node ptadg2 successfully deleted.
1.5.7 更新inventory(保留节点)
[grid@ptadg1 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES=ptadg1" CRS=TRUE -silent -local
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 131071 MB Passed
The inventory pointer is located at /etc/oraInst.loc
You can find the log of this install session at:
/u01/app/oraInventory/logs/UpdateNodeList2023-07-03_04-08-21PM.log
'UpdateNodeList' was successful.
1.5.8 运行 CVU 命令验证指定节点是否已成功从群集中删除
[grid@ptadg1 ~]$ cluvfy stage -post nodedel -n ptadg2 -verbose
Verifying Node Removal ...
Verifying CRS Integrity ...PASSED
Verifying Clusterware Version Consistency ...PASSED
Verifying Node Removal ...PASSED
Post-check for node removal was successful.
CVU operation performed: stage -post nodedel
Date: Jul 3, 2023 4:09:50 PM
CVU home: /u01/app/19.3.0.0/grid/
User: grid
1.5.9 查看集群状态
[grid@ptadg1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE ptadg1 STABLE
ora.chad
ONLINE ONLINE ptadg1 STABLE
ora.net1.network
ONLINE ONLINE ptadg1 STABLE
ora.ons
ONLINE ONLINE ptadg1 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ARCH.dg(ora.asmgroup)
1 ONLINE ONLINE ptadg1 STABLE
2 ONLINE OFFLINE STABLE
3 OFFLINE OFFLINE STABLE
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE ptadg1 STABLE
2 ONLINE OFFLINE STABLE
3 ONLINE OFFLINE STABLE
ora.CRS.dg(ora.asmgroup)
1 ONLINE ONLINE ptadg1 STABLE
2 ONLINE OFFLINE STABLE
3 OFFLINE OFFLINE STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE ptadg1 STABLE
2 ONLINE OFFLINE STABLE
3 OFFLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE ptadg1 STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE ptadg1 Started,STABLE
2 ONLINE OFFLINE STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE ptadg1 STABLE
2 ONLINE OFFLINE STABLE
3 OFFLINE OFFLINE STABLE
ora.bship.db
1 ONLINE ONLINE ptadg1 Open,HOME=/u01/app/o
racle/product/19.3.0
.0/db_1,STABLE
ora.cvu
1 ONLINE ONLINE ptadg1 STABLE
ora.ptadg1.vip
1 ONLINE ONLINE ptadg1 STABLE
ora.qosmserver
1 ONLINE ONLINE ptadg1 STABLE
ora.scan1.vip
1 ONLINE ONLINE ptadg1 STABLE
--------------------------------------------------------------------------------
新增的话有空再写。
二、节点新增
1.
总结
这个是参考文章,有兴趣可以去看原文。
添加链接描述
好博客就要一起分享哦!分享海报
此处可发布评论
评论(0)展开评论
暂无评论,快来写一下吧
展开评论
您可能感兴趣的博客
