安装oracle
添加用户组
[root@bogon ~]# groupadd oinstall
[root@bogon ~]# groupadd dba
[root@bogon ~]# groupadd oper
添加oracle用户
[root@bogon ~]# useradd -g oinstall -G dba,oper oracle
[root@bogon ~]# passwd oracle
修改文件/etc/sysctl.conf,添加如下内容
kernel.shmmni = 4096
kernel.shmmax = 4398046511104
kernel.shmall = 1073741824
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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 = 1048586
使sysctl.conf修改生效,执行命令
[root@bogon ~]# sysctl -p
修改文件/etc/security/limits.conf,添加如下内容
oracle soft nproc 131072
oracle hard nproc 131072
oracle soft nofile 131072
oracle hard nofile 131072
oracle soft core unlimited
oracle hard core unlimited
oracle soft memlock 50000000
oracle hard memlock 50000000
修改文件/etc/hosts配置server的全限定名称,添加如下内容(如果已经存在则无需重复添加)
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
验证配置的全限定名称是否有效
[root@bogon ~]# ping -c 1 localhost
修改文件/home/oracle/.bash_profile,添加如下内容
# Oracle Settings
export TMP=/tmp
export ORACLE_HOSTNAME=localhost.localdomain
export ORACLE_UNQNAME=ORCL
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=ORCL
PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
alias cdob='cd $ORACLE_BASE'
alias cdoh='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'
alias envo='env | grep ORACLE'
umask 022
检查必须的包是否安装
[root@bogon ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils \
> elfutils-libelf \
> elfutils-libelf-devel \
> gcc \
> gcc-c++ \
> glibc \
> glibc-common \
> glibc-devel \
> glibc-headers \
> ksh \
> libaio \
> libaio-devel \
> libgcc \
> libstdc++ \
> libstdc++-devel \
> make \
> sysstat \
> unixODBC \
> unixODBC-devel
如下为检测结果
binutils-2.23.52.0.1-55.el7(x86_64)
elfutils-libelf-0.163-3.el7(x86_64)
package elfutils-libelf-devel is not installed
gcc-4.8.5-4.el7(x86_64)
package gcc-c++ is not installed
glibc-2.17-105.el7(x86_64)
glibc-common-2.17-105.el7(x86_64)
glibc-devel-2.17-105.el7(x86_64)
glibc-headers-2.17-105.el7(x86_64)
package ksh is not installed
libaio-0.3.109-13.el7(x86_64)
package libaio-devel is not installed
libgcc-4.8.5-4.el7(x86_64)
libstdc++-4.8.5-4.el7(x86_64)
package libstdc++-devel is not installed
make-3.82-21.el7(x86_64)
sysstat-10.1.5-7.el7(x86_64)
package unixODBC is not installed
package unixODBC-devel is not installed
执行命令,完成检测出的未安装包的安装
[root@bogon ~]# yum -y install elfutils-libelf-devel
[root@bogon ~]# yum -y install gcc-c++
[root@bogon ~]# yum -y install ksh
[root@bogon ~]# yum -y install libaio-devel
[root@bogon ~]# yum -y install libstdc++-devel
[root@bogon ~]# yum -y install unixODBC
[root@bogon ~]# yum -y install unixODBC-devel
创建oracle的home目录
[root@bogon ~]# mkdir -p /u01/app/oracle/product/11.2.0/db_1
为oracle的home目录授权
[root@bogon ~]# chown oracle:oinstall -R /u01
[root@bogon ~]# chmod 775 /u01
修改文件/etc/selinux/config,修改内容如下
SELINUX=permissive
执行如下命令并且重启服务器,以使以上修改全部生效
[root@bogon ~]# systemctl mask tmp.mount
[root@bogon ~]# reboot
以oracle用户登录,将oracle安装包拷入/home/oracle目录
解压oracle安装包
[oracle@bogon ~]$ unzip linux.x64_11gR2_database_1of2.zip
[oracle@bogon ~]$ unzip linux.x64_11gR2_database_2of2.zip
进入解压出的database目录,执行安装
[oracle@bogon database]$ ./runInstaller
安装第一步出现[INS-06101] IP address of localhost could not be determined错误
取消安装
查看文件/etc/sysconfig/network内容,如果内容为空可暂时不用修改,如果不为空则需修改HOSTNAME项
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
切换到root用户设置主机名
[root@bogon database]# hostnamectl set-hostname localhost.localdomain
退出当前命令窗口,重新打开一个命令窗口
执行oracle安装
[oracle@localhost database]$ ./runInstaller
剩下的就按oracle安装界面提示,一路next下去,第一步直接跳过,之后在最后一步通常情况下会出现两个错误,直接忽略
来源:CSDN
作者:chenlongjs
链接:https://blog.csdn.net/chenlongjs/article/details/104607135