CentOS 6.2 安装oracle 11G R2

1.安装相关的开发工具包
#yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ 
#yum -y install libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel 
#rpm -e ksh
#rpm -ivh pdksh-5.2.14-36.e15.x86_64.rpm
#yum -y install java

2.修改内核参数
# vi /etc/sysctl.conf    # 最后添加如下内容
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 10523004
#shmmax为物理内存的一半或4G=4294967296
kernel.shmmax = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576

#sysctl -p

#vi /etc/pam.d/login
session    required     pam_limits.so

# vi /etc/security/limits.conf  # add at the last line
oracle   soft   nproc   2047
oracle   hard   nproc   16384
oracle   soft   nofile   1024
oracle   hard   nofile   65536

3.添加用户及组
#groupadd oinstall
#groupadd dba
#useradd -g oinstall -G dba oracle
#passwd oracle
#mkdir /u01/oracle
#chown -R oracle.oinstall /u01/oracle/
#chmod -R 775 /u01/oracle/ 

#vi ~oracle/.bash_profile
umask 022
export ORACLE_BASE=/u01/oracle
export ORACLE_SID=orcl
export DISPLAY=:0.0
export LANG=en_US.UTF-8

4.修改环境变量与建立目录
# vi /etc/profile
# add at the last line
if [ $USER = "oracle" ]; then
      if [ $SHELL = "/bin/ksh" ]; then
           ulimit -p 16384
           ulimit -n 65536
      else
           ulimit -u 16384 -n 65536
      fi
fi

安装图形环境
#yum -y groupinstall "X Window System"
#yum -y groupinstall "Desktop"
#yum -y groupinstall "Chinese Support"
#init 5

5.解压缩zip文件以及安装
[oracle@db1 ~]#cd /u01/
[oracle@db1 ~]#cd /opt/database/
[oracle@db1 ~]cd /opt/database/
[oracle@db1 database]./runInstaller
图形安装过程省略... ...

切换root执行脚本
#/u01/oracle/oraInventory/orainstRoot.sh
#/u01/oracle/product/11.2.0/dbhome_1/root.sh

#vi /etc/profile     #在最后添加
export ORACEL_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACEL_OWNER=oracle
export ORACEL_SID=orcl
export ORACEL_TERM=xterm
export PATH=$PATH:$ORACLE_HOME/bin

#source /etc/profile 

#vi /etc/oratab
orcl:/u01/oracle/product/11.2.0/dbhome_1:Y

10.登录测试:

在浏览器上输入:
https://xx.xx.xx.xx:1158/em/
或者sqlplus /nolog
SQL> connect sys as sysdba
Enter password:
Connected.

猜你喜欢

转载自junier.iteye.com/blog/2102712