CentOS 7.7 1908 最小化 通过 VNC 安装 Oracle 11.2.0.4.0

  1. 创建 Oracle 用户及组、授权文件夹:
    创建组、用户并添加到组:
    /usr/sbin/groupadd oinstall
    /usr/sbin/groupadd dba
    /usr/sbin/useradd -g oinstall -G dba oracle
    
    修改用户密码:
    passwd oracle
    创建文件夹并授权:
    mkdir -p /u01/app
    chown -R oracle:oinstall /u01/app
    chmod -R 775 /u01/app/
  2. 修改 /etc/yum.conf,将缓存 yum 安装文件:
    缓存 yum 安装文件可用于离线安装。
    vi /etc/yum.conf
    将 keepcache 设置为 1
    keepcache=1
  3. 安装 vim、wget:
    yum -y install vim
  4. 安装 CentOS 可视化桌面:
    yum -y groups install 'GNOME Desktop'
  5. 设置默认开机为可视化桌面:
    systemctl set-default graphical.target
    关闭默认开机可视化桌面(设置开机为命令桌面):
    systemctl set-default multi-user.target
  6. 开启可视化桌面:
    关闭命令后将关闭可视化桌面:
    startx
    后台运行可视化桌面:
    systemctl start graphical.target
  7. 安装 VNC:
    yum -y install tigervnc-server
  8. 启动VNC并设置密码:
    1. 设置 root 用户的 VNC 密码:
      登陆 root:
      未设置只读密码:
      [root@localhost ~]# vncserver
      
      You will require a password to access your desktops.
      
      Password:
      Verify:
      Would you like to enter a view-only password (y/n)? n
      A view-only password is not used
      
      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
      
      [root@localhost ~]# 
    2. 设置 oracle 用户的 VNC 密码:
      登陆 oracle:
      未设置只读密码:
      [root@localhost ~]# su oracle
      [oracle@localhost root]$ vncserver
      
      You will require a password to access your desktops.
      
      Password:
      Verify:
      Would you like to enter a view-only password (y/n)? n
      A view-only password is not used
      xauth:  file /home/oracle/.Xauthority does not exist
      
      New 'localhost.localdomain:2 (oracle)' desktop is localhost.localdomain:2
      
      Creating default startup script /home/oracle/.vnc/xstartup
      Creating default config /home/oracle/.vnc/config
      Starting applications specified in /home/oracle/.vnc/xstartup
      Log file is /home/oracle/.vnc/localhost.localdomain:2.log
      
      [oracle@localhost root]$ 
      
  9. 创建窗口 1、2 的开机启动:
    窗口 1 可用于连接 root 桌面;
    窗口 2 可用于连接 oracle 桌面。
    cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
    cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:2.service
  10. 修改窗口 1、2 的开机启动:
    将 vncserver@:1.service 中的 <USER> 修改为 root:
    vim /etc/systemd/system/vncserver@:1.service
    将 vncserver@:1.service 中的 <USER> 修改为 oracle:
    vim /etc/systemd/system/vncserver@:2.service
  11. 设置窗口 1、2 的开机启动:
    systemctl enable vncserver@:1.service
    
    systemctl enable vncserver@:2.service
  12. 开启窗口 1、2:
    systemctl start vncserver@:1.service
    

     

    systemctl start vncserver@:2.service

    停止窗口:

    vncserver -kill :1

    开启窗口:

    vncserver :1

    修改VNC密码:

    vncpasswd

    临时修改分辨率:

    vncserver -geometry 1920x1080

    永久修改分辨率:
    找到配置文件:

    [root@centos79 ~]# which vncserver
    /usr/bin/vncserver

    修改配置文件:

    vim /usr/bin/vncserver

    修改结果:

    $geometry = "1920x1080";

     

  13. 开启5900+?端口:
    开启窗口 1,开放端口5901(即5900+1):
    开启窗口 2,开放端口5902(即5900+2):
    开启端口 5901、5902(需要开启防火墙):
    firewall-cmd --zone=public --add-port=5901/tcp --permanent
    firewall-cmd --zone=public --add-port=5902/tcp --permanent
  14. 重新加载防火墙:
    firewall-cmd --reload
  15. 查看已开放端口及服务:
    firewall-cmd --list-all
  16. 打开 VNC,输入地址:

     
  17. 点击回车,选择 continue:

     
  18. 输入密码,点击 OK:

     
  19. 连接成功后显示:

     
  20. 输入密码后登陆:

     
  21. 登陆后显示:
    设置语言:

     
  22. 桌面显示如下:

     
  23. 相同操作,可登陆 oracle 用户。
     
  24. 上传解压 Oracle 11.2.0.4.0 至 /u01 文件夹。
     
  25. 上传解压 jdk1.8 至 /u01 文件夹。
     
  26. 添加字体,防止安装过程乱码:
    mkdir -p /usr/share/fonts/zh_CN/TrueType
    cd /usr/share/fonts/zh_CN/TrueType
    上传 zysong.ttf 至文件夹 /usr/share/fonts/zh_CN/TrueType 并授权:
    chmod -R 75 zysong.ttf
  27. 使用 VNC 登陆 oracle 用户。
     
  28. 设置临时语言为中文并运行安装Oracle:
    [oracle@localhost ~]$ LANG=zh_CN.UTF-8
    [oracle@localhost ~]$ locale
    LANG=zh_CN.UTF-8
    LC_CTYPE="zh_CN.UTF-8"
    LC_NUMERIC="zh_CN.UTF-8"
    LC_TIME="zh_CN.UTF-8"
    LC_COLLATE="zh_CN.UTF-8"
    LC_MONETARY="zh_CN.UTF-8"
    LC_MESSAGES="zh_CN.UTF-8"
    LC_PAPER="zh_CN.UTF-8"
    LC_NAME="zh_CN.UTF-8"
    LC_ADDRESS="zh_CN.UTF-8"
    LC_TELEPHONE="zh_CN.UTF-8"
    LC_MEASUREMENT="zh_CN.UTF-8"
    LC_IDENTIFICATION="zh_CN.UTF-8"
    LC_ALL=
    [oracle@localhost ~]$ cd /u01/database/
    [oracle@localhost database]$ ./runInstaller -jreLoc /u01/jdk1.8.0_231/
    正在启动 Oracle Universal Installer...
    
    检查临时空间: 必须大于 120 MB。   实际为 27021 MB    通过
    检查交换空间: 必须大于 150 MB。   实际为 2039 MB    通过
    检查监视器: 监视器配置至少必须显示 256 种颜色。    实际为 16777216    通过
    准备从以下地址启动 Oracle Universal Installer /tmp/OraInstall2020-06-06_03-17-12PM. 请稍候...[oracle@localhost database]$ 
    
    
  29. 点击下一步:

     
  30. 点击是:

     
  31. 跳过软件更新,点下一步:

     
  32. 点击下一步:

     
  33. 选择服务器类,点下一步:

     
  34. 点击下一步:

     
  35. 选择高级安装,点下一步:

     
  36. 点击下一步:

     
  37. 点下一步:

     
  38. 点下一步:

     
  39. 点下一步:

     
  40. 点下一步:

     
  41. 点下一步:

     
  42. 点下一步:

     
  43. 点下一步:

     
  44. 点下一步:

     
  45. 启用自动备份,点下一步:

     
  46. 点下一步:

     
  47. 点下一步:

     
  48. 检查依赖的结果:

     
  49. 点击修补并再次检查:
    保存 /tmp/CVU_11.2.0.4.0_oracle 文件夹中的内容可用于静默安装。
  50. 使用 root 运行脚本:
    sh /tmp/CVU_11.2.0.4.0_oracle/runfixup.sh
    运行结果:
    [root@localhost TrueType]# sh /tmp/CVU_11.2.0.4.0_oracle/runfixup.sh 
    Response file being used is :/tmp/CVU_11.2.0.4.0_oracle/fixup.response
    Enable file being used is :/tmp/CVU_11.2.0.4.0_oracle/fixup.enable
    Log file location: /tmp/CVU_11.2.0.4.0_oracle/orarun.log
    Setting Kernel Parameters...
    /tmp/CVU_11.2.0.4.0_oracle/orarun.sh: line 246: [: 18446744073692774399: integer expression expected
    The value for shmmax in response file is not greater than value of shmmax for current session. Hence not changing it.
    The value for shmmni in response file is not greater than value of shmmni for current session. Hence not changing it.
    /tmp/CVU_11.2.0.4.0_oracle/orarun.sh: line 337: [: 18446744073692774399: integer expression expected
    The value for shmall in response file is not greater than value of shmall for current session. Hence not changing it.
    The value for semmsl in response file is not greater than value of semmsl for current session. Hence not changing it.
    The value for semmns in response file is not greater than value of semmns for current session. Hence not changing it.
    The value for semmni in response file is not greater than value of semmni for current session. Hence not changing it.
    kernel.sem = 250 32000 100 128
    fs.file-max = 6815744
    net.ipv4.ip_local_port_range = 9000 65500
    net.core.rmem_default = 262144
    net.core.wmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_max = 1048576
    The value for aio-max-nr in response file is not greater than value of aio-max-nr for current session. Hence not changing it.
    uid=1001(oracle) gid=1003(oper) groups=1003(oper),1002(dba)
    [root@localhost TrueType]# 
    
  51. 点确定:

     
  52. 再次检查结果:

     
  53. 安装依赖:
    yum -y install gcc libaio-devel elfutils-libelf-devel glibc-devel glibc-headers gcc-c++ libstdc++-devel
  54. 再次检查:

     
  55. 增加 1G 交换空间:
    dd if=/dev/zero of=/home/swap bs=4096 count=250000
    mkswap /home/swap
    /sbin/swapon /home/swap
    编辑 /etc/fstab :
    vim /etc/fstab
    增加:
    /home/swap swap swap default 0 0
  56. 再次检查:

     
  57. 阿里巴巴开源镜像站 下载依赖:compat-libstdc++、pdksh
    安装依赖:
    [root@localhost TrueType]# cd /u01
    [root@localhost u01]# rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm 
    warning: pdksh-5.2.14-37.el5_8.1.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID e8562897: NOKEY
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:pdksh-5.2.14-37.el5_8.1          ################################# [100%]
    [root@localhost u01]# rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm 
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:compat-libstdc++-33-3.2.3-72.el7 ################################# [100%]
    [root@localhost u01]# 
    
  58. 再次检查,依赖完全解决,自动进入下一个页面,点安装:
    保存此页面的响应文件,可用于静默安装。

     
  59. 安装过程遇见问题:

     
  60. 编辑文件 /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk:
    /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk

    修改:
    $(SYSMANBIN)emdctl:
            $(MK_EMAGENT_NMECTL)
    为:
    $(SYSMANBIN)emdctl:
            $(MK_EMAGENT_NMECTL) -lnnz11
  61. 点击重试即可继续。
     
  62. 安装结束,可在此页面解锁 SCOTT 账户:

     
  63. 使用 root 运行脚本:

     
    /u01/app/oraInventory/orainstRoot.sh
    /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
    运行结果:
    [root@localhost u01]# /u01/app/oraInventory/orainstRoot.sh
    更改权限/u01/app/oraInventory.
    添加组的读取和写入权限。
    删除全局的读取, 写入和执行权限。
    
    更改组名/u01/app/oraInventory 到 dba.
    脚本的执行已完成。
    [root@localhost u01]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
    Performing root user operation for Oracle 11g 
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_1
    
    Enter the full pathname of the local bin directory: [/usr/local/bin]: 
       Copying dbhome to /usr/local/bin ...
       Copying oraenv to /usr/local/bin ...
       Copying coraenv to /usr/local/bin ...
    
    
    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root script.
    Now product-specific root actions will be performed.
    Finished product-specific root actions.
    [root@localhost u01]# 
    
  64. 点击确定后显示:
    Oracle 页面管理地址:https://localhost:1158/em

     
  65. 开通端口:
    firewall-cmd --zone=public --add-port=1521/tcp --permanent
    firewall-cmd --zone=public --add-port=1158/tcp --permanent
    firewall-cmd --reload
    firewall-cmd --list-all
  66. 远程连接:

     
  67. 配置 oracle 用户环境变量(用于开机自启):
    vim /home/oracle/.bash_profile
    环境变量:
    export ORACLE_BASE=/u01/app
    export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1
    export ORACLE_SID=orcl
    export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
  68. 修改 Oracle 软件环境变量(手动启动、用于开机自启):
    1. 修改 dbstart 文件:
      vim /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbshut
      修改:
      ORACLE_HOME_LISTNER=$1
      为:
      ORACLE_HOME_LISTNER=$ORACLE_HOME
    2. 修改 /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart 文件同上。
  69. 开启开机自启:
    1. 修改:/etc/rc.d/rc.local
      vim /etc/rc.d/rc.local
      增加:
      su oracle -lc "/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start"
      su oracle -lc "/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart"
      授权 /etc/rc.d/rc.local 为可执行文件:
      chmod +x /etc/rc.d/rc.local
    2. 修改 /etc/oratab:
      vim /etc/oratab
      将:
      orcl:/u01/app/oracle/product/11.2.0/dbhome_1:N
      修改为:
      orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y
  70. 重启后连接:
  71. 使用 oracle 用户查看监听:
    lsnrctl status
    运行结果:
    [oracle@localhost root]$ source /home/oracle/.bash_profile 
    [oracle@localhost root]$ lsnrctl status
    
    LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 06-JUN-2020 16:52:12
    
    Copyright (c) 1991, 2013, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
    Start Date                06-JUN-2020 16:44:20
    Uptime                    0 days 0 hr. 7 min. 52 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
    Services Summary...
    Service "orcl" has 1 instance(s).
      Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orclXDB" has 1 instance(s).
      Instance "orcl", status READY, has 1 handler(s) for this service...
    The command completed successfully
    [oracle@localhost root]$ 
    启动监听:
    lsnrctl start
    停止监听:
    lsnrctl stop
  72. 操作数据库:
    启动数据库:
    dbstart
    停止数据库:
    dbshut 

     
  • 1
    点赞
  • 0
    评论
  • 3
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: Age of Ai 设计师:meimeiellie 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值