《Linux 下安装Oracle数据库 - Oracle 19C By CentOS 8 》(第一部分)
- 2 安装步骤
- 2.4 安装Oracle数据库
- 2.4.1 第一次安装报错
- 2.4.2 解决安装报错
- 第一步:安装libnsl.so.1
- 第二步:删除原来安装的 /opt/oracle/*
- 第三步:卸载已安装的Oracle
- 第四步:重新执行一次安装。
- 安装成功。
- 点击跳转文章第一部分
2 安装步骤
2.4 安装Oracle数据库
操作用户: root
操作目录: 安装包目录
大致时长: 5分钟
执行过程会执行进度条,如下:
Installing : oracle-database-ee-19c-1.0-1.x86_64 [======================= ] 1/1
2.4.1 第一次安装报错
1、第一次安装出现报错。操作过程详细:
[root@localhost install]# pwd
/oracle/install
[root@localhost install]# ls
compat-libcap1-1.10-7.el7.x86_64.rpm oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
oracle-database-ee-19c-1.0-1.x86_64.rpm
[root@localhost install]#
[root@localhost install]# yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm
Last metadata expiration check: 1 day, 23:06:39 ago on Sat 24 Jun 2023 09:08:19 AM PDT.
Dependencies resolved.
====================================================================================================Package Architecture Version Repository Size
====================================================================================================
Installing:oracle-database-ee-19c x86_64 1.0-1 @commandline 2.5 GTransaction Summary
====================================================================================================
Install 1 PackageTotal size: 2.5 G
Installed size: 6.9 G
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
ewTransaction test succeeded.
Running transactionPreparing : 1/1 Running scriptlet: oracle-database-ee-19c-1.0-1.x86_64 1/1 Installing : oracle-database-ee-19c-1.0-1.x86_64 1/1 Running scriptlet: oracle-database-ee-19c-1.0-1.x86_64 1/1
Exception java.lang.UnsatisfiedLinkError: /opt/oracle/product/19c/dbhome_1/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/19c/dbhome_1/oui/lib/linux64/liboraInstaller.so: libnsl.so.1: cannot open shared object file: No such file or directoryat 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:338)at oracle.sysman.oii.oiix.OiixOraparam.getOraparamProfileString(OiixOraparam.java:296)at oracle.sysman.oii.oiix.OiixOraparam.usePrereqChecker(OiixOraparam.java:416)at oracle.sysman.oii.oiic.OiicSessionContext.setVariables(OiicSessionContext.java:1325)at oracle.sysman.oii.oiic.OiicBaseInventoryApp.execute(OiicBaseInventoryApp.java:771)at oracle.sysman.oii.oiic.OiicBaseInventoryApp.main_helper(OiicBaseInventoryApp.java:690)at oracle.sysman.oii.oiic.OiicDetachHome.main(OiicDetachHome.java:420)
'DetachHome' failed.
Exception in thread "main" java.lang.NullPointerExceptionat oracle.sysman.oii.oiic.OiicBaseInventoryApp.main_helper(OiicBaseInventoryApp.java:706)at oracle.sysman.oii.oiic.OiicDetachHome.main(OiicDetachHome.java:420)
Exception java.lang.NoClassDefFoundError: Could not initialize class oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps occurred..
java.lang.NoClassDefFoundError: Could not initialize class oracle.sysman.oii.oiip.osd.unix.OiipuUnixOpsat 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:338)at oracle.sysman.oii.oiix.OiixOraparam.getOraparamProfileString(OiixOraparam.java:296)at oracle.sysman.oii.oiix.OiixOraparam.usePrereqChecker(OiixOraparam.java:416)at oracle.sysman.oii.oiic.OiicSessionContext.setVariables(OiicSessionContext.java:1325)at oracle.sysman.oii.oiic.OiicBaseInventoryApp.execute(OiicBaseInventoryApp.java:771)at oracle.sysman.oii.oiic.OiicBaseInventoryApp.main_helper(OiicBaseInventoryApp.java:690)at oracle.sysman.oii.oiic.OiicAttachHome.main(OiicAttachHome.java:696)
'AttachHome' failed.
Exception in thread "main" java.lang.NullPointerExceptionat oracle.sysman.oii.oiic.OiicBaseInventoryApp.main_helper(OiicBaseInventoryApp.java:706)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-ee-19c/results/oraInstall.log and /opt/oracle/oraInventory for more details and try again.
warning: %post(oracle-database-ee-19c-1.0-1.x86_64) scriptlet failed, exit status 1Error in POSTIN scriptlet in rpm package oracle-database-ee-19cVerifying : oracle-database-ee-19c-1.0-1.x86_64 1/1 Installed:oracle-database-ee-19c-1.0-1.x86_64 Complete!
2.4.2 解决安装报错
2、参考文章解决:点击跳转
第一步:安装libnsl.so.1
第一步:安装libnsl.so.1 ,操作过程如下:
[root@localhost install]# yum -y install /lib64/libnsl.so.1
Last metadata expiration check: 1 day, 23:21:45 ago on Sat 24 Jun 2023 09:08:19 AM PDT.
Dependencies resolved.
===============================================================================================================================================================================================================Package Architecture Version Repository Size
===============================================================================================================================================================================================================
Installing:libnsl x86_64 2.28-164.el8 baseos 103 kTransaction Summary
===============================================================================================================================================================================================================
Install 1 PackageTotal download size: 103 k
Installed size: 160 k
Downloading Packages:
libnsl-2.28-164.el8.x86_64.rpm 96 kB/s | 103 kB 00:01
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 95 kB/s | 103 kB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transactionPreparing : 1/1 Installing : libnsl-2.28-164.el8.x86_64 1/1 Running scriptlet: libnsl-2.28-164.el8.x86_64 1/1 Verifying : libnsl-2.28-164.el8.x86_64 1/1 Installed:libnsl-2.28-164.el8.x86_64 Complete!
第二步:删除原来安装的 /opt/oracle/*
[root@localhost install]# cd /opt/oracle/
[root@localhost oracle]# ls -l
total 0
drwxrwx---. 3 oracle oinstall 18 Jun 26 08:20 oraInventory
drwxr-xr-x. 3 oracle oinstall 17 Jun 26 08:15 product
[root@localhost oracle]# rm -rf *
[root@localhost oracle]# ls
[root@localhost oracle]# ^C
第三步:卸载已安装的Oracle
[root@localhost oracle]# yum -y remove oracle-database-ee-19c
---
//中间很多行,此处略。
---Running scriptlet: oracle-database-ee-19c-1.0-1.x86_64 1/1 Verifying : oracle-database-ee-19c-1.0-1.x86_64 1/1 Removed:oracle-database-ee-19c-1.0-1.x86_64 Complete
第四步:重新执行一次安装。
[root@localhost install]# yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm
Last metadata expiration check: 1 day, 23:28:46 ago on Sat 24 Jun 2023 09:08:19 AM PDT.
Dependencies resolved.
===============================================================================================================================================================================================================Package Architecture Version Repository Size
===============================================================================================================================================================================================================
Installing:oracle-database-ee-19c x86_64 1.0-1 @commandline 2.5 GTransaction Summary
===============================================================================================================================================================================================================
Install 1 PackageTotal size: 2.5 G
Installed size: 6.9 G
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transactionPreparing : 1/1 Running scriptlet: oracle-database-ee-19c-1.0-1.x86_64 1/1 Installing : oracle-database-ee-19c-1.0-1.x86_64 1/1 Running scriptlet: oracle-database-ee-19c-1.0-1.x86_64 1/1
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configureVerifying : oracle-database-ee-19c-1.0-1.x86_64 1/1 Installed:oracle-database-ee-19c-1.0-1.x86_64 Complete!