虚拟机redHat linux7.4安装oracle12c

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

下载Linux7.4

链接:https://pan.baidu.com/s/10cIURSUxKNYzVBPA1fQVBg
提取码:vx9l

前提工作:

//下载oracle需要的依赖包
[su1573@linux ~]$ cat /proc/version    //查看系统版本
[su1573@linux ~]$ yum -y install gcc gcc-c++ make binutils compat-libstdc++-33 glibc glbic-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel unixODBC-devel sysstat ksh unzip compat-libcap*
//添加账号和用户组
[root@linux su1573]# mkdir -p /u01/app/oracle/product/12.1.0/db_1
[root@linux su1573]# groupadd dba
[root@linux su1573]# groupadd oinstall
[root@linux su1573]# tail -5 /etc/group
stapdev:x:158:
tcpdump:x:72:
su1573:x:1000:su1573
dba:x:1001:
oinstall:x:1002:
[root@linux su1573]# useradd -g dba -G oinstall oracle
[root@linux su1573]# id oracle
uid=1001(oracle) gid=1001(dba) 组=1001(dba),1002(oinstall)
[root@linux su1573]# chown -R oracle:oinstall /u01
//创建文件存储目录
[root@linux /]# mkdir -p /soft/oracledata
[root@linux /]# cd /soft/oracledata/
//输入rz打开上传窗口,上传文件
[root@linux oracledata]# rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring linuxx64_12201_database.zip...
  100% 3372750 KB    7717 KB/sec    00:07:17       0 Errors
//配置环境变量
[root@linux ~]# vim /home/oracle/.bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=oaec
export PATH=$ORACLE_HOME/bin:$PATH

~
~
"/home/oracle/.bash_profile" 15L, 326C 已写入 


[root@linux ~]# vim /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).

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

~
~
"/etc/sysctl.conf" 32L, 769C 已写入 

[root@linux ~]# /sbin/sysctl -p
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
//把下面的添加文档末尾
[root@linux ~]# vim /etc/security/limits.conf 
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
~
~
"/etc/security/limits.conf" 69L, 2545C 已写入 
//把下面的添加文档末尾
[root@linux ~]# vim /etc/pam.d/login

session required pam_limits.so

~
~
"/etc/pam.d/login" 20L, 828C 已写入



[root@linux ~]# vim /etc/profile
unset -f pathmunge
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
"/etc/profile" 87L, 1971C 已写入
//切换到oracle进行解压
[root@linux oracledata]# su - oracle
[oracle@linux ~]$ ls /soft/oracledata/
linuxx64_12201_database.zip
[oracle@linux ~]$ unzip /soft/oracledata/linuxx64_12201_database.zip 
[oracle@linux ~]$ ls
database
[oracle@linux ~]$ cd database/
[oracle@linux database]$ ls
install  response  rpm  runInstaller  sshsetup  stage  welcome.html
//进行安装,但是颜色检查未通过,然后解决
[oracle@linux database]$ ./runInstaller 
正在启动 Oracle Universal Installer...

检查临时空间: 必须大于 500 MB。   实际为 5531 MB    通过
检查交换空间: 必须大于 150 MB。   实际为 2047 MB    通过
检查监视器: 监视器配置至少必须显示 256 种颜色
    >>> 无法使用命令 /usr/bin/xdpyinfo 自动检查显示器颜色。请检查是否设置了 DISPLAY 变量。    未通过 <<<<

未通过某些要求检查。必须先满足这些 要求, 

然后才能继续安装,

是否继续? (y/n) [n] n

用户选择: 否

退出 Oracle Universal Installer, 您可以在 /tmp/OraInstall2019-02-11_10-47-17AM/installActions2019-02-11_10-47-17AM.log 中找到本次会话的日志

//解决颜色未通过问题:

1、切换到root用户
[root@linux ~]# DISPLAY=:0.0;export DISPLAY
[root@linux ~]# echo $DISPLAY
:0.0
[root@linux ~]# cd /usr/bin/
[root@linux bin]# ./xhost
access control enabled, only authorized clients can connect
SI:localuser:root
SI:localuser:su1573
[root@linux bin]# ./xhost +
access control disabled, clients can connect from any host
2、切换到oracle用户
[oracle@linux ~]$ DISPLAY=:0.0;export DISPLAY
[oracle@linux ~]$ echo $DISPLAY
:0.0
[oracle@linux ~]$ 
//解决完后,进行安装
[oracle@linux ~]$ cd database/
[oracle@linux database]$ ./runInstaller 
正在启动 Oracle Universal Installer...

检查临时空间: 必须大于 500 MB。   实际为 5531 MB    通过
检查交换空间: 必须大于 150 MB。   实际为 2047 MB    通过
检查监视器: 监视器配置至少必须显示 256 种颜色。    实际为 16777216    通过
准备从以下地址启动 Oracle Universal Installer /tmp/OraInstall2019-02-11_10-52-36AM. 请稍候...

接下来,安装界面就会出现在虚拟机linux系统桌面,后面的操作基本和windows中安装一样


anthor:su1573

猜你喜欢

转载自blog.csdn.net/su1573/article/details/87933433