Installation

無法在 Centos 8 上安裝 Oracle XE 18c

  • April 7, 2021

我正在嘗試在 Centos 8 64 位上安裝 Oracle 18。

我已經能夠安裝 prerequiste 組件,它本身需要先決條件,但 Oracle 安裝本身失敗。

任何幫助將不勝感激。

我的系統如下。

[root@localhost ~]# uname -a

Linux localhost.localdomain 4.18.0-80.11.2.el8_0.x86_64 #1 SMP Tue Sep 24 11:32:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

我已經順利執行了以下內容。

   [root@localhost ~]# yum -y localinstall compat-libcap1-1.10-7.el7.x86_64.rpm
   [root@localhost ~]# yum -y localinstall compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
   [root@localhost ~]# yum -y localinstall oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm

當我嘗試安裝 Oracle 時,它失敗了。

[root@localhost ~]# yum -y localinstall oracle-database-xe-18c-1.0-1.x86_64.rpm
Last metadata expiration check: 0:02:01 ago on Sun 24 Nov 2019 18:06:23 AEDT.
Dependencies resolved.
=============================================================================================================================================================================
Package                                             Arch                                Version                             Repository                                 Size
=============================================================================================================================================================================
Installing:
oracle-database-xe-18c                              x86_64                              1.0-1                               @commandline                              2.4 G

Transaction Summary
=============================================================================================================================================================================
Install  1 Package

Total size: 2.4 G
Installed size: 5.2 G
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
 Preparing        :                                                                                                                                                     1/1
 Running scriptlet: oracle-database-xe-18c-1.0-1.x86_64                                                                                                                 1/1
 Installing       : oracle-database-xe-18c-1.0-1.x86_64                                                                                                                 1/1
 Running scriptlet: oracle-database-xe-18c-1.0-1.x86_64                                                                                                                 1/1
Exception java.lang.UnsatisfiedLinkError: /opt/oracle/product/18c/dbhomeXE/oui/lib/linux64/liboraInstaller.so: libnsl.so.1: cannot open shared object file: No such file or directory occurred..
java.lang.UnsatisfiedLinkError: /opt/oracle/product/18c/dbhomeXE/oui/lib/linux64/liboraInstaller.so: libnsl.so.1: cannot open shared object file: No such file or directory
       at java.lang.ClassLoader$NativeLibrary.load(Native Method)
       at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
       at java.lang.Runtime.loadLibrary0(Runtime.java:870)
       at java.lang.System.loadLibrary(System.java:1122)
       at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.loadNativeLib(OiipuUnixOps.java:388)
       at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.<clinit>(OiipuUnixOps.java:130)
       at oracle.sysman.oii.oiip.oiipg.OiipgEnvironment.getEnv(OiipgEnvironment.java:201)
       at oracle.sysman.oii.oiix.OiixIniPair.instantiateEnvVars(OiixIniPair.java:299)
       at oracle.sysman.oii.oiix.OiixIniPair.updateValue(OiixIniPair.java:230)
       at oracle.sysman.oii.oiix.OiixIniPair.<init>(OiixIniPair.java:148)
       at oracle.sysman.oii.oiix.OiixIniFile.readFile(OiixIniFile.java:809)
       at oracle.sysman.oii.oiix.OiixIniFile.readIniFile(OiixIniFile.java:978)
       at oracle.sysman.oii.oiix.OiixIniFile.getProfileString(OiixIniFile.java:385)
       at oracle.sysman.oii.oiix.OiixOraparam.getOraparamProfileString(OiixOraparam.java:339)
       at oracle.sysman.oii.oiix.OiixOraparam.getOraparamProfileString(OiixOraparam.java:297)
       at oracle.sysman.oii.oiix.OiixOraparam.usePrereqChecker(OiixOraparam.java:417)
       at oracle.sysman.oii.oiic.OiicSessionContext.setVariables(OiicSessionContext.java:1325)
       at oracle.sysman.oii.oiic.OiicBaseInventoryApp.execute(OiicBaseInventoryApp.java:766)
       at oracle.sysman.oii.oiic.OiicBaseInventoryApp.main_helper(OiicBaseInventoryApp.java:685)
       at oracle.sysman.oii.oiic.OiicDetachHome.main(OiicDetachHome.java:420)
'DetachHome' failed.
Exception in thread "main" java.lang.NullPointerException
       at oracle.sysman.oii.oiic.OiicBaseInventoryApp.main_helper(OiicBaseInventoryApp.java:701)
       at oracle.sysman.oii.oiic.OiicDetachHome.main(OiicDetachHome.java:420)
