1、实验目标
问题:由于部分新购服务器,只支持安装linux 6.X
矛盾:应用服务只支持Oracle 10g,而Oracle 10g官方只支持 Linux 4
迷茫:Linux 6.X安装Oracle 10g过程中会遇到较多异常
破解:现整理《安装oracle 10g on Redhat 6.8》,帮助大家快速安装Oracle 10g。
2、环境介绍
操作系统 : Redhat 6.8
数据库版本: Oracle 10.2.0.1>>升级到Oracle 10.2.0.5
虚拟机 : VMware-workstation-full-11.1.2.61471.1437365244
3、讲师介绍

安装过程如有疑问,欢迎添加微信咨询。
4、软件下载

链接:http://pan.baidu.com/s/1qYAsEFM 密码:ok1o
5、环境搭建
环境搭建部分请参考star之前的文章 《star带你玩转Oracle-零基础openfiler共享存储安装Oracle 11G RAC》
Redhat 6.8操作系统_安装 : http://blog.itpub.net/31442014/viewspace-2138822/
6、操作系统配置
6.1 修改/etc/hosts
root执行脚本-
cat >> /etc/hosts <<EOF
-
#Public
-
192.168.1.121 oracle10g
- EOF
6.2 修改/etc/redhat-release
Red Hat Enterprise Linux Server release 4.0 (Santiago) 将6.8修改为4.0
6.3 配置YUM
6.3.1 首次挂载报错
[root@oracle10g ~]# mount /dev/cdrom /mnt
mount: you must specify the filesystem type
6.3.2 处理报错方法

[root@htdb1 ~]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
#vi /etc/yum.repos.d/rhel-source.repo --说明: 先清空该文件,再添加以下内容。 有同学反应,yum无法正常安装rpm包,因为没有正常该文件造成。
[rhel-oracle-lib]
name=oracle
baseurl=file:///mnt
enabled=1
gpgcheck=0
#yum clean all
#yum list |head

