Solution to oracle database file badELFinterpreter: Nosuchfileordirectory

Source: Internet
Author: User

Today is. If you encounter a lib problem today, record it again. This is a case and a process of solving the problem.

When we use sqlplus to log on to a unix database, problems such as: xxxxxx bad ELF interpreter: No such file or directory may occur. This problem is also caused by lib. The normal situation is as follows:

[root@dg1 ~]# su - oracle[oracle@dg1 ~]$ ldd `which sqlplus`        linux-vdso.so.1 =>  (0x00007fff2e5ff000)        libsqlplus.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib/libsqlplus.so (0x00007fba1fef6000)        libclntsh.so.11.1 => /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1 (0x00007fba1d48b000)        libnnz11.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so (0x00007fba1d0be000)        libdl.so.2 => /lib64/libdl.so.2 (0x0000003c93800000)        libm.so.6 => /lib64/libm.so.6 (0x0000003c94400000)        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003c94000000)        libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003ca3000000)        libc.so.6 => /lib64/libc.so.6 (0x0000003c93c00000)        libaio.so.1 => /lib64/libaio.so.1 (0x00007fba1cea4000)        /lib64/ld-linux-x86-64.so.2 (0x0000003c93400000)[oracle@dg1 ~]$ 

But sometimes the corresponding lib file may be missing.

The solution to this problem is as follows:

1. Check which lib files are missing in the program

2. Check whether the corresponding lib file is missing or the environment variable.

3. If the lib file is missing, install the corresponding software package or copy the corresponding lib file. For environment variables, you need to set different environment variables for different systems.

In addition, for oracle, the 32-bit version is lib32, And the 64-bit version is the lib directory.

The following is an example of how to start RealSync today. Other programs are similar:

The following error is prompted when enabling Realsync:

dsg@dg2 scripts]$ ./start./start: /dsg/bin/archivelog: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory./start: /dsg/bin/archivelog: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory[dsg@dg2 scripts]$ ./stopINFO: Stop realsync normally...INFO: Stopping Vagentd ...INFO: Stopping Loader -s for fullsync loader ...INFO: Stopping Loader -r for realsync loader ...[dsg@dg2 scripts]$ [dsg@dg2 scripts]$ exit

So for the ld-linux.so.2 is the corresponding glibc. i686 this package. Therefore, the installation is as follows:

[root@dg2 ~]# cd /media/OL6.4\ x86_64\ Disc\ 1\ 20130225/Packages/[root@dg2 Packages]# yum install glibc.i686Loaded plugins: refresh-packagekit, securityoel6                                                                                            | 3.7 kB     00:00 ... Setting up Install ProcessResolving Dependencies--> Running transaction check---> Package glibc.i686 0:2.12-1.107.el6 will be installed--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.12-1.107.el6.i686--> Processing Dependency: libfreebl3.so for package: glibc-2.12-1.107.el6.i686--> Running transaction check---> Package nss-softokn-freebl.i686 0:3.12.9-11.el6 will be installed--> Finished Dependency ResolutionDependencies Resolved======================================================================================================================= Package                             Arch                  Version                         Repository             Size=======================================================================================================================Installing: glibc                               i686                  2.12-1.107.el6                  oel6                  4.3 MInstalling for dependencies: nss-softokn-freebl                  i686                  3.12.9-11.el6                   oel6                  116 kTransaction Summary=======================================================================================================================Install       2 Package(s)Total download size: 4.4 MInstalled size: 13 MIs this ok [y/N]: yDownloading Packages:-----------------------------------------------------------------------------------------------------------------------Total                                                                                   60 MB/s | 4.4 MB     00:00     Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionWarning: RPMDB altered outside of yum.  Installing : nss-softokn-freebl-3.12.9-11.el6.i686                                                               1/2   Installing : glibc-2.12-1.107.el6.i686                                                                                                              2/2   Verifying  : glibc-2.12-1.107.el6.i686                                                                                                              1/2   Verifying  : nss-softokn-freebl-3.12.9-11.el6.i686                                                                                                  2/2 Installed:  glibc.i686 0:2.12-1.107.el6                                                                                                                             Dependency Installed:  nss-softokn-freebl.i686 0:3.12.9-11.el6                                                                                                                 Complete![root@dg2 Packages]# su - dsg[dsg@dg2 bin]$ cd ../ ;cd scripts/;./startdsg       4416  4391  0 11:48 pts/0    00:00:00 /dsg/bin/archivelog /dsg/log/log.vagentd /dsg/log/archivelog/log.vagentd_archlog 43200 5Gdsg       4426  4391  0 11:48 pts/0    00:00:00 /dsg/bin/archivelog /dsg/log/log.r0 /dsg/log/archivelog/log.r0_archlog 43200 5G[dsg@dg2 scripts]$ 

