CentOS7下使用yum快速安装配置oracle数据库
实验环境
操作系统:CentOS Linux release 7.3.1611 (Core)
IP: 192.168.230.141
原理
使用yum工具安装oracle提供的preinstall包,它将自动执行一些与配置步骤:
- 自动下载并安装 Oracle Grid Infrastructure 和 Oracle Database 11g 第 2 版 (11.2.0.3) 安装过程所需的任何额外的软件包和特定软件版本,并通过 yum 或 up2date 功能处理软件包依赖关系。
- 创建用户 oracle 和组 oinstall(针对 OraInventory)、dba(针对 OSDBA),供数据库安装期间使用。(出于安全目的,该用户没有默认口令,且不能远程登录)。要启用远程登录,请使用 passwd 工具设置一个口令。)
- 修改 /etc/sysctl.conf 中的内核参数以更改共享内存、信号、最大文件描述符数量等设置。
- 设置 /etc/security/limits.conf 中的软硬 shell 资源限制,如锁定内存地址空间、打开的文件数量、进程数和核心文件大小。
- 对于 x86_64 计算机,在内核中设置 numa=off。
如此可简化很多配置步骤
配置yum的repo文件
进入yum配置文件夹,添加oracle的yum信息库
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@localhost yum.repos.d]# rm public-yum-ol7.repo
rm: remove regular file ‘public-yum-ol7.repo’? y
[root@localhost yum.repos.d]# wget http://public-yum.oracle.com/public-yum-ol7.repo
--2017-10-09 19:26:42-- http://public-yum.oracle.com/public-yum-ol7.repo
Resolving public-yum.oracle.com (public-yum.oracle.com)... 23.49.60.35, 173.222.148.42
Connecting to public-yum.oracle.com (public-yum.oracle.com)|23.49.60.35|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6947 (6.8K) [text/plain]
Saving to: ‘public-yum-ol7.repo’
100%[=========================================================================================>] 6,947 --.-K/s in 0s
2017-10-09 19:26:44 (354 MB/s) - ‘public-yum-ol7.repo’ saved [6947/6947]
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo public-yum-ol7.repo
使用yum安装oracle预安装文件,这里我们选择11g的版本为实验对象
[root@localhost yum.repos.d]# yum install oracle
oracleasm-support.x86_64 oracle-logos.noarch
oracle-database-server-12cR2-preinstall.x86_64 oracle-rdbms-server-11gR2-preinstall.x86_64
oraclelinux-release.x86_64 oracle-rdbms-server-12cR1-preinstall.x86_64
[root@localhost yum.repos.d]# yum install oracle-rdbms-server-11gR2-preinstall.x86_64
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-5.el7 will be installed
--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Processing Dependency: kernel-uek for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Running transaction check
---> Package compat-libcap1.x86_64 0:1.10-7.el7 will be installed
---> Package compat-libstdc++-33.x86_64 0:3.2.3-72.el7 will be installed
---> Package gcc-c++.x86_64 0:4.8.5-16.el7 will be installed
---> Package kernel-container.x86_64 0:3.10.0-0.0.0.2.el7 will be installed
---> Package ksh.x86_64 0:20120801-34.el7 will be installed
---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
---> Package libstdc++-devel.x86_64 0:4.8.5-16.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================
Installing:
oracle-rdbms-server-11gR2-preinstall x86_64 1.0-5.el7 ol7_latest 21 k
Installing for dependencies:
compat-libcap1 x86_64 1.10-7.el7 base 19 k
compat-libstdc++-33 x86_64 3.2.3-72.el7 base 191 k
gcc-c++ x86_64 4.8.5-16.el7 base 7.2 M
kernel-container x86_64 3.10.0-0.0.0.2.el7 ol7_latest 2.6 k
ksh x86_64 20120801-34.el7 base 883 k
libaio-devel x86_64 0.3.109-13.el7 base 13 k
libstdc++-devel x86_64 4.8.5-16.el7 base 1.5 M
Transaction Summary
===================================================================================================================================
Install 1 Package (+7 Dependent packages)
Total download size: 9.8 M
Installed size: 29 M
Is this ok [y/d/N]: y
Downloading packages:
(1/8): compat-libcap1-1.10-