RedHat Linux 5.6 一步一步安装Oracle 10.2.0.1
一、环境介绍
Linux系统:RedHat Linux 5.6
Oracle版本:10.2.0.1
二、修改系统变量&&权限&&防火墙
1.vi /etc/hosts
[root@rhel ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.11 rhel
[root@rhel ~]#
2.vi /etc/sysconfig/network
[root@rhel ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rhel
GATEWAY=192.168.56.1
[root@rhel ~]#
3.vi /etc/sysconfig/network-scripts/ifcfg-eth0
[root@rhel ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=d21ebfcc-870c-4d15-857f-3bc3ac379c9a
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.56.11
PREFIX=24
GATEWAY=192.168.56.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
HWADDR=08:00:27:09:DE:0E
[root@rhel ~]#
4.vi /etc/sysctl.conf添加如下内容(摘用11g的参数,可优化参照官方文档)
vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1932735283
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
完成后#sysctl -p,使生效
5.修改/etc/security/limits.conf 文件尾部追加如下内容,以设置用户限制
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
6.vi /etc/pam.d/login
session required /lib64/security/pam_limits.so
vi /etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
7.关闭selinux
在/etc/selinux/config 文件中设置SELINUX=disabled
8.关闭防火墙
service iptables stop
chkconfig iptables off
9.修改数据库版本
vi /etc/redhat-release
将Red Hat Enterprise Linux Server release 5.4 (Tikanga)替换为redhat-4
三、检查安装包
Check the installation environment:
#rpm -q binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel libXp
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils compat-db control-center gcc gcc-c++ glibc glibc-common glibc-devel gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio
--挂载光盘
[root@rhel ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 25G 2.9G 21G 12% /
tmpfs 940M 144K 939M 1% /dev/shm
/dev/sda1 477M 41M 411M 9% /boot
/dev/hda 3.4G 3.4G 0 100% /media/RHEL_5.4 x86_64 DVD
[root@rhel ~]#
[root@rhel ~]# mount /dev/hda /mnt
mount: block device /dev/hda is write-protected, mounting read-only
[root@rhel ~]#
--配置yum源
[root@rhel yum.repos.d]# pwd
/etc/yum.repos.d
[root@rhel yum.repos.d]# cat yum.repo
[base]
name=base
baseurl=file:///mnt/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@rhel yum.repos.d]#
解决:
--检查需包
[root@rhel yum.repos.d]# rpm -q binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel libXp
binutils-2.17.50.0.6-14.el5
package compat-libstdc++ is not installed
elfutils-libelf-0.137-3.el5
package elfutils-libelf-devel is not installed
package gcc is not installed
package gcc-c++ is not installed
glibc-2.5-58
glibc-2.5-58
glibc-common-2.5-58
package glibc-devel is not installed
package glibc-headers is not installed
libaio-0.3.106-5
libaio-0.3.106-5
package libaio-devel is not installed
libgcc-4.1.2-50.el5
libgcc-4.1.2-50.el5
libstdc++-4.1.2-50.el5
libstdc++-4.1.2-50.el5
package libstdc++-devel is not installed
make-3.81-3.el5
package sysstat is not installed
package unixODBC is not installed
package unixODBC-devel is not installed
package libXp is not installed
[root@rhel yum.repos.d]#
--安装缺失的包
yum install -y compat*
yum install -y elfutils-libelf-devel*
yum install -y gcc*
yum install -y glibc-devel*
yum install -y glibc-headers*
yum install -y libaio-devel*
yum install -y libstdc++-devel*
yum install -y sysstat*
yum install -y unixODBC*
yum install -y libXp*
四、添加oracle用户&&组&&创建目录
groupadd dba
groupadd oinstall
useradd oracle -g oinstall -G dba
passwd oracle
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
五、设置oracle用户环境变量
vi .bash_profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
保存退出后,source .bash_profile
六、上传Oracle软件、安装。
[oracle@rhel soft]$ pwd
/home/oracle/soft
[oracle@rhel ~]$ gunzip 10201_database_linux_x86_64.cpio.gz
[oracle@rhel ~]$ ls
10201_database_linux_x86_64.cpio
[oracle@rhel ~]$ cpio -idmv <10201_database_linux_x86_64.cpio
省略...................
[oracle@rhel ~]$ ls
10201_database_linux_x86_64.cpio database
[oracle@rhel ~]$ cd database/
[oracle@rhel database]$ ls
doc install response runInstaller stage welcome.html
[oracle@rhel database]$
--开始安装
[oracle@rhel database]$ ./runInstaller