CentOS 下 Oracle 10g 安装 + 配置全过程图解

过程参考官网说明,系统环境:

uname -a
    Linux higkoo 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/issue
    CentOS release 5.5 (Final)

    准备工作:

# 挂载CentOS系统安装光盘
dvdFile="//FileServerIp/Share/CentOS-5.5-x86_64-bin-DVD.iso"
dvdDir="/mnt/CentOS_Final"
mount -t iso9660 -o loop "${dvdFile}" "${dvdDir}"
# 将安装光盘添加到安装源
cat >> /etc/yum.repos.d/CentOS-Media.repo <<_yumSource
[AutoInstaller]
name=CentOS-$releasever - Media
baseurl=file:///mnt/CentOS_Final/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
_yumSource
# 使用光盘作安装源,安装依赖库
yum -y --disablerepo=\* --enablerepo=AutoInstaller --nogpgcheck --skip-broken install compat-db* compat-gcc* libXp.so.6 libc-* libaio* openmotif glibc-devel* libgcc* gnome-lib* libXtst vnc-server xterm xorg-x11-twm gcc make binutils openmotif setarch compat-libstdc++ compat-libstdc++-devel
# 创建安装目录,解压安装包
mkdir -p /data/setupfiles/Oracle /data/oracle
cd /data/setupfiles/Oracle/
zcat /mnt/Oracle/10201_database_linux_x86_64.cpio.gz | cpio -idmv
# 添加用户,设定用户密码
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle -d /data/oracle/home
id oracle
passwd oracle
# 初始化安装目录
mkdir -p /data/oracle/app /data/oracle/data
chown -R oracle:oinstall /data/oracle/app /data/oracle/data
chmod -R 775 /data/oracle/app /data/oracle/data
# 设置oracle用户的环境变量
vim ~oracle/.bash_profile
    LANG=UTF-8
    ORACLE_SID=orcl
    ORACLE_BASE=/data/oracle/app
    ORACLE_HOME=/data/oracle/home
    JAVA_HOME=$ORACLE_HOME/jdk
    PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
     LD_LIBRARY_PATH=$ORACLE_HOME/lib

    export LANG ORACLE_SID ORACLE_BASE ORACLE_HOME JAVA_HOME PATH LD_LIBRARY_PATH
# 配置VNC登录选项,Oracle安装需要使用界面
vim /etc/sysconfig/vncservers
    VNCSERVERS="0:oracle"
    VNCSERVERARGS[2]="-geometry 1280x1024 -nolisten tcp -nohttpd -localhost"
su - oracle
vncserver
logout
vncserver -kill :1
service vncserver start
# 由于Oracle未对CentOS作支持,改用RedHat标识
vim /etc/redhat-release
    Red Hat Enterprise Linux AS release 3 (higkoo)
# 修改内核参数
vim /etc/sysctl.conf
    kernel.shmall = 4294967296
    kernel.shmmax = 68719476736
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    fs.file-max = 65536
    net.ipv4.ip_local_port_range = 1024 65000
sysctl -p
# 修改Oracle用户环境
vim /etc/security/limits.conf
    oracle               soft    nproc   2047
    oracle               hard    nproc   16384
    oracle               soft    nofile 1024
    oracle               hard    nofile 65536

相关推荐