CentOS 6安装Oracle 11gR2数据库
1. 安装前准备
[1] 安装软件包
www.2cto.com
[root@localhost var]# yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel
gcc gcc-c++ libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel
安装软件包 pdksh-5.2.14-36.el5.i386.rpm (这个包yum源里没有,所以要手动安装,不装安装oracle时会有警告出现,但不影响最后的使用)
请
下载这个包上传到CentOS后使用如下命令安装。
[root@localhost public_root]# rpm -ivh pdksh-5.2.14-36.el5.i386.rpm
[2] 更改kernel参数
[root@localhost var]# vi /etc/sysctl.conf
www.2cto.com
# Disable netfilter on bridges.
#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0
# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536
# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 4294967295
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 268435456
# 在文件末尾添加
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 6815744 www.2cto.com
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576
执行以下命令使更改生效
[root@localhost var]# sysctl -p
[3] 创建安装oracle所需用户与用户组
[root@localhost var]# groupadd -g 200 oinstall
[root@localhost var]# groupadd -g 201 dba
[root@localhost var]# useradd -u 440 -g oinstall -G dba -d /usr/oracle oracle
[root@localhost var]# passwd oracle
[root@localhost var]# vi /etc/pam.d/login
#%PAM-1.0 www.2cto.com
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open
session required pam_namespace.so
session required pam_limits.so
session optional pam_keyinit.so force revoke
session include system-auth
-session optional pam_ck_connector.so
[root@localhost var]# vi /etc/security/limits.conf
www.2cto.com
# 在文件末尾添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@localhost var]# vi /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
[4] 切换到oracle用户,并进行配置
www.2cto.com
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ chmod 755 /usr/oracle
[oracle@localhost ~]$ mkdir /usr/oracle/app
[oracle@localhost ~]$ chmod 755 /usr/oracle/app/
[oracle@localhost ~]$ mkdir /usr/oracle/oradata
[oracle@localhost ~]$ chmod 755 /usr/oracl