当前位置: 首页 > news >正文

Oracle 11g rac 集群节点的修复过程

Oracle 11g rac 集群节点的修复过程

目录

  • Oracle 11g rac 集群节点的修复过程
    • 一、问题的产生
    • 二、修复过程
        • 1、执行 roothas.pl 命令
        • 2、执行 root.sh 命令
        • 3、查看集群信息
        • 4、查看节点2的IP地址
        • 5、查看节点2的监听信息

一、问题的产生

用户的双节点 Oracle 11g rac 集群,发现有一个节点宕机,发现集群没有启动。手工启动集群报如下错误:

[root@his02 bin]# ./crsctl start cluster
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Start failed, or completed with errors.[root@his02 bin]# ./crsctl check css
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Check failed, or completed with errors.

二、修复过程

1、执行 roothas.pl 命令
[root@his02 bin]# cd /u01/app/11.2.0/grid/crs/install
[root@his02 install]# ./roothas.pl -deconfig -force -verbose
Can't locate Env.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . .) at crsconfig_lib.pm line 703.
BEGIN failed--compilation aborted at crsconfig_lib.pm line 703.
Compilation failed in require at ./roothas.pl line 166.
BEGIN failed--compilation aborted at ./roothas.pl line 166.

执行以上命令时出现错误,重新执行以下格式的命令:

[root@his02 install]# /u01/app/11.2.0/grid/perl/bin/perl /u01/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -force
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
PRCR-1119 : 无法查找 ora.cluster_vip_net1.type 类型的 CRS 资源
PRCR-1068 : 无法查询资源
Cannot communicate with crsd
PRCR-1070 : 无法检查 资源 ora.gsd 是否已注册
Cannot communicate with crsd
PRCR-1070 : 无法检查 资源 ora.ons 是否已注册
Cannot communicate with crsdCRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.Successfully deconfigured Oracle clusterware stack on this node
2、执行 root.sh 命令
[root@his02 grid]# ./root.sh
Check /u01/app/11.2.0/grid/install/root_his02_2024-11-13_19-10-14.log for the output of root script

执行过程中查看日志,发现如下错误:

[root@his02 ~]# tail -f /u01/app/11.2.0/grid/install/root_his02_2024-11-13_19-10-14.log
Performing root user operation for Oracle 11g The following environment variables are set as:ORACLE_OWNER= gridORACLE_HOME=  /u01/app/11.2.0/gridCopying dbhome to /usr/local/bin ...Copying oraenv to /usr/local/bin ...Copying coraenv to /usr/local/bin ...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.
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow: 
[client(50691)]CRS-2101:The OLR was formatted using version 3.

该错误解决方法如下:

(1)新开一个窗口,执行如下命令:

[root@his02 install]# cd /var/tmp/.oracle/
[root@his02 .oracle]# ls
npohasd
[root@his02 .oracle]# dd if=npohasd of=/dev/null bs=1024 count=1

过一段时间,重新查看日志,发现 root.sh 命令已执行完毕,节点添加成功。

[root@his02 ~]# tail -f /u01/app/11.2.0/grid/install/root_his02_2024-11-13_19-10-14.log
Performing root user operation for Oracle 11g The following environment variables are set as:ORACLE_OWNER= gridORACLE_HOME=  /u01/app/11.2.0/gridCopying dbhome to /usr/local/bin ...Copying oraenv to /usr/local/bin ...Copying coraenv to /usr/local/bin ...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.
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow: 
[client(50691)]CRS-2101:The OLR was formatted using version 3.
2023-10-28 00:55:42.163: 
[ohasd(51763)]CRS-0715:Oracle High Availability Service has timed out waiting for init.ohasd to be started.
2024-11-13 18:04:35.572: 
[ohasd(119653)]CRS-0715:Oracle High Availability Service has timed out waiting for init.ohasd to be started.
2024-11-13 18:27:11.266: 
[ohasd(34911)]CRS-2112:The OLR service started on node his02.
2024-11-13 18:27:11.274: 
[ohasd(34911)]CRS-1301:Oracle High Availability Service started on node his02.
2024-11-13 18:55:39.514: 
[ohasd(44682)]CRS-2112:The OLR service started on node his02.
2024-11-13 18:55:39.523: 
[ohasd(44682)]CRS-1301:Oracle High Availability Service started on node his02.
2024-11-13 18:55:39.574: 
[ohasd(43387)]CRS-0704:Oracle High Availability Service aborted due to Oracle Local Registry error [PROCL-24: Error in the messaging layer Messaging error [gipcretAddressInUse] [20]]. Details at (:OHAS00106:) in /u01/app/11.2.0/grid/log/his02/ohasd/ohasd.log.
[client(49054)]CRS-10001:13-Nov-24 19:07 ACFS-9459: ADVM/ACFS is not supported on this OS version: 'centos-release-7-3.1611.el7.centos.x86_64
'
[client(49056)]CRS-10001:13-Nov-24 19:07 ACFS-9201: Not Supported
2024-11-13 19:12:09.387: 
[client(53693)]CRS-2101:The OLR was formatted using version 3.CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node his01, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
PRKO-2190 : 节点 his02 存在 VIP, VIP 名称 his02-vip
软件包准备中...
cvuqdisk-1.0.9-1.x86_64
Configure Oracle Grid Infrastructure for a Cluster ... succeeded

