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

OEL上使用yum install oracle-validated 简化主机配置工作

161次阅读
没有评论

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

环境:OEL 5.7 + Oracle 10.2.0.5 RAC

如果你正在用 OEL(Oracle Enterprise Linux)系统部署 Oracle,那么可以使用 yum 安装 oracle-validated 包来简化主机配置的部分工作。

配置好 yum 本地源后,直接执行一条命令

yum install oracle-validated

检查发现它会自动做以下几件事:
1)安装 oracle 依赖包
2)/etc/sysctl.conf 增加 oracle 用户内容
3)/etc/security/limits.conf 增加 oracle 用户内容
4)创建 Oracle 用户和相关组
这极大的简化了系统主机配置阶段我们要做的工作内容。
当然我们需要根据实际情况最好要确认 /etc/sysctl.conf /etc/security/limits.conf 内容合理性。

1. 安装 oracle 依赖包

yum install oracle-validated

[root@oradb28 yum.repos.d]# yum install oracle-validated
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-validated.x86_64 0:1.1.0-14.el5 set to be updated
ISO/filelists                                                                                                                                                                               | 3.1 MB     00:00     
--> Processing Dependency: gdb for package: oracle-validated
--> Processing Dependency: sysstat for package: oracle-validated
--> Processing Dependency: /usr/lib/libaio.so for package: oracle-validated
--> Processing Dependency: glibc-headers for package: oracle-validated
--> Processing Dependency: unixODBC-devel for package: oracle-validated
--> Processing Dependency: /usr/lib64/libodbccr.so for package: oracle-validated
--> Processing Dependency: gcc-c++ for package: oracle-validated
--> Processing Dependency: libaio-devel for package: oracle-validated
--> Processing Dependency: gcc for package: oracle-validated
--> Processing Dependency: elfutils-libelf-devel for package: oracle-validated
--> Processing Dependency: compat-gcc-34-c++ for package: oracle-validated
--> Processing Dependency: /usr/lib/gcc/x86_64-RedHat-linux/4.1.1/libstdc++.a for package: oracle-validated
--> Processing Dependency: /usr/lib/libodbc.so.1 for package: oracle-validated
--> Processing Dependency: compat-gcc-34 for package: oracle-validated
--> Processing Dependency: /usr/lib/libc.so for package: oracle-validated
--> Processing Dependency: /usr/lib64/libaio.so for package: oracle-validated
--> Processing Dependency: /usr/lib64/libc.so for package: oracle-validated
--> Processing Dependency: /usr/lib/libodbccr.so for package: oracle-validated
--> Processing Dependency: kernel-headers for package: oracle-validated
--> Processing Dependency: libXp.so.6 for package: oracle-validated
--> Processing Dependency: libdb-4.2.so()(64bit) for package: oracle-validated
--> Processing Dependency: libodbc.so.1()(64bit) for package: oracle-validated
--> Running transaction check
---> Package compat-db.x86_64 0:4.2.52-5.1 set to be updated
---> Package compat-gcc-34.x86_64 0:3.4.6-4.1 set to be updated
---> Package compat-gcc-34-c++.x86_64 0:3.4.6-4.1 set to be updated
---> Package elfutils-libelf-devel.x86_64 0:0.137-3.el5 set to be updated
--> Processing Dependency: elfutils-libelf-devel-static-x86_64 = 0.137-3.el5 for package: elfutils-libelf-devel
---> Package gcc.x86_64 0:4.1.2-51.el5 set to be updated
---> Package gcc-c++.x86_64 0:4.1.2-51.el5 set to be updated
---> Package gdb.x86_64 0:7.0.1-37.el5 set to be updated
---> Package glibc-devel.i386 0:2.5-65 set to be updated
---> Package glibc-devel.x86_64 0:2.5-65 set to be updated
---> Package glibc-headers.x86_64 0:2.5-65 set to be updated
---> Package kernel-uek-headers.x86_64 0:2.6.32-200.13.1.el5uek set to be updated
---> Package libXp.i386 0:1.0.0-8.1.el5 set to be updated
---> Package libaio-devel.i386 0:0.3.106-5 set to be updated
---> Package libaio-devel.x86_64 0:0.3.106-5 set to be updated
---> Package libstdc++-devel.x86_64 0:4.1.2-51.el5 set to be updated
---> Package sysstat.x86_64 0:7.0.2-11.el5 set to be updated
---> Package unixODBC.i386 0:2.2.11-7.1 set to be updated
---> Package unixODBC.x86_64 0:2.2.11-7.1 set to be updated
---> Package unixODBC-devel.i386 0:2.2.11-7.1 set to be updated
---> Package unixODBC-devel.x86_64 0:2.2.11-7.1 set to be updated
--> Running transaction check
---> Package elfutils-libelf-devel-static.x86_64 0:0.137-3.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                                         Arch                                      Version                                                    Repository                              Size
===================================================================================================================================================================================================================
Installing:
 oracle-validated                                                x86_64                                    1.1.0-14.el5                                               ISO                                     24 k
