阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Oracle彻底删除11gR2 GI

414次阅读
没有评论

共计 8601 个字符,预计需要花费 22 分钟才能阅读完成。

Oracle 彻底删除 11gR2 GI

环境:RHEL 6.5 + Oracle 11.2.0.4 GI
需求:在搭建 Standby RAC 时,安装 GI 软件期间由于 GI 安装遇到一些问题,root 脚本执行 hang 住,且无任何报错(跟踪 /opt/app/11.2.0/grid/cfgtoollogs/crsconfig/rootcrs_jystdrac1.log 也无任何报错,几小时都不再刷新),因为 11.2 后的 root 脚本是可以重复执行的,所以反复尝试执行 root 脚本, 但结果均未成功。
由于这个虚拟的系统环境是直接从很久前自己做的实验直接复制过来的,只能是怀疑环境本身有问题,现在想完全重新安装 GI,在这之前需要 Oracle 彻底删除 11g GI,这个操作可以参考 MOS 文档:
How to completely remove 11.2 and 12.1 Grid Infrastructure, CRS and/or Oracle Restart – IBM: Linux on System z (文档 ID 1413787.1)
注:我这里的实验环境由于是 GI 并未完全成功安装成功,所以有些命令的输出可能并不是标准输出。

主要步骤如下:

  • 1. 删除 CRS 配置
  • 2. 删除 Oracle Restart
  • 3. 修改 /etc/inittab
  • 4. 清除文件
  • 5. 重新安装前的准备

1. 删除 CRS 配置

删除 CRS 配置
使用 root 用户,执行
/opt/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -force -verbose

[root@jystdrac1 install]# /opt/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -force -verbose
Using configuration parameter file: /opt/app/11.2.0/grid/crs/install/crsconfig_params
PRCR-1119 : Failed to look up CRS resources of ora.cluster_vip_net1.type type
PRCR-1068 : Failed to query resources
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.gsd is registered
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.ons is registered
Cannot communicate with crsd
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'jystdrac1'
CRS-2673: Attempting to stop 'ora.crf' on 'jystdrac1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'jystdrac1'
CRS-2677: Stop of 'ora.mdnsd' on 'jystdrac1' succeeded
CRS-2677: Stop of 'ora.crf' on 'jystdrac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'jystdrac1'
CRS-2677: Stop of 'ora.gipcd' on 'jystdrac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'jystdrac1'
CRS-2677: Stop of 'ora.gpnpd' on 'jystdrac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'jystdrac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Removing Trace File Analyzer
error: package cvuqdisk is not installed
Successfully deconfigured Oracle clusterware stack on this node

在 GI 的最后一个节点,你需要在 rootcrs.pl 命令后添加–lastnode 参数
/opt/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -lastnode -verbose -force

[root@jystdrac2 ~]# /opt/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -lastnode -verbose -force
Using configuration parameter file: /opt/app/11.2.0/grid/crs/install/crsconfig_params
Adding Clusterware entries to upstart
crsexcl failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow: 

****Unable to retrieve Oracle Clusterware home.
Start Oracle Clusterware stack and try again.
****Unable to retrieve Oracle Clusterware home.
Start Oracle Clusterware stack and try again.
****Unable to retrieve Oracle Clusterware home.
Start Oracle Clusterware stack and try again.
****Unable to retrieve Oracle Clusterware home.
Start Oracle Clusterware stack and try again.
****Unable to retrieve Oracle Clusterware home.
Start Oracle Clusterware stack and try again.
Failure in execution (rc=-1, 0, No such file or directory) for command /opt/app/11.2.0/grid/bin/crsctl stop res ora.registry.acfs -n jystdrac2 -f
Failure in execution (rc=-1, 0, No such file or directory) for command /opt/app/11.2.0/grid/bin/crsctl delete res ora.registry.acfs -f
Either /etc/oracle/ocr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Either /etc/oracle/ocr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
sh: /opt/app/11.2.0/grid/bin/crsctl: No such file or directory
Failure in execution (rc=-1, 32512, No such file or directory) for command /opt/app/11.2.0/grid/bin/crsctl delete res ora.drivers.acfs -init -f
Either /etc/oracle/ocr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Either /etc/oracle/ocr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Failure in execution (rc=-1, 32512, No such file or directory) for command /opt/app/11.2.0/grid/bin/crsctl stop crs -f
Either /etc/oracle/ocr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Either /etc/oracle/ocr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
################################################################
# You must kill processes or reboot the system to properly #
# cleanup the processes started by Oracle clusterware          #
################################################################
Either /etc/oracle/ocr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Either /etc/oracle/ocr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Can't exec"/opt/app/11.2.0/grid/bin/clsecho": No such file or directory at /opt/app/11.2.0/grid/lib/acfslib.pm line 1464.
Either /etc/oracle/olr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Either /etc/oracle/olr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Failure in execution (rc=-1, 256, No such file or directory) for command /etc/init.d/ohasd deinstall
error: package cvuqdisk is not installed
Successfully deconfigured Oracle clusterware stack on this node

