centos7中安装oracle Linux-x86-64 11gR2

时间:2022-03-12 08:17:41

这是我的辛璐历程,让我吐槽一番,倒持这个太痛苦了,只是因为就是想在linux中安装11g的oracle,下了很多资料,查了很多资源,翻了很多墙,用了一个星期才把它攻克。诚挚奉上,希望同路人少走弯路。

首先说下为什么在vm中的linux中安装oracle,我就觉得很爽啊,只要你的Virtual Machine不丢失,你就可以移植到其他的vm上了,上面安装的oracle也都还在。没有必要重做系统还要重装oracle

  • 下面说下我的环境

    centos7 x86-64

  • 用到的包

    oracle 11gr2

  • 下载地址

    https://updates.oracle.com/Orion/Services/download/p13390677_112040_Linux-x86-64_1of7.zip?aru=16716375&patch_file=p13390677_112040_Linux-x86-64_1of7.zip
    https://updates.oracle.com/Orion/Services/download/p13390677_112040_Linux-x86-64_2of7.zip?aru=16716375&patch_file=p13390677_112040_Linux-x86-64_2of7.zip
    提示:链接粘贴到迅雷下载

  • 我参考的安装的网站

    CentOS7安装Oracle 11gR2 图文详解

    但是有个地方很重要
    不要按照上面的操作
    一定要选择第一个去配置,过来人经验,否则会吃很多苦头。

    centos7中安装oracle Linux-x86-64 11gR2

  • 安装oracle需要下载的包

    yum install binutils-2.* compat-libstdc++-33* elfutils-libelf-0.* elfutils-libelf-devel-* gcc-4.* gcc-c++-4.* glibc-2.* glibc-common-2.* glibc-devel-2.* glibc-headers-2.* ksh-2* libaio-0.* libaio-devel-0.* libgcc-4.* libstdc++-4.* libstdc++-devel-4.* make-3.* sysstat-7.* unixODBC-2.* unixODBC-devel-2.* pdksh*
  • 验证oracle需要下载的包

     rpm -qa binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel libstdc++-static make numactl-devel sysstat unixODBC unixODBC-devel 
  • 问题:安装oracle时,如何指定jdk 或者如何解决提示框显示不全

    解决方案:
    ./runInstaller -jreLoc JRE_LOCATION

    [oracle@localhost Desktop]$ ls -lrt /usr/bin/java
    lrwxrwxrwx. 1 root root 22 Nov 27 02:54 /usr/bin/java -> /etc/alternatives/java
    [oracle@localhost Desktop]$ ls -lrt /etc/alternatives/java
    lrwxrwxrwx. 1 root root 70 Nov 27 02:54 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64/jre/bin/java

    JRE_LOCATION 使用这个地址 ./runInstaller -jreLoc /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64/jre

  • 问题:INFO: make[1]: Leaving directory
    `/u01/app/oracle/product/11.2.0.3/sysman/lib’ INFO: make: [emdctl]
    Error 2

    解决方法:

    vi $ORACLE_HOME/sysman/lib/ins_emagent.mk
    搜索以下行:
    $(MK_EMAGENT_NMECTL)
    改变为:
    $(MK_EMAGENT_NMECTL) -lnnz11
    
  • 问题:ERROR: ORA-09925: Unable to create audit trail file Linux Error: 2:
    No such file or directory Additional information: 9925 ORA-01075: you
    are currently logged on

    解决方案:

    [oracle@Allen adump]$ ps -ef |grep smon
    oracle    2479    1  0 02:52 ?        00:00:00 ora_smon_allen
    oracle  27854    1  0 08:43 ?        00:00:00 ora_smon_prod
    oracle  27946 27885  0 08:48 pts/6    00:00:00 grep smon
    [oracle@Allen adump]$ kill -9 27854
  • 问题:ORA-00845: MEMORY_TARGET not supported on this system
    [root@aaaprod-db ~]# cat /etc/fstab | grep tmpfs
    tmpfs                  /dev/shm              tmpfs  defaults,size=8g      0 0
    [root@aaaprod-db ~]#
    [root@aaaprod-db ~]# mount -o remount,size=16G /dev/shm
    [root@aaaprod-db ~]#
    [root@aaaprod-db ~]# cat /etc/fstab | grep tmpfs
    tmpfs                  /dev/shm              tmpfs  defaults,size=8g      0 0
    [root@aaaprod-db ~]# vi /etc/fstab
    /dev/rootvg/LogVol02  /                      ext3  defaults      1 1
    /dev/rootvg/LogVol01  /tmp                  ext3  defaults      1 2
    /dev/rootvg/lvol0    /ebao                  ext3  defaults      1 2
    /dev/rootvg/lvol1    /backup                ext3  defaults      1 2
    LABEL=/boot /boot                  ext3  defaults      1 2
    tmpfs                  /dev/shm              tmpfs  defaults,size=16g      0 0
    devpts                /dev/pts              devpts gid=5,mode=620 0 0
    sysfs                  /sys                  sysfs  defaults      0 0
    proc                  /proc                  proc  defaults      0 0
    /dev/rootvg/LogVol00  swap                  swap  defaults      0 0
    "/etc/fstab" 10L, 769C written
    [root@aaaprod-db ~]# df -h|grep shm
    tmpfs                16G    0  16G  0% /dev/shm