我爱编程

在CentOS中离线安装Oracle之安装准备

2017-06-06  本文已影响962人  李宏杰0209

前言

在测试机CentOS6.5中安装Oracle, 然后去服务器离线安装。
需要解决的问题有:

  1. Automatically downloading and installing any additional software packages and specific package versions needed for installing Oracle Grid Infrastructure and Oracle Database 12 c Release 1 (12.1) or 11g Release 2 (11.2.0.3), with package dependencies resolved via yum or up2date capabilities.
  2. Creating the user oracle and the groups oinstall (for OraInventory) and dba (for OSDBA), which are used during database installation. (For security purposes, this user has no password by default and cannot log in remotely. To enable remote login, please set a password using the passwd tool.)
  3. Modifying kernel parameters in /etc/sysctl.conf to change settings for shared memory, semaphores, the maximum number of file descriptors, and so on.
    Setting hard and soft shell resource limits in /etc/security/limits.conf, such as the locked-in memory address space, the number of open files, the number of processes, and core file size.
  4. Setting numa=off in the kernel for x86_64 machines.

上述是一些非常琐碎的配置, 我们可以使用oracle-rdbms-server-11gR2-preinstall来自动化设置。

准备工作

1. 配置本地仓库

首先下载所需要的依赖到一个单独的文件夹:

[root@lihongjie 桌面]# yumdownloader --destdir=./rpm  --resolve oracle-rdbms-server-11gR2-preinstall
已加载插件:fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: ftp.sjtu.edu.cn
 * updates: mirrors.njupt.edu.cn
--> 执行事务检查

# .....
oracle-rdbms-server-11gR2-preinstall-1.0-14.el6.x86_64.r |  21 kB     00:00     
compat-libcap1-1.10-1.x86_64.rpm                         |  17 kB     00:00     
libstdc++-devel-4.4.7-18.el6.x86_64.rpm                  | 1.6 MB     00:00     
cpp-4.4.7-18.el6.x86_64.rpm                              | 3.7 MB     00:01     
kernel-container-2.6.32-0.0.0.3.el6.x86_64.rpm           | 2.7 kB     00:00     
libaio-devel-0.3.107-10.el6.x86_64.rpm                   |  13 kB     00:00     
ksh-20120801-34.el6_9.x86_64.rpm                         | 760 kB     00:03     
compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm              | 183 kB     00:00     
mpfr-2.4.1-6.el6.x86_64.rpm                              | 157 kB     00:00     
gcc-4.4.7-18.el6.x86_64.rpm                              |  10 MB     00:04     
gcc-c++-4.4.7-18.el6.x86_64.rpm                          | 4.7 MB     00:01     
ppl-0.10.2-11.el6.x86_64.rpm                             | 1.3 MB     00:00     
cloog-ppl-0.15.7-1.2.el6.x86_64.rpm                      |  93 kB     00:00     

安装创建仓库所需要的createrepo:

[root@lihongjie 桌面]# yum install createrepo
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: ftp.sjtu.edu.cn
 * updates: mirrors.njupt.edu.cn
解决依赖关系
# 这里省略
已安装:
  createrepo.noarch 0:0.9.9-26.el6                                                      

作为依赖被安装:
  deltarpm.x86_64 0:3.5-0.5.20090913git.el6                                             
  python-deltarpm.x86_64 0:3.5-0.5.20090913git.el6                                      

完毕!

使用这个文件夹创建本地仓库:

[root@lihongjie oracle_local_repo]# createrepo  .

Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

添加本地仓库到yum仓库文件夹:

# 添加配置文件 /etc/yum.repos.d/oracle-local.repo
[oracle-local-repo]
name=oracle-local-repo
baseurl=file:///media/CentOS/oracle_local_repo/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

# 挂载光盘

[root@lihongjie oracle_local_repo_db]# mkdir /media/CentOS/
[root@lihongjie oracle_local_repo_db]# df
Filesystem           1K-blocks    Used Available Use% Mounted on
/dev/mapper/vg_lihongjie-lv_root
                      36661960 5784924  29008032  17% /
tmpfs                  1954756     460   1954296   1% /dev/shm
/dev/sda1               487652   68533    393519  15% /boot
/dev/sdb1              7846912 6900460    946452  88% /media/CENTOS_6_5_
[root@lihongjie oracle_local_repo_db]# mount /dev/sdb1 /media/CentOS/


# 查看启用的仓库

[root@lihongjie oracle_local_repo_db]# yum repolist

仓库标识                             仓库名称                              状态
base                                 CentOS-6 - Base                       6,706
c6-media                             CentOS-6 - Media                      6,367
extras                               CentOS-6 - Extras                        45
oracle-local-repo                    oracle-local-repo                        13
updates                              CentOS-6 - Updates                      354
repolist: 13,485

使用本地仓库安装 oracle-rdbms-server-11gR2-preinstall

 yum --disablerepo=\* --enablerepo=oracle-local-repo install oracle-rdbms-server-11gR2-preinstall
上一篇下一篇

猜你喜欢

热点阅读