Centos 6.7 x64安装Oracle 11G R2 x64 (二)

本教材分一、二、三、三章:



设置操作系统

[root@oracle ~]# vi /etc/redhat-release
Red Hat Enterprise Linux 6


设置主机名

[root@oracle ~]# vi /etc/sysconfig/network
HOSTNAME=oracle


设置Hosts文件

[root@oracle ~]# vi /etc/hosts
172.21.35.10    oracle


关闭Selinux

[root@oracle ~]# vi /etc/selinux/config
SELINUX=disabled


创建用户和组

[root@oracle ~]# groupadd oinstall
[root@oracle ~]# groupadd dba
[root@oracle ~]# useradd -g oinstall -G dba oracle
[root@oracle ~]# passwd oracle oracle用户密码 


修改内核参数

[root@oracle ~]# vi /etc/sysctl.conf
fs.file-max = 6815744 
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 
net.ipv4.ip_local_port_range = 9000 65500
fs.aio-max-nr = 1048576
[root@oracle ~]# sysctl -p


修改系统资源限制

[root@oracle ~]# vi /etc/security/limits.conf
oracle  soft  nproc 2047
oracle  hard  nproc 16384
oracle  soft  nofile  1024
oracle  hard  nofile  65536
#oracle  soft  stack   10240




修改登陆配置文件
在pam_namespace.so下添加下列行

[root@oracle ~]# vi /etc/pam.d/login
session    required     /lib64/security/pam_limits.so


修改环境变量

[root@oracle ~]# 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


创建本地源
此处可使用公共源

[root@oracle ~]# mkdir /images
[root@oracle ~]# mkdir /dvd 复制DVD1中的文件 [root@oracle ~]# mount /dev/cdrom /images
[root@oracle ~]# cp -R /images/* /dvd
[root@oracle ~]# umount /images 复制DVD2中的文件 [root@oracle ~]# mount /dev/cdrom /images
[root@oracle ~]# cp -R /images/Packages/* /dvd/Packages/
[root@oracle ~]# umount /images
[root@oracle ~]# rm -rf /etc/yum.repos.d/CentOS-*
[root@oracle ~]# vi /etc/yum.repos.d/local.repo
[local]
name=local
baseurl=file:///dvd
enabled=1
gpgcheck=0
[root@oracle ~]# yum makecache


安装依赖包

[root@oracle ~]# yum install \
compat-libcap1-1.10-1.x86_64 \
compat-libcap1-1.10-1.i686 \
compat-libstdc++-33-3.2.3-69.el6.x86_64 \
compat-libstdc++-33-3.2.3-69.el6.i686 \
compat-libstdc++-296.i686 \
gcc-4.4.7-16.el6.x86_64 \
gcc-c++-4.4.7-16.el6.x86_64 \
libstdc++-devel-4.4.7-16.el6.x86_64 \
libstdc++-devel-4.4.7-16.el6.i686 \
libaio-devel-0.3.107-10.el6.x86_64 \
libaio-devel-0.3.107-10.el6.i686 \
unixODBC-2.2.14-14.el6.x86_64 \
unixODBC-2.2.14-14.el6.i686 \
unixODBC-devel-2.2.14-14.el6.x86_64 \
unixODBC-devel-2.2.14-14.el6.i686 \
unixODBC-kde-2.2.14-14.el6.i686 \
binutils-2.20.51.0.2-5.43.el6.x86_64 \
elfutils-libelf-devel-0.161-3.el6.x86_64 \
glibc-devel-2.12-1.166.el6.i686 \
glibc-2.12-1.166.el6.i686 \
glibc-static-2.12-1.166.el6.i686 \
glibc-2.12-1.166.el6.x86_64 \
glibc-devel-2.12-1.166.el6.x86_64 \
libgcc-4.4.7-16.el6.x86_64 \
libgcc-4.4.7-16.el6.i686 \
libstdc++-4.4.7-16.el6.x86_64 \
libstdc++-4.4.7-16.el6.i686 \
libstdc++-devel-4.4.7-16.el6.x86_64 \
libstdc++-devel-4.4.7-16.el6.i686 \
libaio-0.3.107-10.el6.x86_64 \
libaio-0.3.107-10.el6.i686 \
libaio-devel-0.3.107-10.el6.x86_64 \
libaio-devel-0.3.107-10.el6.i686 \
make-3.81-20.el6.x86_64 \
sysstat-9.0.4-27.el6.x86_64 \
libXp-1.0.2-2.1.el6.x86_64 \
numactl-devel-2.0.9-2.el6.x86_64 \
libXau-1.0.6-4.el6.x86_64 \
libXau-1.0.6-4.el6.i686 \
libxcb-1.9.1-3.el6.x86_64 \
libxcb-1.9.1-3.el6.i686 \
libX11-1.6.0-6.el6.x86_64 \
libX11-1.6.0-6.el6.i686 \
libXext-1.3.2-2.1.el6.x86_64 \
libXext-1.3.2-2.1.el6.i686 \
unzip-6.0-2.el6_6.x86_64 \
lrzsz-0.12.20-27.1.el6.x86_64 \
vim-enhanced-7.4.629-5.el6.x86_64 \
wget-1.12-5.el6_6.1.x86_64
[root@oracle ~]# wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm
[root@oracle ~]# rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm


安装桌面环境

[root@oracle ~]# yum groupinstall "Desktop"
[root@oracle ~]# yum groupinstall "Desktop Platform"
[root@oracle ~]# yum groupinstall "X Window System"
[root@oracle ~]# yum groupinstall "桌面"
[root@oracle ~]# yum groupinstall "桌面平台"
[root@oracle ~]# yum groupinstall "X 窗口系统"


创建安装目录及设置权限

[root@oracle ~]# su - oracle
[oracle@oracle ~]$ mkdir ~/app
[oracle@oracle ~]$ mkdir ~/oradata
[oracle@oracle ~]$ chmod 775 /home/oracle/app


设置oracle环境变量

[oracle@oracle ~]$ vi ~/.bash_profile
unset USERNAME
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=/home/oracle/app/product/11.2.0/dbhome_1
export PATH=/home/oracle/app/product/11.2.0/dbhome_1/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin
export LANG=en
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export LD_LIBRARY_PATH=/home/oracle/app/product/11.2.0/dbhome_1/lib:/usr/lib
export ORACLE_HOME_LISTNER=$ORACLE_HOME
umask 022
export DISPLAY=:0.0
[oracle@oracle ~]$ source ~/.bash_profile


下载并解压Oracle 11g R2:
下载地址:Oracle Database Software Downloads

[oracle@oracle ~]$ unzip linux.x64_11gR2_database_1of2.zip
[oracle@oracle ~]$ unzip linux.x64_11gR2_database_2of2.zip


登录图形界面

[root@oracle ~]# init 5

安装Oracle

[root@oracle ~]# xhost +
[root@oracle ~]# su - oracle
[oracle@oracle ~]$ cd database/
[oracle@oracle database]$ ./runInstaller


Top