redhat6.5安装Oracle11gR2

   

1 安装依赖

# yum install  binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libXext libX11 libXau libxcb libXi make sysstat libaio-devel  -y
# yum install libaio.i686 libaio-devel.i686 compat-libstdc++-33.i686 elfutils-libelf-devel.i686 glibc.i686 glibc-devel.i686 libgcc.i686  libstdc++.i686  unixODBC.i686 unixODBC-devel.i686 libaio-devel.x86_64 unixODBC.x86_64 libXext.i686 -y

2 创建组并指定用户所属组

# groupadd -g 1000 oinstall 
# groupadd -g 1001 dba
# useradd -u 1101 -g oinstall -G dba oracle
# passwd oracle
#  id oracle 
uid=1101(oracle) gid=1000(oinstall)  groups=1000(oinstall),1001(dba)

3 修改内核参数

vi /etc/sysctl.conf 
...
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144      #注意此项已存在
net.core.wmem_max = 1048576      #注意此项已存在
# /sbin/sysctl -p 

4 修改文件描述符

# vi /etc/security/limits.conf 
...
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768

5 配置oracle环境

# mkdir -p /u01/app/oracle
# chown -R oracle:oinstall /u01
# su - oracle
$ vi .bash_profile 
...
export ORACLE_BASE=/u01/app/oracle   
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 
ORACLE_SID=test
export PATH=$ORACLE_HOME/bin:$PATH$ ORACLE_HOME/bin:$PATH
$ source .bash_profile
$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1

6 域名解析

ifconfig 查看ip192.168.198.134
hostname 主机名 localhost.localdomain
# vi /etc/hosts 
...
192.168.198.134 localhost.localdomain

7 关闭SElinux、防火墙

# setenforce 0
# vi /etc/selinux/config
SELINUX=disable 
# /etc/init.d/iptables stop
# chkconfig iptables off

8 安装oracle

# unzip linux.x64_11gR2_database_1of2.zip
# unzip linux.x64_11gR2_database_2of2.zip
# su - oracle
$ export LANG=en_US.UTF-8
$ ./runInstaller

9 配置监听

# netca

10 创建数据库

# dbca

11 测试数据库

在oracle用户下执行命令sqlplus / as sysdba,测试Oracle的安装输入startup

发表评论