2. 删除 Oracle Restart

使用 root 用户,执行:
/opt/app/11.2.0/grid/crs/install/roothas.pl -deconfig -verbose -force

[root@jystdrac1 app]# /opt/app/11.2.0/grid/crs/install/roothas.pl -deconfig -verbose -force
Using configuration parameter file: /opt/app/11.2.0/grid/crs/install/crsconfig_params
CRS-4047: No Oracle Clusterware components configured.
CRS-4000: Command Stop failed, or completed with errors.
CRS-4047: No Oracle Clusterware components configured.
CRS-4000: Command Delete failed, or completed with errors.
CRS-4047: No Oracle Clusterware components configured.
CRS-4000: Command Stop failed, or completed with errors.
You must kill ohasd processes or reboot the system to properly 
cleanup the processes started by Oracle clusterware
ACFS-9313: No ADVM/ACFS installation detected.
Either /etc/oracle/olr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Failure in execution (rc=-1, 256, No such file or directory) for command /etc/init.d/ohasd deinstall
Successfully deconfigured Oracle Restart stack

第二个节点:

[root@jystdrac2 ~]# /opt/app/11.2.0/grid/crs/install/roothas.pl -deconfig -verbose -force
Using configuration parameter file: /opt/app/11.2.0/grid/crs/install/crsconfig_params
Failure in execution (rc=-1, 256, No such file or directory) for command /opt/app/11.2.0/grid/bin/crsctl stop resource ora.cssd -f
Failure in execution (rc=-1, 256, No such file or directory) for command /opt/app/11.2.0/grid/bin/crsctl delete resource ora.cssd -f
Failure in execution (rc=-1, 256, No such file or directory) for command /opt/app/11.2.0/grid/bin/crsctl stop has -f
You must kill ohasd processes or reboot the system to properly 
cleanup the processes started by Oracle clusterware
Can't exec"/opt/app/11.2.0/grid/bin/clsecho": No such file or directory at /opt/app/11.2.0/grid/lib/acfslib.pm line 1464.
Either /etc/oracle/olr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Failure in execution (rc=-1, 256, No such file or directory) for command /etc/init.d/ohasd deinstall
Successfully deconfigured Oracle Restart stack

3. 修改 /etc/inittab

修改 /etc/inittab,移除相关配置信息:

tail /etc/inittab
#h1:35:respawn:/etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null
init q

我这里的实验环境这个文件还没有这个内容,所以不需要做操作,继续往下。

4. 清除文件

按照 MOS 的描述,清除所有存在的相关文件:

If the Oracle Grid root.sh script has been run on any of the nodes previously, then the
Linux inittab file should be modified to remove the lines that were added.
Deconfig should remove this line but it is best to verify.

tail /etc/inittab
#h1:35:respawn:/etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null
init q

Clean up files

The following commands are used to remove all Oracle Grid and database
software. You can also use the Oracle de-installer to remove the necessary software
components.

