前提:
1.安装前先确定系统是否安装过oracle,若安装过先进行删除
1)SQL>startup mount force restrict
2) SQL>drop database
3) 删除oracle文件夹
4)删除/etc/oraInst.loc  /etc/oratab
2.安装需求
1)swap 分区不低于2G
2)物理内存不低于512M
进行安装:
1.vi /etc/hosts 确认主机名
2.vi /etc/sysctl.conf然后执行sysctl -p
kernel.shmmax = 物理内存的一半,以字节为单位
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=1048576
net.core.rmem_max=1048576
net.core.wmem_default=262144
net.core.wmem_max=262144
fs.file-max = 65536
3.vi /etc/security/limits.conf
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
4.vi /etc/pam.d/login
session required /lib/security/pam_limits.so
5./etc/init.d/iptables stop;setenforce=0
6.确认安装如下软件包
rpm -Uvh setarch-2*
rpm -Uvh make-3*
rpm -Uvh glibc-2*
rpm -Uvh libaio-0*
rpm -Uvh compat-db-4.1.25.9
rpm -Uvh compat-libstdc++-296-2.96-132.7.2
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh compat-gcc-34-3*
rpm -Uvh compat-gcc-34-c++-3*
rpm -Uvh gcc-4*
rpm -Uvh gcc-c++-*
rpm -Uvh libXp-1*
rpm -Uvh openmotif-2*
rpm -Uvh compat-db-4*
7.创建用户和组
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
8.建立相应的目录并更改权限
mkdir -p /opt/u01/app/oracle/product/10g
chown -R oracle.oinstall /opt/u01
9.vi /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga) 被 redhat-4 替换
10.设置环境变量
#export PATH
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/opt/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10g
export ORACLE_SID=oracledb
export ORACLE_TERM=xterm
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export DISPLAY=:0.0
export LC_CTYPE=en_US.UTF-8
cd /
11.进行静默安装,编辑enterprise.rsp(该文件在/database/response/下)如下:
n_configurationOption=3
UNIX_GROUP_NAME="oinstall"
ORACLE_HOME="/opt/u01/app/oracle/product/10g"
ORACLE_HOME_NAME="OraDbHome1"
ORACLE_HOSTNAME="$hostname"
s_nameForDBAGrp="dba"
s_nameForOPERGrp="dba"
12.进入到安装包文件夹进行安装
./runInstaller -silent -responsefile /home/oracle/enterprise.rsp -force
13.安装到最后会有提示,需要执行两个脚本,执行完成后安装结束