There is no error message. view the log as follows:

[dsg@dg2 log]$ tail -f log.vagentd /dsg/bin/vagentd: error while loading shared libraries: libclntsh.so.11.1: wrong ELF class: ELFCLASS64tail: log.vagentd: file truncated

View the lib used by the Program:

[dsg@dg2 scripts]$ cd ../bin[dsg@dg2 bin]$ ldd vagentd        linux-gate.so.1 =>  (0xf77a6000)        libclntsh.so.11.1 => not found        libnnz.so => not found        libpthread.so.0 => /lib/libpthread.so.0 (0xf7773000)        libcrypt.so.1 => /lib/libcrypt.so.1 (0xf7743000)        libdl.so.2 => /lib/libdl.so.2 (0xf773d000)        libm.so.6 => /lib/libm.so.6 (0xf7713000)        librt.so.1 => /lib/librt.so.1 (0xf770a000)        libc.so.6 => /lib/libc.so.6 (0x48cb8000)        /lib/ld-linux.so.2 (0x48c96000)        libfreebl3.so => /lib/libfreebl3.so (0xf76bb000)[dsg@dg2 bin]$ 

It can be seen that there are two problems currently, one is libnnz. so does not exist, and the other is libclntsh. so.11.1 does not. You need to install the corresponding software package or directly copy the corresponding lib file to the corresponding directory.
Now, we need to modify the environment variables.

[dsg@dg2 ~]$ more .bash_profile # .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then        . ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATH####ORACLE#######3333export TMP=/tmpexport TMPDIR=/tmpexport ORACLE_BASE=/u01/app/oracleexport ORACLE_SID=dg2export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1stty erase ^H[dsg@dg2 ~]$ vi .bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then        . ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATH####ORACLE#######3333export TMP=/tmpexport TMPDIR=/tmpexport ORACLE_BASE=/u01/app/oracleexport ORACLE_SID=dg2export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1stty erase ^Hexport LD_LIBRARY_PATH=$ORACLE_HOME/lib32:/u01/app/oracle/product/11.2.0/dbhome_1/lib32

View the lib file information of the required program again:

[dsg@dg2 bin]$ ldd vagentd        linux-gate.so.1 =>  (0xf77ef000)        libclntsh.so.11.1 => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libclntsh.so.11.1 (0xf5af0000)        libnnz.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libnnz.so (0xf58a3000)        libpthread.so.0 => /lib/libpthread.so.0 (0xf5871000)        libcrypt.so.1 => /lib/libcrypt.so.1 (0xf5840000)        libdl.so.2 => /lib/libdl.so.2 (0xf583b000)        libm.so.6 => /lib/libm.so.6 (0xf5811000)        librt.so.1 => /lib/librt.so.1 (0xf5808000)        libc.so.6 => /lib/libc.so.6 (0x48cb8000)        libnnz11.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libnnz11.so (0xf55ba000)        libnsl.so.1 => /lib/libnsl.so.1 (0xf559f000)        /lib/ld-linux.so.2 (0x48c96000)        libaio.so.1 => not found        libfreebl3.so => /lib/libfreebl3.so (0xf5550000)[dsg@dg2 bin]$
Install the software package corresponding to libaio. so.1:
[root@dg2 Packages]# yum install libaio-libaio-0.3.107-10.el6.i686.rpm          libaio-0.3.107-10.el6.x86_64.rpm        libaio-devel-0.3.107-10.el6.i686.rpm    libaio-devel-0.3.107-10.el6.x86_64.rpm[root@dg2 Packages]# yum install libaio-0.3.107-10.el6.i686.rpm Loaded plugins: refresh-packagekit, securitySetting up Install ProcessExamining libaio-0.3.107-10.el6.i686.rpm: libaio-0.3.107-10.el6.i686Marking libaio-0.3.107-10.el6.i686.rpm to be installedResolving Dependencies--> Running transaction check---> Package libaio.i686 0:0.3.107-10.el6 will be installed--> Finished Dependency ResolutionDependencies Resolved======================================================================================================================================================================= Package                          Arch                           Version                                   Repository                                             Size=======================================================================================================================================================================Installing: libaio                           i686                           0.3.107-10.el6                            /libaio-0.3.107-10.el6.i686                            31 kTransaction Summary=======================================================================================================================================================================Install       1 Package(s)Total size: 31 kInstalled size: 31 kIs this ok [y/N]: YDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction  Installing : libaio-0.3.107-10.el6.i686                                                                                                                          1/1   Verifying  : libaio-0.3.107-10.el6.i686                                                                                                                          1/1 Installed:  libaio.i686 0:0.3.107-10.el6                                                                                                                                         Complete![root@dg2 Packages]# 

View again:

[dsg@dg2 bin]$ ldd vagentd        linux-gate.so.1 =>  (0xf772c000)        libclntsh.so.11.1 => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libclntsh.so.11.1 (0xf5a2d000)        libnnz.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libnnz.so (0xf57e0000)        libpthread.so.0 => /lib/libpthread.so.0 (0xf57ae000)        libcrypt.so.1 => /lib/libcrypt.so.1 (0xf577d000)        libdl.so.2 => /lib/libdl.so.2 (0xf5778000)        libm.so.6 => /lib/libm.so.6 (0xf574e000)        librt.so.1 => /lib/librt.so.1 (0xf5745000)        libc.so.6 => /lib/libc.so.6 (0x48cb8000)        libnnz11.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libnnz11.so (0xf54f7000)        libnsl.so.1 => /lib/libnsl.so.1 (0xf54dc000)        libaio.so.1 => /lib/libaio.so.1 (0xf54da000)        /lib/ld-linux.so.2 (0x48c96000)        libfreebl3.so => /lib/libfreebl3.so (0xf548b000)[dsg@dg2 bin]$ 

Start RealSync:

[dsg@dg2 scripts]$ ./startdsg       5203     1  0 12:04 pts/1    00:00:00 /dsg/bin/vagentd 50001dsg       5204  5203  0 12:04 pts/1    00:00:00 /dsg/bin/vagentd 50001dsg       5214     1  0 12:04 pts/1    00:00:00 /dsg/bin/loader -r -qno 0 1dsg       5216  5214  0 12:04 pts/1    00:00:00 /dsg/bin/loader -r -qno 0 1dsg       5213     1  0 12:04 pts/1    00:00:00 /dsg/bin/loader -s -qno 0 1dsg       5215  5213  0 12:04 pts/1    00:00:00 /dsg/bin/loader -s -qno 0 1dsg       5199  5174  0 12:04 pts/1    00:00:00 /dsg/bin/archivelog /dsg/log/log.vagentd /dsg/log/archivelog/log.vagentd_archlog 43200 5Gdsg       5208  5174  0 12:04 pts/1    00:00:00 /dsg/bin/archivelog /dsg/log/log.r0 /dsg/log/archivelog/log.r0_archlog 43200 5G[dsg@dg2 scripts]$ 

Now the problem has been solved:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.