CentOS8静默安装Oracle11g:lsnrctl、tnsping等文件大小为0的问题

背景

平台 版本
操作系统 CentOS8
Oracle 11.2.0.4

故障现象

数据库软件安装完毕,并创建了监听。但在启动监听时,命令一跳而过,不报错,无反应。且文件大小为0。

[oracle@oracle11g ~]$ lsnrctl start
[oracle@oracle11g ~]$

同时,其他内部工具如tnsping、impdp、expdp等都有相同情况。

原理

数据库软件安装的有问题。

因为是采用的静默方式,命令行反馈的消息基本无价值。实际已经安装失败了,但没有发现。 实际报错信息包含在了详细日志里

INFO: ----------------------------------
INFO: 

INFO: /bin/chmod 755 /home/oracle/app/oracle/product/11.2.0/bin/

INFO:  - Linking tnslsnr

INFO: rm -f tnslsnr

INFO: gcc -o tnslsnr -m64 -z noexecstack -L/home/oracle/app/oracle/product/11.2.0/network/lib/ -L/home/oracle/app/oracle/product/11.2.0/lib/ -L/home/oracle/app/oracle/product/11.2.0/lib/stubs/  /home/oracle/app/oracle/product/11.2.0/network/lib/s0nsgl.o /home/oracle/app/oracle/product/11.2.0/network/lib/snsglp.o -lclntsh  `cat /home/oracle/app/oracle/product/11.2.0/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /home/oracle/app/oracle/product/11.2.0/lib/ldflags`    -lncrypt11 -lnsgr11 -lnz
INFO: js11 -ln11 -lnl11 -lnnz11 -lzt11 -lztkg11 -lclient11 -lnnetd11  -lvsn11 -lcommon11 -lgeneric11 -lmm -lsnls11 -lnls11  -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 `cat /home/oracle/app/oracle/product/11.2.0/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /home/oracle/app/oracle/product/11.2.0/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lclient11 -lnnetd11  -lvsn11 -lcommon11 -lgeneric11   -lsnls11 -lnls1
INFO: 1  -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 -lclient11 -lnnetd11  -lvsn11 -lcommon11 -lgeneric11 -lsnls11 -lnls11  -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11   `cat /home/oracle/app/oracle/product/11.2.0/lib/sysliblist` -Wl,-rpath,/home/oracle/app/oracle/product/11.2.0/lib -lm    `cat /home/oracle/app/oracle/product/11.2.0/lib/sysliblist` -ldl -lm   -L/home/oracle/app/o
INFO: racle/product/11.2.0/lib -lons -lnl11  -ln11 -lnlsnr11 -lnlsnrc11 -lnsgr11 -lnms -lncm11 -lnmsp -lpeer -lnro11 -ln11   -lnl11 -lnlsnr11 -lnlsnrc11 -lnms -lncm11 -lnmsp -ln11     -lm 

INFO: //usr/lib64/libaio.so.1: undefined reference to `__stack_chk_fail@GLIBC_2.4'
collect2: error: ld returned 1 exit status

INFO: make: *** [/home/oracle/app/oracle/product/11.2.0/network/lib/ins_net_server.mk:29: tnslsnr] Error 1

INFO: End output from spawned process.
INFO: ----------------------------------

解决方法

居然是用gcc编译实现的安装,关键报错信息是:

INFO: //usr/lib64/libaio.so.1: undefined reference to `__stack_chk_fail@GLIBC_2.4

对于oracle11g 的安装, libaio1库版本不能大于0.3.109 libaio1.so.1文件不依赖与任何其他库,本质就是一个独立的so文件,我们直接替换即可。 可用的libaio.so文件可在本处下载。

查看centos8的是0.3.112了,比要求的版本高。

[oracle@oracle11g ~]$ rpm -qa libaio
libaio-0.3.112-1.el8.x86_64

下载合适的so文件,并重建libaio.so.1的软链接 注意:新so文件的大小是5,256,自带文件的大小是35,168。

libaio.so.1.0.1复制到libaio.so.1.0.1.new后上传到/usr/lib64

[root@oracle11g ~]# cd /usr/lib64
[root@oracle11g lib64]# ln -sf libaio.so.1.0.1.new libaio.so.1
[root@oracle11g lib64]# ll libaio*
lrwxrwxrwx. 1 root root    15 11月  9 2019 libaio.so -> libaio.so.1.0.1
lrwxrwxrwx. 1 root root    19 7月  30 15:33 libaio.so.1 -> libaio.so.1.0.1.new
-rwxr-xr-x. 1 root root 35168 11月  9 2019 libaio.so.1.0.0
-rwxr-xr-x. 1 root root 35168 11月  9 2019 libaio.so.1.0.1
-rw-r--r--. 1 root root  5256 7月  30 15:30 libaio.so.1.0.1.new

图形化安装下,也一样出现该问题,但是会有提示,更容易发现一些。

参考

  1. 可用版本的下载地址:https://www.cnblogs.com/jinzhenshui/p/9366002.html

    libaio.so.1.0.1_libpthread_nonshared.a.v2.7z

  2. https://blog.csdn.net/pacificyang/article/details/110952123

  3. 本文参考地址:https://blog.csdn.net/heroicpoem/article/details/112566384

results matching ""

    No results matching ""