Installing for dependencies:
 compat-db                                                       x86_64                                    4.2.52-5.1                                                 ISO                                    1.6 M
 compat-gcc-34                                                   x86_64                                    3.4.6-4.1                                                  ISO                                    4.3 M
 compat-gcc-34-c++                                               x86_64                                    3.4.6-4.1                                                  ISO                                     13 M
 elfutils-libelf-devel                                           x86_64                                    0.137-3.el5                                                ISO                                     24 k
 elfutils-libelf-devel-static                                    x86_64                                    0.137-3.el5                                                ISO                                     64 k
 gcc                                                             x86_64                                    4.1.2-51.el5                                               ISO                                    5.3 M
 gcc-c++                                                         x86_64                                    4.1.2-51.el5                                               ISO                                    3.8 M
 gdb                                                             x86_64                                    7.0.1-37.el5                                               ISO                                    2.4 M
 glibc-devel                                                     i386                                      2.5-65                                                     ISO                                    2.0 M
 glibc-devel                                                     x86_64                                    2.5-65                                                     ISO                                    2.4 M
 glibc-headers                                                   x86_64                                    2.5-65                                                     ISO                                    594 k
 kernel-uek-headers                                              x86_64                                    2.6.32-200.13.1.el5uek                                     ISO                                    724 k
 libXp                                                           i386                                      1.0.0-8.1.el5                                              ISO                                     22 k
 libaio-devel                                                    i386                                      0.3.106-5                                                  ISO                                     12 k
 libaio-devel                                                    x86_64                                    0.3.106-5                                                  ISO                                     11 k
 libstdc++-devel                                                 x86_64                                    4.1.2-51.el5                                               ISO                                    2.8 M
 sysstat                                                         x86_64                                    7.0.2-11.el5                                               ISO                                    187 k
 unixODBC                                                        i386                                      2.2.11-7.1                                                 ISO                                    830 k
 unixODBC                                                        x86_64                                    2.2.11-7.1                                                 ISO                                    835 k
 unixODBC-devel                                                  i386                                      2.2.11-7.1                                                 ISO                                    743 k
 unixODBC-devel                                                  x86_64                                    2.2.11-7.1                                                 ISO                                    799 k

Transaction Summary
===================================================================================================================================================================================================================
Install      22 Package(s)
Upgrade       0 Package(s)

Total download size: 42 M
... 这里省略后面安装的输出提示,按提示输入 y 直接安装即可。

2. /etc/sysctl.conf 增加 oracle 用户内容

cat /etc/sysctl.conf 确认如下是自动增加的内容:

# For 11g, Oracle-Validated setting for fs.file-max is 6815744
# For 10g, uncomment 'fs.file-max = 327679', and comment 'fs.file-max = 6553600' entry and re-run sysctl -p
# fs.file-max = 327679
fs.file-max = 6815744

