数据库管理-第104期 RAC上升级SSH的坑(20230918)

数据库管理-第104期 RAC上升级SSH的坑(20230918)

最近一些版本的OpenSSH和OpenSSL都爆出了比较严重的漏洞,但是Oracle数据库尤其是RAC升级SSH和SSL其实是有一定风险的,这里就借助我的OCM环境,做一次SSH升级的演示及排坑。

1 升级SSH

这里从群里拖了一套SSH的RPM包在线直接升级:
在这里插入图片描述
在这里插入图片描述
这里可以看到OpenSSH版本已经升级到了9.4p1,OpenSSL已经是1.1.1v。
更新完成过后,首先集群的状态是正常的(截图略)。

2 问题

似乎直接在集群运行状态下升级SSH没出现啥问题,这里就开始做另外一件事情,通过opatchauto升级数据库,目标版本是19.16,结果:
在这里插入图片描述
在这里插入图片描述
检查日志发现:

2023-09-17 21:59:06,270 INFO  [1] oracle.dbsysmodel.driver.sdk.util.OsysUtility - Output message :::  
2023-09-17 21:59:13,200 WARNING [1] oracle.dbsysmodel.driver.sdk.util.OsysUtility - Failed: 
Verifying '/tmp/' ...FAILED (PRVF-7546)
Verifying Shared Storage Accessibility:/u01/app/19.3.0/grid/crs/install ...PASSED

Verification of shared storage accessibility was unsuccessful. 
Checks did not pass for the following nodes:
	host04

这里看到检查remote节点/tmp目录时出现了问题,这里需要说明一下,在RAC集群rolling方式升级的时候,是会调用CVU(Cluster Verification Utility)来验证集群各节点情况,而相关文件就会存放在/tmp文件夹下:
在这里插入图片描述
这里也说一下我这里为什么选择19.16做测试:1. 这个是我手上生产使用且稳定的版本;2. 该版本是适配了OpenSSH_8版本了的(Cluvfy Fails Pre-checks Upgrade 19c GI From 12c - OpenSSH_8 (Doc ID 2929286.1))。因此这个版本可以最大限度减少一些问题的产生,然而问题依旧。

3 如何解决

这里其实就是这么个问题(按照INS-06006 GI RunInstaller Fails If OpenSSH Is Upgraded to 8.x (Doc ID 2555697.1)):

[root@host03 ~]# scp host04:"'/root/test'" ./
(root@host04) Password: 
scp: '/root/test': No such file or directory

## OpenSSH 8.x
[root@host03 ~]# scp -T host04:"'/root/test'" ./
(root@host04) Password:
## The file transfers will be successful.

## OpenSSH 9.x
[root@host03 ~]# scp -T host04:"'/root/test'" ./
(root@host04) Password: 
scp: '/root/test': No such file or directory

[root@host03 ~]# scp -T -O host04:"'/root/test'" ./
(root@host04) Password: 
test                                                    100%    0     0.0KB/s   00:00

因此在使用适用于OpenSSH 8.x的解决方案处理问题的时候,仍然会出现无法执行CVU的问题。
通过man scp的方式检查-T和-O参数的解释:

-O     Use the legacy SCP protocol for file transfers instead of the SFTP protocol.  Forcing the use of
       the SCP protocol may be necessary for servers that do not implement SFTP, for backwards-compati‐
       bility for particular filename wildcard patterns and for expanding paths with a `~'  prefix  for
       older SFTP servers.
-T     Disable strict filename checking.  By default when copying files from a remote host to  a  local
       directory  scp  checks  that the received filenames match those requested on the command-line to
       prevent the remote end from sending unexpected or unwanted files.  Because of differences in how
       various operating systems and shells interpret filename wildcards, these checks may cause wanted
       files to be rejected.  This option disables these checks at the expense of fully  trusting  that
       the server will not send unexpected filenames.

-T是关闭严格的文件名检查,防止来自各种操作系统的远程端和shell解释文件名通配符,这些检查可能会导致所需文件被拒绝。
-O则是不使用SFTP而是SCP协议来传输文件,对于特定文件名通配符模式具有兼容性。
因此这里在OpenSSH 8.x解决方案的基础上还需要增加-O的参数,完成解决方案如下:

# Rename the original scp.
mv /usr/bin/scp /usr/bin/scp.orig

# Create a new file </usr/bin/scp>.
vi /usr/bin/scp

# Add the below line to the new created file </usr/bin/scp>.
/usr/bin/scp.orig -T -O $*

# Change the file permission.
chmod 555 /usr/bin/scp

# Begin operation(sush as installation, opatch(auto), CVU and so on)

# After operation
mv /usr/bin/scp.orig /usr/bin/scp

处理过后opatchauto可以正常运行:
在这里插入图片描述
在这里插入图片描述

总结

本期讲解的是升级OpenSSH至9.x后RAC在升级版本时需要注意的一些问题。
老规矩,知道写了些啥。

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

胖头鱼的鱼缸(尹海文)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值