博客
关于我
19cRAC增删节点
阅读量:443 次
发布时间:2019-03-06

本文共 11917 字,大约阅读时间需要 39 分钟。

由于测试环境打19c补丁失败,导致节点2  d2 crs无法启动!打补丁没有有效备份,亲人两行泪

先删再加节点。

一、删除节点

1.1 删除实例

参考https://www.cnblogs.com/binliubiao/p/11996092.htmlDeleting a Cluster Node on Linux and UNIX Systemshttps://docs.oracle.com/en/database/oracle/oracle-database/19/cwadd/ adding-and-deleting-cluster-nodes.html#GUID-8ADA9667-EC27-4EF9-9F34-C8F65A757F2A删除可以参考上述博客,添加节点建议参考MOS文档Oracle E-Business Suite Release 12.2: Adding or Deleting 11gR2 or 12c1 Oracle RAC Nodes (Doc ID 1570554.1)	Oracle Database 19c Enterprise Edition Release 19.0.0.0.0测试环境RAC2节点,打补丁2节点安装失败,因此对节点2进行删除后,再添加。删除实例,1.1都在正常的节点1执行操作【由于节点2集群crs无法启动,因此删除操作在节点1执行]srvctl stop instance -db db_unique_name -node node_namesrvctl relocate server -servers "server_name_list" -serverpool Freesrvctl config database -db db_unique_nameoracle$srvctl config database -db orcldbca -silent -deleteInstance -nodeList d2 -gdbName orcl -instanceName orcl2 -sysDBAUserName sysdba -sysDBAPassword oracle--删除实例需要本地实例已启动![FATAL] [DBT-11502] The instance (orcl1) is not running on the local node.   CAUSE: A locally running instance is required to perform the selected operation.   ACTION: Specify a locally running database, or execute DBCA on a node where the database instance is running.$ srvctl start instance -d orcl -instance orcl1$ dbca -silent -deleteInstance -nodeList d2 -gdbName orcl -instanceName orcl2Prepare for db operation40% completeDeleting instance48% complete52% complete56% complete60% complete64% complete68% complete72% complete76% complete80% completeCompleting instance management.100% complete$ srvctl stop database -d orcl本次测试环境3套DB均为启动存活的节点1实例,进行删除实例操作。SQL> alter system set enable_ddl_logging=true;$ dbca -silent -deleteInstance -nodeList d2 -gdbName abc -instanceName abc2--观察DB Alert日志,并没有ddl操作,而是上次了实例2的redo and undo,并且RAC相关参数设置了一下!2020-04-15T06:57:54.304305+08:00Deleted Oracle managed file +DATA/ABC/ONLINELOG/group_3.309.1036713505Deleted Oracle managed file +DATA/ABC/ONLINELOG/group_4.310.1036713537Deleted Oracle managed file +DATA/ABC/DATAFILE/undotbs2.308.10367129112020-04-15T06:57:55.090943+08:00ALTER SYSTEM RESET undo_tablespace SCOPE=SPFILE SID='abc2';2020-04-15T06:57:55.098168+08:00ALTER SYSTEM RESET instance_number SCOPE=SPFILE SID='abc2';2020-04-15T06:57:55.107884+08:00ALTER SYSTEM RESET thread SCOPE=SPFILE SID='abc2';--$ srvctl stop database -d abc继续删除第三个实例$ srvctl start instance -d nocdd -instance nocdd1$ dbca -silent -deleteInstance -nodeList d2 -gdbName nocdd -instanceName nocdd2

1.2删除Oracle软件

检测交换分区,及产品软件清单目录 【节点2执行,删除的节点】oracle$$ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=/u03/app/oracle/product/19.0.0/db_1 "CLUSTER_NODES={d2}" -localStarting Oracle Universal Installer...Checking swap space: must be greater than 500 MB.   Actual 3072 MB    PassedThe inventory pointer is located at /etc/oraInst.loc[oracle@d2:/home/oracle]$ cat /etc/oraInst.locinventory_loc=/u01/app/oraInventoryinst_group=oinstalloracle$cd $ORACLE_HOME/deinstalloracle$./deinstall -local······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 []:  回车,默认读取当前oracle_home目录······The cluster node(s) on which the Oracle home deinstallation will be performed are:d2Oracle Home selected for deinstall is: /u03/app/oracle/product/19.0.0/db_1Inventory Location where the Oracle home registered is: /u01/app/oraInventoryDo you want to continue (y - yes, n - no)? [n]: y 继续,yes······Successfully detached Oracle home '/u03/app/oracle/product/19.0.0/db_1' from the central inventory on the local node.Successfully deleted directory '/u03/app/oracle/product/19.0.0/db_1' on the local node.Successfully deleted directory '/u03/app/oracle' on the local node.Oracle Universal Installer cleanup was successful.Oracle deinstall tool successfully cleaned up temporary directories.更新inventory# 在保留任一节点执行命令su - oraclecd $ORACLE_HOME/oui/bin./runInstaller -updateNodeList ORACLE_HOME=/u03/app/oracle/product/19.0.0/db_1 "CLUSTER_NODES={d1}"

 