# Oracle-Validated setting for kernel.msgmni is 2878
kernel.msgmni = 2878

# Oracle-Validated setting for kernel.msgmax is 8192
kernel.msgmax = 8192

# Oracle-Validated setting for kernel.msgmnb is 65536
kernel.msgmnb = 65536

# Oracle-Validated setting for kernel.sem is '250 32000 100 142'
kernel.sem = 250 32000 100 142

# Oracle-Validated setting for kernel.shmmni is 4096
kernel.shmmni = 4096

# Oracle-Validated setting for kernel.shmall is 1073741824
kernel.shmall = 1073741824

# Oracle-Validated setting for kernel.shmmax is 4398046511104 on x86_64 and 4294967295 on i386 architecture. Refer Note id 567506.1
kernel.shmmax = 4398046511104

# Oracle-Validated setting for kernel.sysrq is 1
kernel.sysrq = 1

# Oracle-Validated setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144

# For 11g, Oracle-Validated setting for net.core.rmem_max is 4194304
# For 10g, uncomment 'net.core.rmem_max = 2097152', comment 'net.core.rmem_max = 4194304' entry and re-run sysctl -p
# net.core.rmem_max = 2097152
net.core.rmem_max = 4194304

# Oracle-Validated setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144

# For 11g, Oracle-Validated setting for net.core.wmem_max is 1048576
# For 10g, uncomment 'net.core.wmem_max = 262144', comment 'net.core.wmem_max = 1048576' entry for this parameter and re-run sysctl -p
# net.core.wmem_max = 262144
net.core.wmem_max = 1048576

# Oracle-Validated setting for fs.aio-max-nr is 3145728
fs.aio-max-nr = 3145728

# For 11g, Oracle-Validated setting for net.ipv4.ip_local_port_range is 9000 65500
# For 10g, uncomment 'net.ipv4.ip_local_port_range = 1024 65000', comment 'net.ipv4.ip_local_port_range = 9000 65500' entry and re-run sysctl -p
# net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.ip_local_port_range = 9000 65500

# Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
vm.min_free_kbytes = 51200

可以看到每条内核参数都有清晰明了的注释,我这里是安装 10g RAC,那么就按照注释说明,将那些 For 10g 的参数启用即可。

3. /etc/security/limits.conf 增加 oracle 用户内容

cat /etc/security/limits.conf 确认如下是自动增加的内容:

# Oracle-Validated setting for nofile soft limit is 131072
oracle   soft   nofile    131072

# Oracle-Validated setting for nofile hard limit is 131072
oracle   hard   nofile    131072

# Oracle-Validated setting for nproc soft limit is 131072
oracle   soft   nproc    131072

# Oracle-Validated setting for nproc hard limit is 131072
oracle   hard   nproc    131072

# Oracle-Validated setting for core soft limit is unlimited
oracle   soft   core    unlimited

# Oracle-Validated setting for core hard limit is unlimited
oracle   hard   core    unlimited

# Oracle-Validated setting for memlock soft limit is 50000000
oracle   soft   memlock    50000000

# Oracle-Validated setting for memlock hard limit is 50000000
oracle   hard   memlock    50000000

由于我接下来要安装 Oracle10g RAC,只用到一个 oracle 用户,所以这里不需要修改,如果你装的是 11g RAC,则需要手工添加 grid 用户的资源使用限制条目。

4. 创建 Oracle 用户和相关组

查看已经创建了 oracle 用户,组 oinstall 和 dba

[root@oradb28 cdrom]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba) context=root:system_r:unconfined_t:SystemLow-SystemHigh

安装 RAC 需要确定各节点 oracle 用户和组的 uid,gid 保持一致,由于它自动生成的 uid 和 gid 的对应数字很大,所以一般都一致。

这样一来,在 OEL 系统上安装 Oracle 前的主机配置系列工作将得到简化,我们不必再去过多的考虑需要哪些依赖包和内核参数设置的问题了。

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

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