CentOS7 安装oracle12c

1.VMware下安装centos,空间分配60G,步骤忽略

2.官网下载下载oracle

https://www.oracle.com

https://www.oracle.com/cn/technical-resources/

https://www.oracle.com/cn/downloads/#category-database

我下载的版本是:  Oracle Database 12c Release 2

目前官网已经无法下载12c,可以在查找和下载到旧版本:

https://edelivery.oracle.com/

3.把下载下来的oracle安装文件linuxx64_12201_database.zip传到centos上。放在了/oracle路径下

4.root用户安装依赖包:

yum install gcc gcc-c++ ksh libaio-devel libstdc++-devel compat-libstdc++-33 compat-libcap1 -y

5.创建用户oracle(我在安装centos的时候创建的)

useradd oracle

passwd oracle

6.解压oracle安装文件linuxx64_12201_database.zip

unzip linuxx64_12201_database.zip

7. su - oracle,  然后cd /oracle/database下,执行数据库安装命令文件:

./runInstaller

发现不显示安装oracle的图形化界面,并报错:

>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.    Failed <<<<

处理方法:

首先需要安装的是xhost,如果执行xhost显示找不到该命令,

1.查找该命令是由哪个包提供

yum whatprovides "*/xhost"

2.根据返回的结果,安装对应的包

我的显示是:

xorg-x11-server-utils-7.7-20.el7.x86_64 : X.Org X11 X server utilities
Repo        : base
Matched from:
Filename    : /usr/bin/xhost

检查该包是否已经安装:   rpm -qa|grep xorg-x11-server-utils-7.7-20.el7.x86_64

显示已经存在,不需要再安装了。  如果没有安装,需要安装, root用户执行下面命令来安装其依赖包:

yum install xorg-x11-server-utils-7.7-20.el7.x86_64

 

3.只有xhost还不行,运行xhost +还是会报错, 同样方法检查tigervnc tigervnc-server是否安装,(我的没有安装)。

如果没有,运行如下命令安装vnc:

yum install tigervnc tigervnc-server

启动并配置vnc:

vncserver    

如下:

[root@localhost ~]# vncserver

You will require a password to access your desktops.
Password:          --(我给了oraclepass)
Verify:
Would you like to enter a view-only password (y/n)?
A view-only password is not used
xauth:  file /root/.Xauthority does not exist

New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1

Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log

再次执行vncserver 命令查看结果:

[root@localhost ~]# vncserver

New 'localhost.localdomain:2 (root)' desktop is localhost.localdomain:2

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:2.log

#2是vnc启动时给的标识,表示在哪个tty上连接(每执行一次都会加1)

4. 用root执行:

export  DISPLAY=localhost.localdomain:2  #从上面的vncserver 命令结果中取,(主机名也可以换成IP: 127.0.0.1)

$xhost +

access control disabled, clients can connect from any host

切换到oracle用户,执行同样的两条命令:

export  DISPLAY=localhost.localdomain:2 

$xhost +

access control disabled,clients can connect from any host

再次执行安装,发现没有报错,但是不出先图形化界面:

[oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 26744 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 1977 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-06-16_04-58-05AM. Please wait ...[oracle@localhost database]$ 

百思不得其解,忽然发现了一个致命的问题: 我用的SecureCRT客户端,不支持图形化界面,然后直接在VMware的主机中执行就可以出来界面了。(或者在xshell中也可以直接出来?没有试)

安装界面出来之后,基本就是参照这两个博客进行的安装:

https://www.cnblogs.com/Dev0ps/p/8796728.html

https://www.cnblogs.com/clsn/archive/2017/11/11/7819591.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值