1.保证网络没有问题,特别是网卡设置.
设置网卡上的主机名
修改/etc/hosts文件,把127.0.0.1修改为网卡设置的(直实)ip地址,其后把多余的主机名去掉,只保留一个真实的主机名.
2.如果在32位机上安装,只需Check i386的软件包,按照第一步选择安装,以下软件包中只有红色部分需要手动安装,其他的正常都已经安装。
# From RedHat AS5 Disk 1
mount -t iso9660 /storage/RHEL5/x64/rhel-5-server-x86_64-disc1.iso /mnt/ -o loop
cd /mnt/Server
rpm -Uvh setarch-2.0-1.1.x86_64.rpm #rpm -Uvh setarch-2*
rpm -Uvh make-3.81-1.1.x86_64.rpm #rpm -Uvh make-3*
rpm -Uvh glibc-2.5-12.x86_64.rpm #rpm -Uvh glibc-2*
rpm -Uvh libaio-0.3.106-3.2.x86_64.rpm #rpm -Uvh libaio-0*
rpm -Uvh libaio-0.3.106-3.2.i386.rpm #rpm -Uvh libaio-0*
cd /
umount /mnt
# From RedHat AS5 Disk 2
mount -t iso9660 /storage/RHEL5/x64/rhel-5-server-x86_64-disc2.iso /mnt/ -o loop
cd /mnt/Server
rpm -Uvh gcc-4.1.1-52.el5.x86_64.rpm #rpm -Uvh gcc-4*
cd /
umount /mnt
# From RedHat AS5 Disk 3
mount -t iso9660 /storage/RHEL5/x64/rhel-5-server-x86_64-disc3.iso /mnt/ -o loop
cd /mnt/Server
rpm -Uvh compat-libstdc++-33-3.2.3-61.x86_64.rpm #rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh compat-gcc-34-3.4.6-4.x86_64.rpm #rpm -Uvh compat-gcc-34-3*
rpm -Uvh compat-gcc-34-c++-3.4.6-4.x86_64.rpm #rpm -Uvh compat-gcc-34-c++-3*
rpm -Uvh libXp-1.0.0-8.x86_64.rpm #rpm -Uvh libXp-1*
rpm -Uvh libXp-1.0.0-8.i386.rpm #rpm -Uvh libXp-1*
rpm -Uvh openmotif-2.3.0-0.3.el5.x86_64.rpm #rpm -Uvh openmotif-2*
rpm -Uvh compat-db-4.2.52-5.1.x86_64.rpm #rpm -Uvh compat-db-4*
cd /
umount /mnt
3.以下修改内核参数等文件,已保证Oracle的预安装准备成功。执行如下:
vi /etc/sysctl.conf 行末添加以下内容
# 20071212 add content for oracle install
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
执行下述命令。导入刚才写入的参数。不执行,oracle在后面安装前的检测会报警。
sysctl -p
vi /etc/security/limits.conf 行末添加以下内容
# 20071212 add content for oracle install
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
vi /etc/pam.d/login 行末添加以下内容
# 20071212 add content for oracle install
session required pam_limits.so
vi /etc/selinux/config 确保以下内容
SELINUX=disabled
此处再确认一下吧。
4.创建oracle用户,和一些安装目录
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba -m oracle
passwd oracle
mkdir -p /opt/oracle
chown -R oracle.oinstall /opt/oracle
将oracle的安装文件置于家目录,进行加压。
gzip -dc 10201_database_linux_x86_64.cpio.gz | cpio -div
5.添加环境变量,定义SID等
su - oracle
vi .bash_profile
#--------------------------------------
# Set for Oracle10g Install;
#--------------------------------------
trap " " 0 1 2 3 5 9 15
trap clear 0
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=minot
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64/
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_ASSUME_KERNEL=2.6.18
export NLS_LANG="Simplified Chinese_china".UTF8
LC_CTYPE=zh_CN.UTF8
LC_ALL=zh_CN.UTF8
LANG=zh_CN.UTF8
umask 022
#
执行环境设置
source ~/.bash_profile
6.因 为oracle 的官方只支持到RHEL4为止,所以要修改版本说明,编辑文件 /etc/redhat-release 把Red Hat Enterprise Linux Server release 5 (Tikanga) 改成版本4,当然oracle安装完成后,要修改回来:
echo "redhat-4" > /etc/redhat-release
7.安装oracle
xhost +
su - oracle
export DISPLAY="本机真实的ip地址:0.0"
export LANG=en_US
~/database/runInstaller
安装到最后时,一定要注意运行安装系统提示的那两个脚本。
8.启动oracle
安装后的调整dbstart
在运行$ORACLE_HOME/bin/dbstart时报错,
Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
解决方法:修改dbstart这个文件,找到ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
su - oracle
vi `which dbstart`
ORACLE_HOME_LISTNER=$ORACLE_HOME
修改/etc/oratab文件
minot:/datas/apps/oracle/product/10.2.0/db_1:Y
创建自启动脚本。
oracle 10g在自身的dbstart已经启动了lsnrctl,所以下面的脚本上注释掉了lsnrctl的启动
touch dbora
chmod 700 dbora
vi dbora
dbora内容如下
#!/bin/bash
#
# chkconfig: 2345 80 05
# description: Oracle 10g Server
# /etc/init.d/dbora
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=minot
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR="oracle"
# if the executables do not exist -- display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
# su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle
su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
su $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctl start"
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
# su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
su $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctl stop"
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
加载到自动启动目录
cp dbora /etc/rc.d/init.d
chkconfig --add dbora
chkconfig --list | grep dbora
dbora 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
一些服务介绍和补充
a:$ORACLE_HOME/bin/dbstart | dbshut
b:$ORACLE_HOME/bin/lsnrctl start | stop 监听器启动|关闭。
c:$ORACLE_HOME/bin/emctl start | stop dbconsole
访问 http://yourIP:1158/em
d:$ORACLE_HOME/bin/isqlplusctl start | stop
访问 http://yourIP:5560/isqlplus