• oracle中xhost报错


    一.命令找不到

    xhost:command not found

    yum whatprovides "*/xhost"

    Loaded plugins: product-id, security, subscription-manager
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    base/filelists_db                                                               | 3.4 MB     00:00 ...
    xorg-x11-server-utils-7.7-2.el6.x86_64 : X.Org X11 X server utilities
    Repo        : base
    Matched from:
    Filename    : /usr/bin/xhost

    yum -y install xorg-x11-server-utils-7.7-2.el6.x86_64

    二.安装oracle11g时出现xhost:  unable to open display "192.168.1.10:0.0"、打不开图形化界面等。

    终极解决方法:
    1.使用Xmanager中xshell登陆到要安装oracle服务的主机上的root用户;

    2.关键的第一步:设置DISPLAY环境变量为登陆机器的IP地址(注意:这里你本机windows的IP地址,即你的xmanager的安装主机,我本机的IP是10.10.11.16);
    # export DISPLAY=10.10.11.16:0.0
    # echo $DISPLAY
    10.10.11.16:0.0

    注意:这块是0.0还是1.0查看xmanage左上角就可以看到,这里点击Xmanager - Broadcast

    使用“xhost +”命令;
    # xhost +
    access control disabled, clients can connect from any host

    4.切换到oracle用户;
    # su - oracle

    5.关键的二步:在oracle用户再一次设置DISPLAY环境变量为登陆机器的IP地址;
    如果不操作这一步骤,su到oracle用户后这个环境变量可能会丢失——郁闷之所在。
    $ export DISPLAY=10.10.11.16:0.0
    $ echo $DISPLAY
    10.10.11.16:0.0

    6.另外两个关键注意事项;

    a.用root用户登录修改
    在 /etc/inittab -- init进程的主配置文件 把默认级别改為 5 :   

     id:5:initdefault:    #意思是从图形界面启动
    b.设置连接属性

     

    打开的图形化界面是乱码

     export LANG=en_US.UTF-8 切记使用oracle用户,先执行这个,在执行./runInstaller

    还有一种方法:

    使用vnc远程安装工具

    vnc配置

    1.安装vnc
    yum install vnc-server
    2.启动vnc
    注意这里需要ps -ef |grep vncserver

    vncserver

    在root用户下启动,我们采用默认配置即可。
    vncserver :1
    会提示输入密码
    3.通过vnc客户端连接l
    vnc连接后打开终端,需要先设置DISPLAY
    export DISPLAY=:1.0
    注意:我们启动的vncserver是:1,因此我们定义DISPLAY时也需要设置成1.0,执行xhost + :
    [root@localhsot ~]# xhost +
    access control disabled, clients can connect from any host
    否则启动xhost + 会报错:
    [root@localhsot ~]# xhost +
    xhost: unable to open display ":0.0"
    4.vnc中安装oracle 11g
    [root@localhsot ~]# xhost +
    access control disabled, clients can connect from any host
    [root@localhsot ~]# su - oracle
    [oracle@localhsot ~]# cd /oracle11g/database
    [oracle@localhsot ~]# ./runInstaller
    执行完命令后会在vnc中打开安装界面,否则安装界面会打开在服务器本机上。

    ,在使用VNC远程安装时提示以下错误:
    >>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.    Failed <<<<
    解决办法,检查是否设置了DISPLAY变量:
    1.在root下执行#xdpyinfo,记录下name of display:后的字符串,如  :39
    2.在root下执行 #xhost +
    返回信息为: access control disabled,clients canconnect from any host
    3.切换到Oracle用户:#su – oracle
    4.在Oracle用户下执行命令:export DISPLAY=:39
    5.在Oracle下执行xdpyinfo命令,如果能正常显示,说明设置成功
    重新安装即可。

  • 相关阅读:
    django创建项目,一个简单的登录。
    MySQL下载与安装
    查看拉去代码时候的git账号密码
    Springmvc-组件
    转发与重定向
    springMVC-常用注解
    springMVC-请求参数绑定
    SpringMVC-RequestMapping注解
    JAVA-异常处理
    springMVC-入门案例
  • 原文地址:https://www.cnblogs.com/fengzhongzhuzu/p/9947049.html
Copyright © 2020-2023  润新知