Exception java.lang.UnsatisfiedLinkError: /opt/oracle/product/18c/dbhomeXE/oui/lib/linux64/liboraInstaller.so: libnsl.so.1: cannot open shared object file: No such file or directory occurred..
java.lang.UnsatisfiedLinkError: /opt/oracle/product/18c/dbhomeXE/oui/lib/linux64/liboraInstaller.so: libnsl.so.1: cannot open shared object file: No such file or directory
       at java.lang.ClassLoader$NativeLibrary.load(Native Method)
       at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
       at java.lang.Runtime.loadLibrary0(Runtime.java:870)
       at java.lang.System.loadLibrary(System.java:1122)
       at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.loadNativeLib(OiipuUnixOps.java:388)
       at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.<clinit>(OiipuUnixOps.java:130)
       at oracle.sysman.oii.oiip.oiipg.OiipgEnvironment.getEnv(OiipgEnvironment.java:201)
       at oracle.sysman.oii.oiix.OiixIniPair.instantiateEnvVars(OiixIniPair.java:299)
       at oracle.sysman.oii.oiix.OiixIniPair.updateValue(OiixIniPair.java:230)
       at oracle.sysman.oii.oiix.OiixIniPair.<init>(OiixIniPair.java:148)
       at oracle.sysman.oii.oiix.OiixIniFile.readFile(OiixIniFile.java:809)
       at oracle.sysman.oii.oiix.OiixIniFile.readIniFile(OiixIniFile.java:978)
       at oracle.sysman.oii.oiix.OiixIniFile.getProfileString(OiixIniFile.java:385)
       at oracle.sysman.oii.oiix.OiixOraparam.getOraparamProfileString(OiixOraparam.java:339)
       at oracle.sysman.oii.oiix.OiixOraparam.getOraparamProfileString(OiixOraparam.java:297)
       at oracle.sysman.oii.oiix.OiixOraparam.usePrereqChecker(OiixOraparam.java:417)
       at oracle.sysman.oii.oiic.OiicSessionContext.setVariables(OiicSessionContext.java:1325)
       at oracle.sysman.oii.oiic.OiicBaseInventoryApp.execute(OiicBaseInventoryApp.java:766)
       at oracle.sysman.oii.oiic.OiicBaseInventoryApp.main_helper(OiicBaseInventoryApp.java:685)
       at oracle.sysman.oii.oiic.OiicAttachHome.main(OiicAttachHome.java:696)
'AttachHome' failed.
Exception in thread "main" java.lang.NullPointerException
       at oracle.sysman.oii.oiic.OiicBaseInventoryApp.main_helper(OiicBaseInventoryApp.java:701)
       at oracle.sysman.oii.oiic.OiicAttachHome.main(OiicAttachHome.java:696)
[SEVERE] An error occurred while registering the Oracle home. Verify logs in /var/log/oracle-database-xe-18c/results/oraInstall.log and /opt/oracle/oraInventory for more details and try again.
warning: %post(oracle-database-xe-18c-1.0-1.x86_64) scriptlet failed, exit status 1

Error in POSTIN scriptlet in rpm package oracle-database-xe-18c
 Verifying        : oracle-database-xe-18c-1.0-1.x86_64                                                                                                                 1/1

Installed:
 oracle-database-xe-18c-1.0-1.x86_64

Complete!

答案並不明顯。如果您按照文件和各種文章安裝 Oracle XE 18c,如果您只使用 yum 進行安裝,則似乎缺少一些步驟。

首先,如果您使用 yum 執行先決條件文件的安裝,您會收到回复說缺少兩個依賴文件。

如果然後使用 rpm -ivh 執行相同的結果,則結果會有所不同。見下文。

[root@localhost ~]# yum -y localinstall oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm 
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                                11 kB/s | 4.5 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                  6.8 kB/s | 4.1 kB     00:00    
Error: 
Problem: conflicting requests
 - nothing provides compat-libcap1 needed by oracle-database-preinstall-18c-1.0-1.el7.x86_64
 - nothing provides compat-libstdc++-33 needed by oracle-database-preinstall-18c-1.0-1.el7.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@localhost ~]#
[root@localhost ~]# rpm -ivh oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm 
warning: oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
   compat-libcap1 is needed by oracle-database-preinstall-18c-1.0-1.el7.x86_64
   compat-libstdc++-33 is needed by oracle-database-preinstall-18c-1.0-1.el7.x86_64
   ksh is needed by oracle-database-preinstall-18c-1.0-1.el7.x86_64
   libaio-devel is needed by oracle-database-preinstall-18c-1.0-1.el7.x86_64
   libstdc++-devel is needed by oracle-database-preinstall-18c-1.0-1.el7.x86_64
   sysstat is needed by oracle-database-preinstall-18c-1.0-1.el7.x86_64
   xorg-x11-utils is needed by oracle-database-preinstall-18c-1.0-1.el7.x86_64
[root@localhost ~]# 

我也意識到我在那個階段還沒有安裝 java。但是,僅安裝它也無濟於事。

我的解決方案是安裝 rpm -ivh 突出顯示的依賴項,然後安裝 java,然後安裝 libnsl,這是 java 抱怨的又一個 rpm。

我的解決方案如下。

yum install -y gcc-c++ make
yum install -y ksh
yum install -y sysstat
yum install -y xorg-x11-utils
yum install -y libnsl
yum install java-11-openjdk-devel
rpm -ivh libaio-devel-0.3.110-12.el8.x86_64.rpm
rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
rpm -ivh compat-libcap1-1.10-7.el7.x86_64.rpm

然後安裝 Oracle 文件。

rpm -ivh oracle-database-preinstall-18c-1.0-1.el7.x86_64
rpm -ivh oracle-database-xe-18c-1.0-1.x86_64.rpm

我不知道這是否是進行 Oracle 安裝的最佳方式,但它現在在 RHEL 和 Centos 系統上都對我有用。

為了補充這個出色的答案,也因為 CentOS 已不復存在,我在 Oracles YUM repo 上找到了所需的軟體包:

https://yum.oracle.com/repo/OracleLinux/OL7/0/base/x86_64/index.html

希望這可以幫助任何尋求可靠回購來拉取軟體包的人。

引用自:https://dba.stackexchange.com/questions/254015