Red Hat Enterprise Linux 7.4上安装Oracle 11.2.0.4

版权声明:版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sandy9919/article/details/84313250

1.配置Yum源

[root@localhost ~]# mount /dev/cdrom /mnt
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# vi /etc/yum.repos.d/iso.repo

[rhel-base]
name=rhel-base
baseurl=file:///mnt
enabled=1
gpgcheck=0

2.关闭selinux

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

3.安装桌面环境(可选)

[root@localhost ~]# yum -y group install "Server with GUI"

4.安装软件包

[root@localhost ~]# yum -y install binutils binutils-devel compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 ksh elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 make sysstat unixODBC unixODBC-devel libXp libXp-devel libXpm-devel telnet

注:compat-libstdc++-33不在RHEL 7.4的iso中,需要单独下载compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

5.建立用户

[root@localhost ~]# groupadd oinstall 
[root@localhost ~]# groupadd dba 
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# passwd oracle
[root@localhost ~]# 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
        umask 022
fi

6.建立文件夹

[root@localhost ~]# mkdir -p /app/oracle/product/11.2.4/db_1/
[root@localhost ~]# chown -R oracle:oinstall /app/oracle/product/11.2.4/db_1/
[root@localhost ~]# chmod -R 755 /app/oracle/product/11.2.4/db_1/

7. 配置系统核心参数,Oracle用户资源限制,Oracle用户环境变量

[root@localhost ~]# MEMTOTAL=$(free -b | sed -n '2p' | awk '{print $2}') 
[root@localhost ~]# SHMMAX=$(expr $MEMTOTAL / 2)
[root@localhost ~]# SHMMNI=4096
[root@localhost ~]# PAGESIZE=$(getconf PAGE_SIZE)
[root@localhost ~]# cat >> /etc/sysctl.conf << EOF
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = $SHMMAX
kernel.shmall = $(expr \( $SHMMAX / $PAGESIZE \) \* \( $SHMMNI / 16 \))
kernel.shmmni = $SHMMNI
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
EOF
[root@localhost ~]# sysctl -p
[root@localhost ~]# vi /etc/security/limits.conf
# add to the end
oracle  soft  nproc   2047
oracle  hard  nproc   16384
oracle  soft  nofile  1024
oracle  hard  nofile  65536
oracle  soft  stack   10240
oracle  hard  stack   32768
[root@localhost ~]# vi /home/oracle/.bash_profile
# add to the end
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.4/db_1; export ORACLE_HOME
ORACLE_SID=lmisdbdg; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_UNQNAME=lmisdbdg; export ORACLE_UNQNAME
EM_AGENT_HOME=/oradata/middleware/em_agent; export EM_AGENT_HOME
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG


alias sqlplus='rlwrap sqlplus'
#alias target='rlwrap target'
alias rman='rlwrap rman'
#alias alert='cd /oracle/u01/app/oracle/diag/rdbms/lmis/lmis1/trace'
alias alert='cd /app/oracle/diag/rdbms/lmisdbdg/lmisdbdg/trace'
export DIAG=/app/oracle/diag/rdbms/lmisdbdg/lmisdbdg/trace

8.编辑主机名

[root@localhost ~]# vi /etc/hosts
# add
192.168.10.11 oracle
[root@localhost ~]# vi /etc/hostname
# modify
oracle
[root@localhost ~]# vi /etc/sysconfig/network

9.解压安装文件

[root@localhost ~]# cd /app
[root@localhost app]# unzip p13390677_112040_Linux-x86-64_1of7.zip ;unzip p13390677_112040_Linux-x86-64_2of7.zip

10.安装软件

[oracle@localhost ~]$ cd $ORACLE_HOME/sysman/lib

[oracle@localhost lib]$ cp ins_emagent.mk ins_emagent.mk.bak

[oracle@localhost lib]$ vi ins_emagent.mk
 查找$(MK_EMAGENT_NMECTL)
 更改为$(MK_EMAGENT_NMECTL) -lnnz11
[root@localhost rhel]# xhost +
access control disabled, clients can connect from any host
[root@localhost rhel]# su - oracle
[oracle@localhost ~]$ export DISPLAY=10.10.110.110:0.0  #此处IP请改为客户端的IP
[oracle@localhost ~]$ cd /app/database/
[oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 27148 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 20479 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-11-20_03-34-57PM. Please wait ...[oracle@lmisdb02 database]$ You can find the log of this install session at:
 /app/oraInventory/logs/installActions2018-11-20_03-34-57PM.log

11.图形安装界面,一路next即可

12.执行两个root脚本即完成安装

猜你喜欢

转载自blog.csdn.net/sandy9919/article/details/84313250