(2)重启服务器,然后执行如下命令:

[root@his02 ~]# cd /var/tmp/.oracle/
[root@his02 .oracle]# ll npohasd
prw-r--r-- 1 root root 0 821 14:46 npohasd
[root@his02 .oracle]# rm -rf  npohasd
[root@his02 .oracle]# touch  npohasd
[root@his02 .oracle]# chmod 755  npohasd
[root@his02 .oracle]# ll npohasd
-rwxr-xr-x 1 root root 0 821 15:02 npohasd
3、查看集群信息
[root@his02 .oracle]# su - grid
上一次登录:三 1113 19:05:15 CST 2024pts/1 上
[grid@his02 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.BAK.dg     ora....up.type ONLINE    ONLINE    his01       
ora.DATA.dg    ora....up.type ONLINE    ONLINE    his01       
ora....ER.lsnr ora....er.type ONLINE    ONLINE    his01       
ora....N1.lsnr ora....er.type ONLINE    ONLINE    his01       
ora.OCR.dg     ora....up.type ONLINE    ONLINE    his01       
ora.asm        ora.asm.type   ONLINE    ONLINE    his01       
ora.cvu        ora.cvu.type   ONLINE    ONLINE    his01       
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
ora....SM1.asm application    ONLINE    ONLINE    his01       
ora....01.lsnr application    ONLINE    ONLINE    his01       
ora.his01.gsd  application    OFFLINE   OFFLINE               
ora.his01.ons  application    ONLINE    ONLINE    his01       
ora.his01.vip  ora....t1.type ONLINE    ONLINE    his01       
ora....SM2.asm application    ONLINE    ONLINE    his02       
ora....02.lsnr application    ONLINE    ONLINE    his02       
ora.his02.gsd  application    OFFLINE   OFFLINE               
ora.his02.ons  application    ONLINE    ONLINE    his02       
ora.his02.vip  ora....t1.type ONLINE    ONLINE    his02       
ora.hisdb.db   ora....se.type ONLINE    ONLINE    his01       
ora....network ora....rk.type ONLINE    ONLINE    his01       
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    his01       
ora.ons        ora.ons.type   ONLINE    ONLINE    his01       
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    his01
4、查看节点2的IP地址
[grid@his02 ~]$ ifconfig
bond1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.0.2  netmask 255.255.255.0  broadcast 192.168.0.255inet6 fe80::72fd:45ff:fe6b:cfb7  prefixlen 64  scopeid 0x20<link>ether 70:fd:45:6b:cf:b7  txqueuelen 1000  (Ethernet)RX packets 51878  bytes 24906169 (23.7 MiB)RX errors 0  dropped 482  overruns 0  frame 2TX packets 68845  bytes 58927700 (56.1 MiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0bond1:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.0.102  netmask 255.255.255.0  broadcast 192.168.0.255ether 70:fd:45:6b:cf:b7  txqueuelen 1000  (Ethernet)bond2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 10.5.5.2  netmask 255.255.255.0  broadcast 10.5.5.255inet6 fe80::72fd:45ff:fe6b:cfb8  prefixlen 64  scopeid 0x20<link>ether 70:fd:45:6b:cf:b8  txqueuelen 1000  (Ethernet)RX packets 202892  bytes 172526350 (164.5 MiB)RX errors 0  dropped 85  overruns 0  frame 0TX packets 133743  bytes 65314520 (62.2 MiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0bond2:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 169.254.6.27  netmask 255.255.0.0  broadcast 169.254.255.255ether 70:fd:45:6b:cf:b8  txqueuelen 1000  (Ethernet)lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536inet 127.0.0.1  netmask 255.0.0.0inet6 ::1  prefixlen 128  scopeid 0x10<host>loop  txqueuelen 1  (Local Loopback)RX packets 27683  bytes 10369158 (9.8 MiB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 27683  bytes 10369158 (9.8 MiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
5、查看节点2的监听信息
[grid@his02 ~]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 13-NOV-2024 19:20:05Copyright (c) 1991, 2013, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                13-NOV-2024 19:14:42
Uptime                    0 days 0 hr. 5 min. 22 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/11.2.0/grid/network/log/listener.log
Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.2)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.102)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "HISDB" has 1 instance(s).Instance "hisdb2", status READY, has 1 handler(s) for this service...
Service "HISDBXDB" has 1 instance(s).Instance "hisdb2", status READY, has 1 handler(s) for this service...
The command completed successfully

至此,节点2已完全恢复正常!

相关文章:

Oracle 11g rac 集群节点的修复过程

Oracle 11g rac 集群节点的修复过程 目录 Oracle 11g rac 集群节点的修复过程一、问题的产生二、修复过程1、执行 roothas.pl 命令2、执行 root.sh 命令3、查看集群信息4、查看节点2的IP地址5、查看节点2的监听信息 一、问题的产生 用户的双节点 Oracle 11g rac 集群&#xff…...

c++:string(一)

文章目录 一string类1C语言中的字符串2C中的string二遍历1[ ]2迭代器3const迭代器4范围for5auto6总结三String的尾插1size和length2max_size,capacity和clear3访问接口4尾插字符和字符串5 append的重载三string的扩容问题&#xff08;1&#xff09;怎么扩容&#xff08;2&#…...

github和Visual Studio

1、代码下载和提交 GitHubDesktopSetup-x64.exe 使用很简单&#xff0c;自己稍微琢磨下就明白了。 2、Visual Studio 2022 2.1 安装组件及学习内容 Visual Studio 中的 CMake 项目 | Microsoft Learn 2.2 打开 CMakeLists.txt 文件 定位并选择 CMakeLists.txt 文件 …...

django框架-settings.py文件的配置说明

以下是一些Django的核心配置和其默认值. 下面列出了contrib应用提供的配置, 后面是核心配置的专题索引. 关于介绍性资料, 详见 settings指南. ABSOLUTE_URL_OVERRIDES 默认值: {} (空字典) 它是一个将 “app_label.model_name” 字符串映射到接受模型对象并返回其URL的函数的…...

【C语言】缺陷管理流程

请解释一下缺陷管理流程&#xff0c;包括缺陷的发现、跟踪、验证和关闭等环节。 缺陷管理流程是一种软件质量保证过程&#xff0c;其目的是识别、记录、分析、解决并最终消除程序中的错误或问题。以下是这个流程的主要步骤&#xff1a; 缺陷发现 (Bug Discovery): 这通常是通过…...

基于深度学习的猫狗识别

基于深度学习的猫狗识别是计算机视觉领域中的一个经典问题&#xff0c;它主要利用深度学习技术来训练和构建模型&#xff0c;以便能够自动区分和识别图像中的猫和狗。以下是一个基于深度学习的猫狗识别的简要介绍&#xff1a; 一、数据集准备 要实现猫狗识别&#xff0c;首先需…...

java组件安全

Solr 默认端口&#xff1a;8983 命令执行&#xff08;cve-2019-17558&#xff09; 影响版本&#xff1a;5.0.0-8.3.1 https://github.com/jas502n/solr_rce 远程命令执行&#xff08;cve-2019-0193&#xff09; 影响版本&#xff1a;<8.2.0 条件&#xff1a;DataImport…...

【MongoDB】MongoDB的核心-索引原理及索引优化、及查询聚合优化实战案例(超详细)

文章目录 一、数据库查询效率问题引出索引需求二、索引的基本原理及作用&#xff08;一&#xff09;索引的创建及数据组织&#xff08;二&#xff09;不同类型的索引&#xff08;三&#xff09;索引的额外属性 三、索引的优化与查询计划分析&#xff08;一&#xff09;通过prof…...

qt QProcess详解

1、概述 QProcess是Qt框架提供的一个类&#xff0c;它用于在应用程序中执行外部进程。QProcess提供了一系列函数来启动、控制和与外部进程进行交互&#xff0c;使得开发者能够在自己的应用程序中集成和调用其他程序或服务。这个类在需要执行系统命令、启动其他应用程序或进行文…...

软件测试面试2024最新热点问题

大厂面试热点问题 1、测试人员需要何时参加需求分析&#xff1f; 如果条件循序 原则上来说 是越早介入需求分析越好 因为测试人员对需求理解越深刻 对测试工作的开展越有利 可以尽早的确定测试思路 减少与开发人员的交互 减少对需求理解上的偏差 2、软件测试与调试的关系 测…...

10款录屏工具推荐,聊聊我的使用心得!!!!

录屏软件已经成为我们的得力助手。不管是学习还是培训&#xff0c;或者工作会议等都时常需要录屏操作。经过深入实践和对比&#xff0c;我尝试了多款录屏软件。现在&#xff0c;我就来聊聊我个人使用过的几款录屏软件&#xff1a;我会尽量用最通俗的语言&#xff0c;分享我对这…...

VMware+Ubuntu+finalshell连接

安装教程&#xff1a;博客链接 下载地址&#xff1a;VMwareubuntu finalshell官网下载&#xff1a;finalshelll...

autodl+modelscope推理stable-diffusion-3.5-large

本篇介绍如何在服务器上实现SD3.5模型的加载及推理&#xff0c;不包含训练及微调。 磁盘扩容 autodl服务器在关机状态下&#xff0c;进行扩容&#xff1a; 选择要扩容的大小&#xff08;比如我这里已经扩了80G&#xff0c;默认有50G免费的&#xff09;&#xff0c;就会有一…...

深度学习之 LSTM

1.1 LSTM的产生原因 ​ RNN在处理长期依赖&#xff08;时间序列上距离较远的节点&#xff09;时会遇到巨大的困难&#xff0c;因为计算距离较远的节点之间的联系时会涉及雅可比矩阵的多次相乘&#xff0c;会造成梯度消失或者梯度膨胀的现象。为了解决该问题&#xff0c;研究人…...

LeetCode 3242.设计相邻元素求和服务:哈希表

【LetMeFly】3242.设计相邻元素求和服务&#xff1a;哈希表 力扣题目链接&#xff1a;https://leetcode.cn/problems/design-neighbor-sum-service/ 给你一个 n x n 的二维数组 grid&#xff0c;它包含范围 [0, n2 - 1] 内的不重复元素。 实现 neighborSum 类&#xff1a; …...

【AliCloud】ack + ack-secret-manager + kms 敏感数据安全存储

介绍 ack-secret-manager支持以Kubernetes Secret实例的形式向集群导入或同步KMS凭据信息&#xff0c;确保您集群内的应用能够安全地访问敏感信息。通过该组件&#xff0c;您可以实现密钥数据的自动更新&#xff0c;使应用负载通过文件系统挂载指定Secret实例来使用凭据信息&a…...

探索JavaScript的强大功能:从基础到高级应用

随着互联网技术的不断发展&#xff0c;JavaScript已经成为现代Web开发的基石。无论是简单的交互效果&#xff0c;还是复杂的前端框架&#xff0c;JavaScript都在其中扮演着不可或缺的角色。本文旨在对JavaScript进行深入探讨&#xff0c;从其基础概念到高级应用&#xff0c;并讨…...

新增支持Elasticsearch数据源,支持自定义在线地图风格,DataEase开源BI工具v2.10.2 LTS发布

2024年11月11日&#xff0c;人人可用的开源BI工具DataEase正式发布v2.10.2 LTS版本。 这一版本的功能变动包括&#xff1a;数据源方面&#xff0c;新增了对Elasticsearch数据源的支持&#xff1b;图表方面&#xff0c;对地图类和表格类图表进行了功能增强和优化&#xff0c;增…...

Spark的容错机制

1&#xff0c;Spark如何保障数据的安全 1、RDD容错机制&#xff1a;persist持久化机制 1&#xff09;cache算子 - 功能&#xff1a;将RDD缓存在内存中 - 语法&#xff1a;cache() - 本质&#xff1a;底层调用的还是persist&#xff08;StorageLevel.MEMORY_ONLY&#xff09;&…...

YOLOv8改进 | 利用YOLOv8进行视频划定区域目标统计计数

简介 本项目旨在利用YOLOv8算法来实现视频中划定区域目标的统计计数。YOLOv8是一种目标检测算法,能够实现实时目标检测和定位。视频划定区域目标统计计数是指在一个视频中,对于指定的区域,统计出该区域内出现的目标物体数量。 该项目的工作流程如下:首先,利用YOLOv8算法…...

label-studio的使用教程(导入本地路径)

文章目录 1. 准备环境2. 脚本启动2.1 Windows2.2 Linux 3. 安装label-studio机器学习后端3.1 pip安装(推荐)3.2 GitHub仓库安装 4. 后端配置4.1 yolo环境4.2 引入后端模型4.3 修改脚本4.4 启动后端 5. 标注工程5.1 创建工程5.2 配置图片路径5.3 配置工程类型标签5.4 配置模型5.…...

SCAU期末笔记 - 数据分析与数据挖掘题库解析

这门怎么题库答案不全啊日 来简单学一下子来 一、选择题&#xff08;可多选&#xff09; 将原始数据进行集成、变换、维度规约、数值规约是在以下哪个步骤的任务?(C) A. 频繁模式挖掘 B.分类和预测 C.数据预处理 D.数据流挖掘 A. 频繁模式挖掘&#xff1a;专注于发现数据中…...

【SQL学习笔记1】增删改查+多表连接全解析(内附SQL免费在线练习工具)

可以使用Sqliteviz这个网站免费编写sql语句&#xff0c;它能够让用户直接在浏览器内练习SQL的语法&#xff0c;不需要安装任何软件。 链接如下&#xff1a; sqliteviz 注意&#xff1a; 在转写SQL语法时&#xff0c;关键字之间有一个特定的顺序&#xff0c;这个顺序会影响到…...

【JavaWeb】Docker项目部署

引言 之前学习了Linux操作系统的常见命令&#xff0c;在Linux上安装软件&#xff0c;以及如何在Linux上部署一个单体项目&#xff0c;大多数同学都会有相同的感受&#xff0c;那就是麻烦。 核心体现在三点&#xff1a; 命令太多了&#xff0c;记不住 软件安装包名字复杂&…...

Typeerror: cannot read properties of undefined (reading ‘XXX‘)

最近需要在离线机器上运行软件&#xff0c;所以得把软件用docker打包起来&#xff0c;大部分功能都没问题&#xff0c;出了一个奇怪的事情。同样的代码&#xff0c;在本机上用vscode可以运行起来&#xff0c;但是打包之后在docker里出现了问题。使用的是dialog组件&#xff0c;…...

Redis的发布订阅模式与专业的 MQ(如 Kafka, RabbitMQ)相比,优缺点是什么?适用于哪些场景?

Redis 的发布订阅&#xff08;Pub/Sub&#xff09;模式与专业的 MQ&#xff08;Message Queue&#xff09;如 Kafka、RabbitMQ 进行比较&#xff0c;核心的权衡点在于&#xff1a;简单与速度 vs. 可靠与功能。 下面我们详细展开对比。 Redis Pub/Sub 的核心特点 它是一个发后…...

【7色560页】职场可视化逻辑图高级数据分析PPT模版

7种色调职场工作汇报PPT&#xff0c;橙蓝、黑红、红蓝、蓝橙灰、浅蓝、浅绿、深蓝七种色调模版 【7色560页】职场可视化逻辑图高级数据分析PPT模版&#xff1a;职场可视化逻辑图分析PPT模版https://pan.quark.cn/s/78aeabbd92d1...

c++第七天 继承与派生2

这一篇文章主要内容是 派生类构造函数与析构函数 在派生类中重写基类成员 以及多继承 第一部分&#xff1a;派生类构造函数与析构函数 当创建一个派生类对象时&#xff0c;基类成员是如何初始化的&#xff1f; 1.当派生类对象创建的时候&#xff0c;基类成员的初始化顺序 …...

恶补电源:1.电桥

一、元器件的选择 搜索并选择电桥&#xff0c;再multisim中选择FWB&#xff0c;就有各种型号的电桥: 电桥是用来干嘛的呢&#xff1f; 它是一个由四个二极管搭成的“桥梁”形状的电路&#xff0c;用来把交流电&#xff08;AC&#xff09;变成直流电&#xff08;DC&#xff09;。…...

实战设计模式之模板方法模式

概述 模板方法模式定义了一个操作中的算法骨架&#xff0c;并将某些步骤延迟到子类中实现。模板方法使得子类可以在不改变算法结构的前提下&#xff0c;重新定义算法中的某些步骤。简单来说&#xff0c;就是在一个方法中定义了要执行的步骤顺序或算法框架&#xff0c;但允许子类…...