6.4 安装RPM包
root执行脚本
-
yum install -y binutils compat-db control-center gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel make pdksh sysstat
-
-
yum install libXp-1.0.2-2.1.el6.i686.rpm
-
yum install libXp-devel.i686
-
yum install glibc-devel-2.12-1.192.el6.i686.rpm
-
-
[root@oracle10g ~]# cd /mnt/Packages/
-
[root@oracle10g Packages]# rpm -ivh --force libXp-1.0.2-2.1.el6.i686.rpm
-
[root@oracle10g Packages]# yum install –y libXt.i686
-
[root@oracle10g Packages]# yum install –y libXtst.i686
-
[root@oracle10g Packages]# yum install -y libgcc-4.4.7-17.el6.i686.rpm
-
[root@oracle10g soft]# rpm -ivh pdksh-5.2.14-30.x86_64.rpm
-
[root@oracle10g Packages]# yum install -y binutils-devel-2.20.51.0.2-5.44.el6.x86_64.rpm
-
[root@oracle10g Packages]# yum install -y binutils-devel-2.20.51.0.2-5.44.el6.i686.rpm
- [root@oracle10g Packages]# yum install -y compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm [root@oracle10g Packages]# yum install -y compat-libstdc++-33-3.2.3-69.el6.i686.rpm
6.5 关闭防火墙及selinux
root执行脚本
-
/sbin/iptables -F; /sbin/ip6tables -F
-
/sbin/chkconfig iptables off; /sbin/chkconfig ip6tables off
-
-
/bin/sed -i s/SELINUX=enforcing/SELINUX=disabled/ /etc/selinux/config
- /usr/sbin/setenforce 0
6.6 修改/etc/sysctl.conf参数
cat >> /etc/sysctl.conf
<
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024
65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
EOF
6.7 修改/etc/security/limits.conf参数
root执行脚本
cat >> /etc/security/limits.conf
<
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
6.8 修改/etc/pam.d/login参数(root执行脚本)
cat >> /etc/pam.d/login <
#for oracle
session required pam_limits.so
EOF
6.9 修改/etc/profile参数
root执行脚本
cat >> /etc/profile <
#for oracle
if [ \$USER = "oracle" ] || [
\$USER = "grid" ]; then
if [ \$SHELL = "/bin/ksh" ];
then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
EOF
6.10 创建用户
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
/bin/echo "oracle"
|/usr/bin/passwd --stdin oracle
6.11 创建目录
root执行脚本
mkdir -p /u01/app/oracle
chown -R oracle:oinstall
/u01/app/oracle
chmod -R 775 /u01/app/oracle
6.12 修改环境变量
root执行脚本
ORACLE用户:
cat >> /home/oracle/.bash_profile
<
export ORACLE_BASE=/u01/app/oracle
export
ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=oracle10g
export
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export
LD_LIBRARY_PATH=\$ORACLE_HOME/lib
export
PATH=\$ORACLE_HOME/OPatch:\$ORACLE_HOME/bin:\$PATH
umask=022
EOF
6.13 修改hugetlb_shm_group
将oracle的dba组的gid写入/proc/sys/vm/hugetld_shm_group文件中
[root@oracle10g Packages]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
[root@oracle10g Packages]# cat /proc/sys/vm/hugetlb_shm_group
0
[root@oracle10g Packages]# echo vm.hugetlb_shm_group=500 >> /etc/sysctl.conf
[root@oracle10g Packages]# sysctl -p
7、上传解压安装文件
创建软件上传目录
[root@oracle10g u01]# mkdir -p /u01/soft
[root@oracle10g u01]# chown -R oracle:oinstall /u01/soft
查看上传软件
[oracle@oracle10g soft]$ ls -ltr
total 1961236
-rw-r--r--. 1 oracle oinstall 758433170 May 17 11:17 10201_database_linux_x86_64.cpio.gz
-rw-r--r--. 1 oracle oinstall 1249857866 May 17 11:19 p8202632_10205_Linux-x86-64.zip
解压安装文件
1. gunzip 10201_database_linux_x86_64.cpio.gz
得到10201_database_linux_x86_64.cpio文件
2. cpio -idmv <10201_database_linux_x86_64.cpio
8、重启数据库服务器
安装数据库前重启数据库服务器
reboot
9、安装10.2.0.1
以oracle账号登陆操作系统(不要使用su oracle或su – oracle,直接使用oracle登陆)
[oracle@oracle10g soft]$ export DISPLAY=192.168.1.11:0.0
[oracle@oracle10g database]$ ./runInstaller







9.1 问题解决'collector' ins_emdb.mk:
Exception String: Error in invoking target 'collector' of makefile '/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emdb.mk'
1. The
popup error concerning the linking of target "collector" at about 83%
of the linking process of the 10.2.0.1 base-release install should be ignored.
2. Apply 10.2.0.4 or 10.2.0.5 patchset
参考文档:
Install Of 10.2.0.1 On SLES 11 X86-64 Fails with Error:"Error In Invoking Target 'Collector' Of Makefile '$ORACLE_HOME/sysman/lib/ins_emdb.mk'" (Doc ID 957982.1)
分别使用root账号,执行以下脚本

10、升级10.2.0.5
[root@oracle10g soft]# chown oracle:oinstall p8202632_10205_Linux-x86-64.zip
[oracle@oracle10g soft]$ unzip p8202632_10205_Linux-x86-64.zip
[oracle@oracle10g soft]$ cd Disk1/
[oracle@oracle10g Disk1]$ ls
install patch_note.htm response runInstaller stage
[oracle@oracle10g Disk1]$ ./runInstaller
使用root账号,执行以下脚本


点击exit
11、创建实例
请参考star同学以下文档,
http://blog.itpub.net/31442014/viewspace-2138838/ 21、创建数据库实例恭喜大家,顺利在linux 6 上安装oracle 10G。