Linux 在 Centos 上安装 Oracle 11g

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10942438/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 06:43:03  来源:igfitidea点击:

Installing Oracle 11g on Centos

linuxoracleoracle11gcentos

提问by Faraaz Khan

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:

我一直在尝试在 Centos 6.2 上安装 Oracle 11g R2 有一段时间了。我知道 Oracle 版本未针对 Centos 进行认证(但已通过 RHEL 认证),因此我根本没想到这会很简单。尽管如此,我还是设法通过修复了大部分出现的问题来完成安装,除了现在当我尝试运行 SQL*Plus 时,我收到了这条烦人的消息:

[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 网站复制了该文件,但仍然无济于事。下面是一些有趣的结果,请注意 ldd 根本找不到这个文件,尽管它在 lib 文件夹中。

[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

我也在输出下面粘贴到 id 和 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

采纳答案by Mark J. Bobak

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

11gR2 不是一个版本。你安装的是什么特定版本?

Note that you musthave the latest 11gR2 version, 11.2.0.3.0.

请注意,您必须拥有最新的 11gR2 版本 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.

RHEL 6.x(或 CentOS 6.x)或 Oracle Linux 6.x 不支持 11.2.0.x.0,其中 x < 3。

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

另外,请确保您运行的是 64 位 Linux。

Hope that helps.

希望有帮助。

回答by MichaelN

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.

centos box 是 64 位还是 32 位安装。看起来 oracle 安装是 64 位的,但机器上的操作系统不是。您可以在 64 位操作系统上运行 32 位服务器,但不能反过来。如果要使用32位centos,需要安装32位oracle 11。

回答by A.N.Onymous

This is a classical ldconfig problem.

这是一个经典的 ldconfig 问题。

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).

1)在您的情况下找到缺少的库“libclntsh.so.11.1”,可能还有其他库(检查您提到的 ldd 输出)。

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

为此,请使用“查找”或“定位”命令:

find / -name libclntsh.so.11.1*

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.

2) 记下包含缺失库的目录,可能有多个目录。

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!).

3) 在目录 /etc/ldd.so.conf.d/ 中创建一个名为(例如)oracle64.conf 的文件,并将所有目录放在该文件中(每行一个目录!)。

4) Run ''ldconfig'' as root.

4) 以 root 身份运行“ldconfig”。

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

5) 在 ''sqlplus'' 上做一个 ''ldd'',现在应该正确配置缺少的库。

6) Run sqlplus normally.

6) 正常运行sqlplus。

7) Profit!! ;-)

7) 利润!!;-)

Hope this helps.

希望这可以帮助。