1. 硬件要求
1.swap 分区不低于2G
2.selinux 状态disable
3.物理内存不低于512M
2. 系统要求
redhat Enterprise 5 默认安装
3. 数据库要求
3.1.软件下载
根据实际环环境从oracle官方网站下载相应的数据库
3.2.解包
unzip 10201_database_linux32.zip
解包完成后后将database目录拷贝到/opt目录下,以便oracle用户安装使用
4. redhat配置
4.1 安装缺失的包
用 root 用户身份运行以下命令:
rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel
如果采用默认安装,该命令执行后通常会提示openmotif,compat-db,compat-gcc,compat-gcc-c++,compat-libstdc++,compat-libstdc++-devel 没有安装。如下所示
gcc-4.1.1-52.el5
make-3.81-1.1
binutils-2.17.50.0.6-2.el5
package openmotif is not installed
setarch-2.0-1.1
package compat-db is not installed
package compat-gcc is not installed
package compat-gcc-c++ is not installed
package compat-libstdc++ is not installed
package compat-libstdc++-devel is not installed
对缺失的包需要通过光盘或其他介质安装,笔者采用光盘安装
4.1.1 在/mnt 下创建cdrom
4.1.2 将光盘放入光驱
4.1.3 执行命令 mount -t iso9660 /dev/cdrom /mnt/cdrom
命令执行后/mnt/cdrom下将产生光盘下面的文件
4.1.4 进入光盘Server目录下 cd /mnt/cdrom/Server
由于缺失的包之间有严格的依赖关系,所以必须按照如下顺序安装缺失的包
rpm -Uvh compat-db-4*
rpm -Uvh libaio-0*
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh glibc-headers-2.5-12.i386.rpm
rpm -Uvh glibc-devel-2.5-12.i386.rpm
rpm -Uvh compat-gcc-34-3*
rpm -Uvh compat-gcc-34-c++-3*
rpm -Uvh libXp-1*
rpm -Uvh openmotif-2*
rpm -Uvh gcc-4*
rpm -Uvh glibc-2.5-12.i686.rpm
rpm -Uvh libgomp-4.1.1-52.el5.i386.rpm
rpm -Uvh gcc-4.1.1-52.el5.i386.rpm
安装完成后仍然提示部分包没有安装,不过不影响使用
package compat-gcc is not installed
package compat-gcc-c++ is not installed
package compat-libstdc++ is not installed
package compat-libstdc++-devel is not installed
4.2 vi /etc/sysctl.conf file
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
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
运行下面命令使设置生效/sbin/sysctl -p
4.3 vi /etc/security/limits.conf vf
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
4.4 vi /etc/pam.d/login
session required /lib/security/pam_limits.so
4.5 vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
#SELINUXTYPE=targeted
SELINUXTYPE=disabled
4.6 添加oracle用户和组
groupadd oinstall
groupadd dba
groupadd oper
useradd –m -g oinstall -G dba oracle
passwd oracle
4.7 创建安装目录并赋予oracle相应权限
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
4.8 添加访问控制列表
xhost + machine-name
4.9 设置主机名和IP
vi /etc/hosts
删除文件内容,添加如下两行
127.0.0.1 localhost
IP地址 主机名称
如果不添加第一行,安装以后数据库可以打开,通过 控制台发现数据库和监听器均无法启动(箭头指向下)以管理员帐号进入em,页面提示Network Adapter error,如果通过命令lsnrctl start提示如下错误
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 17-OCT-2007 15:35:07
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting .......
................
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=olivenan)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=olivenan)(PORT=1521)))
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
Linux Error: 104: Connection reset by peer
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
4.10 修改redhat版本
vi /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga) 替换成 redhat-4
4.11 修改oracle的环境变量
su - oracle
vi ~/.bash_profile
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_HOME
ORACLE_SID=orcl
export ORACLE_SID
ORACLE_TERM=xterm
export ORACLE_TERM
PATH=/usr/sbin:$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
#LD_ASSUME_KERNEL=2.4.1; export LD_ASSUME_KERNEL
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
export LANG=en_US.utf8
export LANGUAGE=en_US.utf8
export NLS_LANG="Simplified Chinese_China.UTF8"
export LC_ALL=en_US.utf8
4.13 安装
vi /home/oracle/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
#[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
以oracle用户登录系统,打开终端将当前位置定位到database中
vncserver 启动VNC服务
用vncviewer客户端进行安装
Unset LANG
./runInstaller.sh
如果之前的包按照要求安装完成,安装过程应该很顺利,如果安装进度在63%左右出现错误,如提示遇到问题需要重试,忽略等等,一般就是系统要求的包没有安装完全。
安装完成后重启机子,登录oracle 打开终端
sqlplus ‘/as sysdba'
启动数据库
startup
启动控制台
emctl start dbconsole
启动监听器
lsnrctl start
4.14 后修改vi /etc/redhat-release 内容为Red Hat Enterprise Linux Server release 5 (Tikanga)
4.15 设置开机启动
vi /etc/oratab
orcl:/u01/app/oracle/product/10.2.0/db_1:Y