1. centos 6.4 桌面系统,卸载了自带的java7和不用的其它软件,不带openoffice等办公及娱乐软件,安装后yum update升级系统到最新,安装Qt4编译需要的开发包(参照)
2. 安装oracle依赖包
yum install kernel-devel kernel-headers binutils-devel dos2unix lrzsz python-devel compat-db compat-gcc-34 compat-gcc-34-c++ compat-libstdc++-33 glibc-devel ksh
yum install libaio-devel numactl-devel unixODBC unixODBC-devel elfutils-libelf-devel-static glibc-devel elfutils-libelf-devel libtermcap-devel readline-devel libXp libgcc_s.so.1
yum install libXp.i686 libXt.i686 libXtst.i686 libXpm-devel.i686 libaio-devel.i686 glibc-devel.i686 libstdc++-devel.i686 compat-libstdc++-33.i686
3. 编辑/etc/hosts,最后追加行,加入主机名和ip(ipconfig查看ip)(否则dbca时创建数据库过程报ORA-00600错误)
192.168.109.129 rheicentos
4. 创建oracle用户和安装相关目录
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
usermod -g oinstall -G dba oracle
mkdir -p /opt/oracle
chown -R oracle:oinstall /opt/oracle
chmod -R 755 /opt/oracle
5. 编辑/etc/sysctl.conf,最后追加行
cat >> /etc/sysctl.conf << EOF
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65500
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
EOF
执行sysctl -p使设置生效
6. 编辑/etc/security/limits.conf(设置Shell限制),最后追加行
cat >> /etc/security/limits.conf << EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
7. 编辑/etc/pam.d/login,最后追加行
cat >> /etc/pam.d/login << EOF
session required pam_limits.so
EOF
8. 编辑/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
9. 编辑/etc/csh.login,最后追加行
if ( $USER == "oracle") then
limit maxproc 16384
limit descriptors 65536
endif
10.编辑/home/oracle/.bash_profile,最后追加行
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/10201
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
11.以oracle用户登录,在用户目录下解压安装文件
zcat 10201_database_linux_x86_64.cpio.gz | cpio-idmv > /dev/null 2>&1
12.编辑/home/oracle/database/install/oraparam.ini,增加红色部分
[Certified Versions]
Linux=redhat-6,redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2
13.执行export LANG=en_US,执行安装程序/home/oracle/database/runInstaller
产品语言选择Simplified Chinese,选项Install database Software only.
链接过程报ins_emdb.mk错误则选择Continue忽略
根据提示,执行如下脚本
/opt/oracle/oraInventory/orainstRoot.sh
/opt/oracle/product/10201/root.sh
安装完成后退出,执行/opt/oracle/product/10201/bin/relink all
14.执行id,查看oracle用户组的id信息
uid=501(oracle) gid=501(oinstall) 组=501(oinstall),502(dba) 环境=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
将dba组添加到系统内核中(否则在dbca时会有共享内存错误),root用户执行echo 501 > /proc/sys/vm/hugetlb_shm_group
15.oracle用户执行dbca建库,指定ORACLE_SID(与环境变量设置的一致),数据库字符集选择ZHS16GBK*,最后Finish、OK
漫长的等待过程,直到创建过程结束,执行netca配置监听
16.开机启动服务,编辑/etc/rc.d/rc.local,在其后追加如下内容
echo 501 > /proc/sys/vm/hugetlb_shm_group
su - oracle -c "/usr/local/oracle/product/10201/bin/lsnrctl start"
su - oracle -c "/usr/local/oracle/product/10201/bin/dbstart start"
#su - oracle -c "isqlplusctl start"
#su - oracle -c "emctl start dbconsole
编辑/etc/oratab内容:orcl:/usr/local/oracle/product/10201:Y