1.3删除Grid软件

 

检查集群节点是否被锁定,只需要在删除的节点操作即可,是检测是否被锁定[grid@d1:/home/grid]$ olsnodes -s -td1      Active  Unpinned[grid@d2:/home/grid]$ olsnodes -s -tPRCO-19: Failure retrieving list of nodes in the clusterPRCO-2: Unable to communicate with the clusterware# 如果节点被锁定,运行crsctl unpin css命令后继续下一步crsctl unpin css -n delete_node在不删除二进制文件的情况下取消配置Oracle Clusterwarehttps://docs.oracle.com/en/database/oracle/oracle-database/19/cwlin/unconfiguring-oracle-clusterware-without-removing-binaries.html# GUID-41C5E8EE-68F9-4849-B4B8-BD82D4A17A57在删除的节点上,以root用户执行su - rootcd /u01/app/19.0.0/grid/crs/install# /u01/app/19.0.0/grid/perl/bin/perl ./rootcrs.pl -deconfig -force直接执行./rootcrs.pl提示./rootcrs.pl: line 88: =head1: command not found,perl无法执行脚本。2020/04/15 17:03:56 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node#若删除整个集群,在最后一个节点执行#./rootcrs.pl -deconfig -force -lastnode
在删除的节点上执行删除软件命令操作d2,只删除本地节点2su - gridcd $ORACLE_HOME/deinstall./deinstall -localASM configuration was not detected in this Oracle home. Was ASM configured in this Oracle home (y|n) [n]: y 【asm 与grid安装在一起共享一个oracle_home]ASM Diagnostic Destination : /u01/app/gridASM Diskgroups : ASM diskstring : /dev/*_1*Diskgroups will not be dropped If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify by entering 'y'. Do you want to modify above information (y|n) [n]: n 【不修改上述对磁盘组的操作,不删除磁盘组]Oracle Grid Infrastructure Home is: Oracle Home selected for deinstall is: /u01/app/19.0.0/gridInventory Location where the Oracle home registered is: /u01/app/oraInventoryFollowing Oracle Restart enabled listener(s) will be de-configured: ASMNET1LSNR_ASM,LISTENER,LISTENER_SCAN1ASM instance will be de-configured from this Oracle homeDo you want to continue (y - yes, n - no)? [n]: y [确认清理上述资源】####################### DEINSTALL CLEAN OPERATION SUMMARY #######################Successfully detached Oracle home '/u01/app/19.0.0/grid' from the central inventory on the local node.Failed to delete directory '/u01/app/19.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.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) 'd2' at the end of the session.Run 'rm -r /opt/ORCLfmap' as root on node(s) 'd2' at the end of the session.Run 'rm -r /etc/oratab' as root on node(s) 'd2' at the end of the session.Review the permissions and contents of '/u01/app/grid' on nodes(s) 'd2'.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.root# 删除上述目录! 四个目录均递归删除!删除CRS配置【存活的节点执行,已删除的crs都没了】su - rootcd /u01/app/19.0.0/grid/bin./crsctl delete node -n d2[grid@d1:/u01/app/19.0.0/grid/crs/install]$ cluvfy stage -post nodedel -n 2 -verboseVerifying Node Removal ... Verifying CRS Integrity ...PASSED Verifying Clusterware Version Consistency ...PASSEDVerifying Node Removal ...PASSEDPost-check for node removal was successful. CVU operation performed: stage -post nodedelDate: Apr 15, 2020 2:28:00 AMCVU home: /u01/app/19.0.0/grid/User: grid发现存在一个vip 未被删除FAILED OVER,STABLE# /u01/app/19.0.0/grid/bin/srvctl remove vip -vip d2 -force

 

二、添加节点

 

2.1添加Grid集群节点

前期准备工作,需要与安装RAC工作一样,本次环境都是好的【新增节点不需要再需要安装介质】 $ mkdir -p /u01/app/19.0.0/grid$ ssh d1 date;ssh d2 date; ssh d1-priv date;ssh d2-priv date;运行CVU程序su - grid cd ${ORACLE_HOME}/bincluvfy comp peer [-refnode 
] -n node_list [-orainv orainventory_group] [-osdba osdba_group] [-verbose]CVU用作检查与其他节点的兼容性的参考的节点。如果未指定此选项,则CVU报告节点列表中所有节点的值。grid_node1$cluvfy comp peer -refnode d1 -n d2 -verbose 加节点(GI)grid_node1$/u01/app/19.0.0/grid/addnode/addnode.sh -silent -ignoreSysPrereqs -ignorePrereqFailure "CLUSTER_NEW_NODES={d2}" "CLUSTER_NEW_PRIVATE_NODE_NAMES={d2-priv}" "CLUSTER_NEW_VIRTUAL_HOSTNAMES={d2-vip}"As a root user, execute the following script(s): 1. /u01/app/oraInventory/orainstRoot.sh 2. /u01/app/19.0.0/grid/root.shExecute /u01/app/oraInventory/orainstRoot.sh on the following nodes: [d2]Execute /u01/app/19.0.0/grid/root.sh on the following nodes: [d2] ······ [root@d1 ~]# /u01/app/oraInventory/orainstRoot.shChanging 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.
验证
$ cluvfy stage -post nodeadd -n d2

 

2.2添加Oracle软件

 

加节点(DB)oracle_node1$/u03/app/oracle/product/19.0.0/db_1/addnode/addnode.sh -silent -ignoreSysPrereqs -ignorePrereqFailure "CLUSTER_NEW_NODES={d2}"As a root user, execute the following script(s):        1. /u03/app/oracle/product/19.0.0/db_1/root.shExecute /u03/app/oracle/product/19.0.0/db_1/root.sh on the following nodes: [d2]

 

2.2添加DB

-- Start the Instance on the New NodeThe prerequisite steps to take prior to adding an instance using DBCA are as follows:.Ensure that all the existing instances have been started using an spfile from the shared location. Verify that all the instances are listening on the default grid listener. The following command displays all the existing instances:$ $CRS_HOME/bin/lsnrctl statusRun $ORACLE_HOME/bin/dbca from any of the existing RAC instance Oracle homes.Select "Oracle Real Application Clusters" database and click Next.Select "Instance Management" and click Next.Select "Add an Instance" and click Next.Click Next to accept the default instance name (or change it, if necessary).Check the summary window. 测试环境3套DB,启动单个实例后,静默方式添加节点2实例$ srvctl start instance -d abc -instance abc1$dbca -ignorePreReqs -ignorePrereqFailure -silent -addInstance -nodeName d2 -gdbName abc -instanceName abc2 -sysDBAUserName sys  -sysDBAPassword oracle$ srvctl start database -d nocdd$dbca -ignorePreReqs -ignorePrereqFailure -silent -addInstance -nodeName d2 -gdbName nocdd -instanceName nocdd2 -sysDBAUserName sys  -sysDBAPassword oracle$ srvctl start database -d orcl$dbca -ignorePreReqs -ignorePrereqFailure -silent -addInstance -nodeName d2 -gdbName orcl -instanceName orcl2 -sysDBAUserName sys  -sysDBAPassword oracle DB_ALERT

2020-04-16T00:50:34.958060+08:00

CREATE SMALLFILE UNDO TABLESPACE "UNDOTBS2" DATAFILE SIZE 290M AUTOEXTEND ON NEXT 5120K MAXSIZE 32767M BLOCKSIZE 8192
2020-04-16T00:50:36.603592+08:00
Completed: CREATE SMALLFILE UNDO TABLESPACE "UNDOTBS2" DATAFILE SIZE 290M AUTOEXTEND ON NEXT 5120K MAXSIZE 32767M BLOCKSIZE 8192
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 3 SIZE 200M,
GROUP 4 SIZE 200M
2020-04-16T00:50:39.079100+08:00
Completed: ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 3 SIZE 200M,
GROUP 4 SIZE 200M
ALTER DATABASE ENABLE PUBLIC THREAD 2
Completed: ALTER DATABASE ENABLE PUBLIC THREAD 2
2020-04-16T00:50:39.185364+08:00
ALTER SYSTEM SET instance_number=2 SCOPE=SPFILE SID='nocdd2';
2020-04-16T00:50:39.213198+08:00
ALTER SYSTEM SET thread=2 SCOPE=SPFILE SID='nocdd2';
2020-04-16T00:50:39.243485+08:00
ALTER SYSTEM SET undo_tablespace='UNDOTBS2' SCOPE=SPFILE SID='nocdd2';
2020-04-16T00:51:29.154327+08:00

补丁信息发现,添加节点补丁自动打上了!!![grid@d1:/u01/app/19.0.0/grid/OPatch]$ ./opatch lsinventoryoracle  ······SQL>  select ACTION,NAMESPACE,VERSION,BUNDLE_SERIES,COMMENTS FROM dba_registry_history;

ACTION NAMESPACE VERSION BUND COMMENTS

---------- ---------- -------------------- ---- ----------------------------------------
BOOTSTRAP DATAPATCH 19 RDBMS_19.5.0.0.0DBRUR_LINUX.X64_191213
RU_APPLY SERVER 19.0.0.0.0 Patch applied on 19.3.0.0.0: Release_Update - 190410122720

 

你可能感兴趣的文章
NIFI1.23.2_最新版_性能优化通用_技巧积累_使用NIFI表达式过滤表_随时更新---大数据之Nifi工作笔记0063
查看>>
NIFI从MySql中增量同步数据_通过Mysql的binlog功能_实时同步mysql数据_根据binlog实现数据实时delete同步_实际操作04---大数据之Nifi工作笔记0043
查看>>
NIFI从MySql中增量同步数据_通过Mysql的binlog功能_实时同步mysql数据_配置binlog_使用处理器抓取binlog数据_实际操作01---大数据之Nifi工作笔记0040
查看>>
NIFI从MySql中增量同步数据_通过Mysql的binlog功能_实时同步mysql数据_配置数据路由_实现数据插入数据到目标数据库_实际操作03---大数据之Nifi工作笔记0042
查看>>
NIFI从MySql中增量同步数据_通过Mysql的binlog功能_实时同步mysql数据_配置数据路由_生成插入Sql语句_实际操作02---大数据之Nifi工作笔记0041
查看>>
NIFI从MySql中离线读取数据再导入到MySql中_03_来吧用NIFI实现_数据分页获取功能---大数据之Nifi工作笔记0038
查看>>
NIFI从MySql中离线读取数据再导入到MySql中_不带分页处理_01_QueryDatabaseTable获取数据_原0036---大数据之Nifi工作笔记0064
查看>>
NIFI从MySql中离线读取数据再导入到MySql中_无分页功能_02_转换数据_分割数据_提取JSON数据_替换拼接SQL_添加分页---大数据之Nifi工作笔记0037
查看>>
NIFI从PostGresql中离线读取数据再导入到MySql中_带有数据分页获取功能_不带分页不能用_NIFI资料太少了---大数据之Nifi工作笔记0039
查看>>
nifi使用过程-常见问题-以及入门总结---大数据之Nifi工作笔记0012
查看>>
NIFI分页获取Mysql数据_导入到Hbase中_并可通过phoenix客户端查询_含金量很高的一篇_搞了好久_实际操作05---大数据之Nifi工作笔记0045
查看>>
NIFI分页获取Postgresql数据到Hbase中_实际操作---大数据之Nifi工作笔记0049
查看>>
NIFI同步MySql数据_到SqlServer_错误_驱动程序无法通过使用安全套接字层(SSL)加密与SQL Server_Navicat连接SqlServer---大数据之Nifi工作笔记0047
查看>>
Nifi同步过程中报错create_time字段找不到_实际目标表和源表中没有这个字段---大数据之Nifi工作笔记0066
查看>>
NIFI大数据进阶_FlowFile拓扑_对FlowFile内容和属性的修改删除添加_介绍和描述_以及实际操作---大数据之Nifi工作笔记0023
查看>>
NIFI大数据进阶_FlowFile生成器_GenerateFlowFile处理器_ReplaceText处理器_处理器介绍_处理过程说明---大数据之Nifi工作笔记0019
查看>>
NIFI大数据进阶_Json内容转换为Hive支持的文本格式_操作方法说明_01_EvaluteJsonPath处理器---大数据之Nifi工作笔记0031
查看>>
NIFI大数据进阶_Kafka使用相关说明_实际操作Kafka消费者处理器_来消费kafka数据---大数据之Nifi工作笔记0037
查看>>
NIFI大数据进阶_Kafka使用相关说明_实际操作Kafka生产者---大数据之Nifi工作笔记0036
查看>>
NIFI大数据进阶_NIFI的模板和组的使用-介绍和实际操作_创建组_嵌套组_模板创建下载_导入---大数据之Nifi工作笔记0022
查看>>