简体   繁体   中英

Installing Oracle 11g on Centos

I have been trying to install Oracle 11g R2 on Centos 6.2 for a while. I understand that the Oracle release is not certified for Centos (but it is certified for RHEL) and hence I wasn't expecting this to be straightforward at all. Nevertheless, I have somehow managed to complete the installation by fixing most of the issues that came around, except now when I try to run SQL*Plus I get this annoying message:

[oracle@centos ~]$ sqlplus
sqlplus: error while loading shared libraries: libclntsh.so.11.1: wrong ELF class: ELFCLASS64

I thought this pointed to a corrupted file, however I have since copied the file from the Oracle website and still no avail. Some interesting results below, notice how the ldd doesn't find this file at all, despite it being there in the lib folder.

[oracle@centos ~]$ echo $LD_LIBRARY_PATH
/u01/app/oracle/product/11.2.0/dbhome_1/lib:/lib:/usr/lib </code>
[oracle@centos lib]$ ldd $ORACLE_HOME/bin/sqlplus 
linux-gate.so.1 =>  (0x00497000)
libsqlplus.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib/libsqlplus.so (0x00110000)
libclntsh.so.11.1 => not found
libnnz11.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so (0x001c0000)
libdl.so.2 => /lib/libdl.so.2 (0x00d5c000)
libm.so.6 => /lib/libm.so.6 (0x0040d000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00d63000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00eae000)
libc.so.6 => /lib/libc.so.6 (0x00bca000)
/lib/ld-linux.so.2 (0x00ba8000)
libclntsh.so.11.1 => not found
[oracle@centos lib]$ ls -ll | grep libclntsh.so.11.1 <br/>
-rwxr-xr-x  1 oracle oinstall  52761218 Jun  7 22:27 libclntsh.so.11.1</code>

Any pointers would be much appreciated.

I am also pasting below the output to id and env

[oracle@centos ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)


[oracle@centos ~]$ env
ORBIT_SOCKETDIR=/tmp/orbit-oracle
HOSTNAME=centos
IMSETTINGS_INTEGRATE_DESKTOP=yes
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=9265be1ee083d7ad74d1cee300000019-1339121593.639472-887657473
HISTSIZE=1000
TMPDIR=/tmp
ORACLE_UNQNAME=DB11G
GTK_RC_FILES=/etc/gtk/gtkrc:/home/oracle/.gtkrc-1.2-gnome2
WINDOWID=39845891
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
IMSETTINGS_MODULE=none
USER=oracle
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
ORACLE_SID=DB11G
GNOME_KEYRING_SOCKET=/tmp/keyring-rhL82I/socket
SSH_AUTH_SOCK=/tmp/keyring-rhL82I/socket.ssh
ORACLE_HOSTNAME=ol5-112.localdomain
ORACLE_BASE=/u01/app/oracle
SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/2361,unix/unix:/tmp/.ICE-unix/2361
USERNAME=oracle
DESKTOP_SESSION=gnome
MAIL=/var/spool/mail/oracle
PATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/u01/app/oracle/product/11.2.0/dbhome_1/bin:/home/oracle/bin
QT_IM_MODULE=xim
PWD=/home/oracle
XMODIFIERS=@im=none
GDM_KEYBOARD_LAYOUT=us
LANG=en_US.UTF-8
GNOME_KEYRING_PID=2352
GDM_LANG=en_US.UTF-8
GDMSESSION=gnome
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HISTCONTROL=ignoredups
HOME=/home/oracle
SHLVL=2
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=oracle
TMP=/tmp
QTLIB=/usr/lib64/qt-3.3/lib
CVS_RSH=ssh
CLASSPATH=/u01/app/oracle/product/11.2.0/dbhome_1/jlib:/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/jlib
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-XYJwhzf59A,guid=01cea4b5cde33013e1cab40300000023
LESSOPEN=|/usr/bin/lesspipe.sh %s
WINDOWPATH=1
DISPLAY=:0.0
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
G_BROKEN_FILENAMES=1
XAUTHORITY=/var/run/gdm/auth-for-oracle-lg5ZGT/database
COLORTERM=gnome-terminal
_=/bin/env

11gR2 is not a version. What specific version are you installing?

Note that you must have the latest 11gR2 version, 11.2.0.3.0.

11.2.0.x.0, where x < 3, is not supported by RHEL 6.x (or CentOS 6.x) or Oracle Linux 6.x.

Also, make sure you're running 64-bit Linux.

Hope that helps.

Is the centos box a 64bit or 32bit installation. Looks like the oracle install is 64bit, but the OS on the machine isn't. You can run 32bit server on 64bit OS but not the other way around. If you want to use the 32bit centos you need to install 32bit oracle 11.

This is a classical ldconfig problem.

Do the following:

1) Locate the missing libraries ''libclntsh.so.11.1'' in your case, there may be others (check the ldd output as you mentioned).

For this, use the ''find'' or the ''locate'' commands:

find / -name libclntsh.so.11.1*

2) Make a note of the directory that contains the missing libraries, there may be more than one directory.

3) Create a file named (for instance) oracle64.conf in the directory /etc/ldd.so.conf.d/ and put all the directories in that file (one directory per line!).

4) Run ''ldconfig'' as root.

5) Do an ''ldd'' on ''sqlplus'' and the missing libraries should now be properly configured.

6) Run sqlplus normally.

7) Profit!! ;-)

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM