![RHEL7上安装Oracle 11g时“shmmax”值太大](https://linux22.com/image/1480566/RHEL7%E4%B8%8A%E5%AE%89%E8%A3%85Oracle%2011g%E6%97%B6%E2%80%9Cshmmax%E2%80%9D%E5%80%BC%E5%A4%AA%E5%A4%A7.png)
我正在尝试安装Oracle Database 11g Release 2
。RHEL 7.2
执行后runfixup.sh
,它输出:
# /tmp/CVU_11.2.0.1.0_oracle/runfixup.sh
Response file being used is :/tmp/CVU_11.2.0.1.0_oracle/fixup.response
Enable file being used is :/tmp/CVU_11.2.0.1.0_oracle/fixup.enable
Log file location: /tmp/CVU_11.2.0.1.0_oracle/orarun.log
Setting Kernel Parameters...
/tmp/CVU_11.2.0.1.0_oracle/orarun.sh: line 244: [: 18446744073692774399: integer expression expected
The value for shmmax in response file is not greater than value of shmmax for current session. Hence not changing it.
/tmp/CVU_11.2.0.1.0_oracle/orarun.sh: line 335: [: 18446744073692774399: integer expression expected
The value for shmall in response file is not greater than value of shmall for current session. Hence not changing it.
The value for semmni in response file is not greater than value of semmni for current session. Hence not changing it.
举shmmax
个例子,代码runfixup.sh
如下:
239 #current value of shmmax - value in /proc/sys/kernel/shmmax
240 cur_shmmax=`/sbin/sysctl -n kernel.shmmax`
241 #remove the extra spaces in the line.
242 cur_shmmax=`echo $cur_shmmax | sed 's/ //g'`
243 echo "shmmax for current session:$cur_shmmax" >> $log_file/orarun.log
244 if [ $SHMMAX -gt $cur_shmmax ]
245 then
246 if ! $SYSCTL_LOC -w kernel.shmmax="$SHMMAX"
247 then
248 echo "$SYSCTL_LOC failed to set shmmax" |tee -a $log_file/orarun.log
249 fi
250 else
251 echo "The value for shmmax in response file is not greater than value of shmmax for current session. Hence not changi ng it." |tee -a $log_file/orarun.log
252 fi
检查shmmax
系统中的配置:
# /sbin/sysctl -a | grep shm
kernel.shm_next_id = -1
kernel.shm_rmid_forced = 0
kernel.shmall = 18446744073692774399
kernel.shmmax = 18446744073692774399
kernel.shmmni = 4096
vm.hugetlb_shm_group = 0
我的问题是:
(1) if [ -gt ]
inBash
只对整数进行操作?如何对64位长整数进行操作? (2) 按照hint的期望值
修改就可以了吗?shmmax
Oracle
答案1
Bash 似乎运行正常签64 位整数。如果您需要更高的稳定性,请使用 bc,例如,对于 bash 无法处理的这些无符号 64 位整数。
echo "18446744073709551615 * 2" | bc -l
36893488147419103230
echo "18446744073709551615 > 2" | bc -l
1
echo "18446744073709551615 < 2" | bc -l
0
我会按照 Oracle 的指示随意修改 shmmax。如果您对修改共享内存分布有疑虑,有许多网页可以准确解释这将产生什么效果。
答案2
我在 RHEL7 上安装 Oracle XE 时也遇到了同样的问题,shmmax 和 shmall 的值与您显示的相同。但是机器只有 3G 的 RAM,不需要这么大的值。因此,我在 sysctl.conf 中将参数更改为小于此的值,安装顺利进行。
谨致问候,雷吉斯