#
#WARNING - You should verify this script before running this script as this
#script  will remove everything for all Oracle systems on the Linux system where
#the script  is run.
#
rm -f /etc/init.d/init.ohasd
#
rm -f /etc/inittab.crs
rm -rf /etc/oracle
#
# Oracle Bug Note:429214.1
#
rm -f /usr/tmp/.oracle/*
rm -f /tmp/.oracle/*
rm -f /var/tmp/.oracle/*
###

WARNING: BE VERY CAREFUL - THIS WILL REMOVE THE ORATAB ENTRIES FOR ALL DATABASES RUNNING ON THIS SERVER AND ALSO THE CENTRAL INVENTORY FOR ANY ORACLE HOMES/GRID HOMES WHICH ARE CURRENTLY INSTALLED ON THIS SERVER.

rm -f /etc/oratab
rm -rf /var/opt/oracle


#
# Remove Oracle software directories *these may change based on your install en
#  You need to modify the following to map to your install environment.

rm -rf  </u01/base/*> *********this is $ORACLE_BASE
rm -rf  </u01/oraInventory> ****this is the central inventory loc pointed to by oraInst.loc
rm -rf </u01/grid/*> **********this is the Grid Home
rm -rf </u01/oracle> **********this is the DB Home#

5. 重新安装前的准备

确认目录权限正确:

mkdir -p /opt/app/ && chown -R oracle:oinstall /opt/app/ && chmod 775 /opt/app && ls -lh /opt

安装 cvuqdisk 的 rpm 包

rpm -ivh /opt/app/media/grid/rpm/cvuqdisk-1.0.9-1.rpm

清除 ocr/voting 磁盘信息:
dd if=/dev/zero of=/dev/

dd if=/dev/zero of=/dev/asm-diskb bs=1M count=100
dd if=/dev/zero of=/dev/asm-diskc bs=1M count=100
dd if=/dev/zero of=/dev/asm-diskd bs=1M count=100

然后所有节点重启主机,准备在清空所有配置后的环境下进行一次全新的 GI 安装。

更多 Oracle 相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-08/146100.htm

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-22发表,共计8601字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中

星哥玩云

星哥玩云
星哥玩云
分享互联网知识
用户数
4
文章数
19348
评论数
4
阅读量
7805022
文章搜索
热门文章
开发者必备神器:阿里云 Qoder CLI 全面解析与上手指南

开发者必备神器:阿里云 Qoder CLI 全面解析与上手指南

开发者必备神器:阿里云 Qoder CLI 全面解析与上手指南 大家好,我是星哥。之前介绍了腾讯云的 Code...
星哥带你玩飞牛NAS-6:抖音视频同步工具,视频下载自动下载保存

星哥带你玩飞牛NAS-6:抖音视频同步工具,视频下载自动下载保存

星哥带你玩飞牛 NAS-6:抖音视频同步工具,视频下载自动下载保存 前言 各位玩 NAS 的朋友好,我是星哥!...
云服务器部署服务器面板1Panel:小白轻松构建Web服务与面板加固指南

云服务器部署服务器面板1Panel:小白轻松构建Web服务与面板加固指南

云服务器部署服务器面板 1Panel:小白轻松构建 Web 服务与面板加固指南 哈喽,我是星哥,经常有人问我不...
我把用了20年的360安全卫士卸载了

我把用了20年的360安全卫士卸载了

我把用了 20 年的 360 安全卫士卸载了 是的,正如标题你看到的。 原因 偷摸安装自家的软件 莫名其妙安装...
星哥带你玩飞牛NAS-3:安装飞牛NAS后的很有必要的操作

星哥带你玩飞牛NAS-3:安装飞牛NAS后的很有必要的操作

星哥带你玩飞牛 NAS-3:安装飞牛 NAS 后的很有必要的操作 前言 如果你已经有了飞牛 NAS 系统,之前...
阿里云CDN
阿里云CDN-提高用户访问的响应速度和成功率
随机文章
安装Black群晖DSM7.2系统安装教程(在Vmware虚拟机中、实体机均可)!

安装Black群晖DSM7.2系统安装教程(在Vmware虚拟机中、实体机均可)!

安装 Black 群晖 DSM7.2 系统安装教程(在 Vmware 虚拟机中、实体机均可)! 前言 大家好,...
每天一个好玩的网站-手机博物馆-CHAZ 3D Experience

每天一个好玩的网站-手机博物馆-CHAZ 3D Experience

每天一个好玩的网站 - 手机博物馆 -CHAZ 3D Experience 一句话介绍:一个用 3D 方式重温...
多服务器管理神器 Nexterm 横空出世!NAS/Win/Linux 通吃,SSH/VNC/RDP 一站式搞定

多服务器管理神器 Nexterm 横空出世!NAS/Win/Linux 通吃,SSH/VNC/RDP 一站式搞定

多服务器管理神器 Nexterm 横空出世!NAS/Win/Linux 通吃,SSH/VNC/RDP 一站式搞...
2025年11月28日-Cloudflare史诗级事故:一次配置失误,引爆全球宕机

2025年11月28日-Cloudflare史诗级事故:一次配置失误,引爆全球宕机

2025 年 11 月 28 日 -Cloudflare 史诗级事故: 一次配置失误,引爆全球宕机 前言 继今...
Python自学26 – Cookie和Session

Python自学26 – Cookie和Session

Python 自学 26 – Cookie 和 Session 在学习 Web 开发时,Cooki...

免费图片视频管理工具让灵感库告别混乱

一言一句话
-「
手气不错
让微信公众号成为 AI 智能体:从内容沉淀到智能问答的一次升级

让微信公众号成为 AI 智能体:从内容沉淀到智能问答的一次升级

让微信公众号成为 AI 智能体:从内容沉淀到智能问答的一次升级 大家好,我是星哥,之前写了一篇文章 自己手撸一...
自己手撸一个AI智能体—跟创业大佬对话

自己手撸一个AI智能体—跟创业大佬对话

自己手撸一个 AI 智能体 — 跟创业大佬对话 前言 智能体(Agent)已经成为创业者和技术人绕...
如何免费使用强大的Nano Banana Pro?附赠邪修的用法

如何免费使用强大的Nano Banana Pro?附赠邪修的用法

如何免费使用强大的 Nano Banana Pro?附赠邪修的用法 前言 大家好,我是星哥,今天来介绍谷歌的 ...
150元打造低成本NAS小钢炮,捡一块3865U工控板

150元打造低成本NAS小钢炮,捡一块3865U工控板

150 元打造低成本 NAS 小钢炮,捡一块 3865U 工控板 一块二手的熊猫 B3 工控板 3865U,搭...
国产开源公众号AI知识库 Agent:突破未认证号限制,一键搞定自动回复,重构运营效率

国产开源公众号AI知识库 Agent:突破未认证号限制,一键搞定自动回复,重构运营效率

国产开源公众号 AI 知识库 Agent:突破未认证号限制,一键搞定自动回复,重构运营效率 大家好,我是星哥,...