Redhat 6.2安裝Oracle 11g用戶端及遇到的問題分析,oracle11g

來源:互聯網
上載者:User

Redhat 6.2安裝Oracle 11g用戶端及遇到的問題分析,oracle11g
昨天在Redhat6.2(64 bit)上安裝oracle 11.2.0.1.0 client(32 bit),以下是安裝中碰到的一些問題及處理過程記錄
首先解壓縮安裝包,會產生一個client目錄,運行runInstaller時報錯,錯誤如下:
[oracle@Ptyjkweb oracle]$ ls -ltotal 627612drwxr-xr-x. 6 oracle oinstall      4096 Aug 19  2009 client-rwxrwxr-x. 1 oracle oinstall 642016988 Jul  7 14:53 linux_11gR2_client.zipdrwxrwxr-x. 2 oracle oinstall     16384 Jul  7 11:01 lost+found[oracle@Ptyjkweb oracle]$ cd client/[oracle@Ptyjkweb client]$ ls -ltotal 28drwxr-xr-x.  8 oracle oinstall 4096 Aug 17  2009 docdrwxr-xr-x.  4 oracle oinstall 4096 Aug 14  2009 installdrwxrwxr-x.  2 oracle oinstall 4096 Aug 14  2009 response-rwxr-xr-x.  1 oracle oinstall 4356 Aug 14  2009 runInstallerdrwxr-xr-x. 14 oracle oinstall 4096 Aug 14  2009 stage-rw-r--r--.  1 oracle oinstall 3891 Aug 18  2009 welcome.html
[oracle@Ptyjkweb client]$ ./runInstaller Starting Oracle Universal Installer...
Checking Temp space: must be greater than 80 MB.   Actual 11574 MB    PassedChecking swap space: must be greater than 150 MB.   Actual 8191 MB    PassedChecking monitor: must be configured to display at least 256 colors.    Actual 16777216    PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2015-07-07_02-55-47PM. Please wait ...[oracle@Ptyjkweb client]$ Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2015-07-07_02-55-47PM/jdk/jre/lib/i386/xawt/libmawt.so: libXext.so.6: cannot open shared object file: No such file or directoryat java.lang.ClassLoader$NativeLibrary.load(Native Method)at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647)at java.lang.Runtime.load0(Runtime.java:769)at java.lang.System.load(System.java:968)at java.lang.ClassLoader$NativeLibrary.load(Native Method)at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)at java.lang.Runtime.loadLibrary0(Runtime.java:822)at java.lang.System.loadLibrary(System.java:993)at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)at java.security.AccessController.doPrivileged(Native Method)at java.awt.Toolkit.loadLibraries(Toolkit.java:1509)at java.awt.Toolkit.<clinit>(Toolkit.java:1530)at com.jgoodies.looks.LookUtils.isLowResolution(Unknown Source)at com.jgoodies.looks.LookUtils.<clinit>(Unknown Source)at com.jgoodies.looks.plastic.PlasticLookAndFeel.<clinit>(PlasticLookAndFeel.java:122)at java.lang.Class.forName0(Native Method)at java.lang.Class.forName(Class.java:242)at javax.swing.SwingUtilities.loadSystemClass(SwingUtilities.java:1783)at javax.swing.UIManager.setLookAndFeel(UIManager.java:480)at oracle.install.commons.util.Application.startup(Application.java:758)at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:164)at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:181)at oracle.install.commons.base.driver.common.Installer.startup(Installer.java:265)at oracle.install.ivw.client.driver.ClientInstaller.startup(ClientInstaller.java:85)at oracle.install.ivw.client.driver.ClientInstaller.main(ClientInstaller.java:95)
[oracle@Ptyjkweb client]$ cd /tmp/OraInstall2015-07-07_04-07-33PM/jdk/jre/lib/i386/xawt[oracle@Ptyjkweb xawt]$ ls -ltotal 3276-rwxr-x---. 1 oracle oinstall 3149094 May  6  2009 libmawt_g.so-rwxr-x---. 1 oracle oinstall  200888 May  6  2009 libmawt.so[oracle@Ptyjkweb xawt]$ rpm -qa|grep libXextlibXext-devel-1.1-3.el6.x86_64libXext-1.1-3.el6.x86_64
可以看到libmawt.so是有的,由於作業系統是64位的,之前也裝了64位的libXert包,但是仍然報找不到libXext.so.6
[root@Ptyjkweb Packages]# rpm -ivh libXext-1.1-3.el6.i686 Preparing...                ########################################### [100%]   1:libXext                 ########################################### [100%][root@Ptyjkweb Packages]# rpm -ivh libXext-devel-1.1-3.el6.i686 Preparing...                ########################################### [100%]   1:libXext-devel           ########################################### [100%]
[oracle@Ptyjkweb ~]# rpm -qa|grep libXextlibXext-devel-1.1-3.el6.i686libXext-devel-1.1-3.el6.x86_64libXext-1.1-3.el6.x86_64libXext-1.1-3.el6.i686
最後將32位的libXext包也安裝上才得以解決,並順利進入圖形介面
在圖形介面中報了一個OS核心設定錯誤,可以以root運行runfixup.sh指令碼自動修複,pdksh-5.2.14這個包可以忽略,Swap Size也可以忽略


[root@Ptyjkweb ~]# /tmp/CVU_11.2.0.1.0_oracle/runfixup.shResponse file being used is :/tmp/CVU_11.2.0.1.0_oracle/fixup.responseEnable file being used is :/tmp/CVU_11.2.0.1.0_oracle/fixup.enableLog file location: /tmp/CVU_11.2.0.1.0_oracle/orarun.logSetting Kernel Parameters...kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default = 262144net.core.wmem_default = 262144net.core.rmem_max = 4194304
然後根據提示執行orainstRoot.sh指令碼賦予目錄許可權
[root@Ptyjkweb ~]# /oracle/oraInventory/orainstRoot.sh Changing permissions of /oracle/oraInventory.Adding read,write permissions for group.Removing read,write,execute permissions for world.
Changing groupname of /oracle/oraInventory to oinstall.The execution of the script is complete.
添加環境變數時注意,由於之前安裝的是InstantClient模式,所以在ORACLE_HOME中並沒有bin目錄和lib目錄,因此指定PATH的時候是$ORACLE_HOME而不是$ORACLE_HOME/bin,以及LD_LIBRARY_PATH是$ORACLE_HOME,而不是$ORACLE_HOME/lib
[oracle@Ptyjkweb client_1]$ vi ~/.bash_profile
export TMP=/tmpexport TMPDIR=/tmpexport ORACLE_BASE=/oracleexport ORACLE_HOME=$ORACLE_BASE/client_1export PATH=$ORACLE_HOME:$PATH
export TNS_ADMIN=$ORACLE_HOMEexport LD_LIBRARY_PATH=$ORACLE_HOME

[oracle@Ptyjkweb client_1]$ source ~/.bash_profile[oracle@Ptyjkweb client_1]$ sqlplus / as sysdba
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
[oracle@Ptyjkweb ~]$ cd $ORACLE_HOME[oracle@Ptyjkweb client_1]$ ls -ltotal 145060-rwxr-xr-x.  1 oracle oinstall    21865 Aug 13  2009 adrcidrwxr-xr-x.  3 oracle oinstall     4096 Jul  8 09:50 cfgtoollogsdrwxr-xr-x.  3 oracle oinstall     4096 Jul  8 09:49 install-rw-r--r--.  1 oracle oinstall       37 Jul  8 09:49 install.platformdrwxrwx---. 13 oracle oinstall     4096 Jul  8 09:49 inventory-rw-r--r--.  1 oracle oinstall 40088477 Aug 13  2009 libclntsh.so.11.1-rw-r--r--.  1 oracle oinstall    11227 Jul 31  2009 libheteroxa11.so-rw-r--r--.  1 oracle oinstall  6986848 Aug  2  2009 libnnz11.so-rw-r--r--.  1 oracle oinstall  1879549 Aug 13  2009 libocci.so.11.1-rw-r--r--.  1 oracle oinstall 89377610 Aug 13  2009 libociei.so-rw-r--r--.  1 oracle oinstall   152304 Jul 31  2009 libocijdbc11.so-rw-r--r--.  1 oracle oinstall  1501651 Aug  1  2009 libsqlplusic.so-rw-r--r--.  1 oracle oinstall  1218075 Aug  1  2009 libsqlplus.so-rw-r--r--.  1 oracle oinstall   777979 Aug 13  2009 libsqora.so.11.1drwxr-xr-x.  2 oracle oinstall     4096 Jul  8 09:49 lightdrwxr-xr-x.  3 oracle oinstall     4096 Jul  8 09:49 odbc-rw-r--r--.  1 oracle oinstall  1996228 Jul 31  2009 ojdbc5.jar-rw-r--r--.  1 oracle oinstall  2111220 Jul 31  2009 ojdbc6.jar-rw-r--r--.  1 oracle oinstall  1656280 Aug  2  2009 orai18n.jar-rw-r--r--.  1 oracle oinstall    82983 Aug  2  2009 orai18n-mapping.jar-rw-r-----.  1 oracle oinstall       55 Jul  8 09:48 oraInst.loc-rwxr-xr-x.  1 oracle oinstall     6909 Aug  1  2009 sqlplus-rwxr-xr-x.  1 oracle oinstall   377507 Aug 13  2009 wrc-rw-r--r--.  1 oracle oinstall    37807 Aug 13  2009 xstreams.jar
此處如果提示找不到libsqlplus.so檔案,並不是因為缺少包,而是因為沒有指定LD_LIBRARY_PATH環境變數,或是指定錯了位置(指定到了$ORALCE_HOME/lib下)
[oracle@Ptyjkweb client_1]$ ldd sqlpluslinux-gate.so.1 =>  (0x00322000)libsqlplus.so => not foundlibclntsh.so.11.1 => not foundlibnnz11.so => not foundlibdl.so.2 => /lib/libdl.so.2 (0x00bd3000)libm.so.6 => /lib/libm.so.6 (0x00147000)libpthread.so.0 => /lib/libpthread.so.0 (0x0021f000)libnsl.so.1 => /lib/libnsl.so.1 (0x00110000)libc.so.6 => /lib/libc.so.6 (0x00745000)/lib/ld-linux.so.2 (0x00476000)libaio.so.1 => not found
此時會發現有4個庫檔案為“not found”狀態,而一旦LD_LIBRARY_PATH環境變數配置正確,上面3個庫檔案就會連結正常,如下:
[oracle@Ptyjkweb client_1]$ sqlplus / as sysdbasqlplus: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
[oracle@Ptyjkweb logs]$ which sqlplus/oracle/client_1/sqlplus[oracle@Ptyjkweb logs]$ cd /oracle/client_1/[oracle@Ptyjkweb client_1]$ ldd sqlpluslinux-gate.so.1 =>  (0x00322000)libsqlplus.so => /oracle/client_1/libsqlplus.so (0x003ac000)libclntsh.so.11.1 => /oracle/client_1/libclntsh.so.11.1 (0xf5a23000)libnnz11.so => /oracle/client_1/libnnz11.so (0x004f8000)libdl.so.2 => /lib/libdl.so.2 (0x00bd3000)libm.so.6 => /lib/libm.so.6 (0x00147000)libpthread.so.0 => /lib/libpthread.so.0 (0x0021f000)libnsl.so.1 => /lib/libnsl.so.1 (0x00110000)libc.so.6 => /lib/libc.so.6 (0x00745000)/lib/ld-linux.so.2 (0x00476000)libaio.so.1 => not found
現在只剩下libio.so.1這個庫檔案無法正常連結,其實也是因為缺少安裝包,目前也僅安裝了64位的包
[oracle@Ptyjkweb client_1]$ rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH})\n" | grep libaiolibaio-0.3.107-10.el6.x86_64libaio-devel-0.3.107-10.el6.x86_64
曾嘗試直接從別的11g庫(64 bit)中將libaio.so.1檔案拷貝到/oracle/client_1目錄下,執行sqlplus時會報以下錯誤:sqlplus: error while loading shared libraries: libaio.so.1: wrong ELF class: ELFCLASS64

[root@Ptyjkweb Packages]# pwd/mnt/Server/Packages[root@Ptyjkweb Packages]# ls -l |grep libaio-r--r--r--. 201 root root    21664 Aug 17  2010 libaio-0.3.107-10.el6.i686.rpm-r--r--r--. 149 root root    21752 Aug 17  2010 libaio-0.3.107-10.el6.x86_64.rpm-r--r--r--. 173 root root    13580 Aug 17  2010 libaio-devel-0.3.107-10.el6.i686.rpm-r--r--r--. 128 root root    13516 Aug 17  2010 libaio-devel-0.3.107-10.el6.x86_64.rpm[root@Ptyjkweb Packages]# rpm -ivh libaio-0.3.107-10.el6.i686.rpm Preparing...                ########################################### [100%]   1:libaio                 ########################################### [100%][root@Ptyjkweb Packages]# rpm -ivh libaio-devel-0.3.107-10.el6.i686.rpm Preparing...                ########################################### [100%]   1:libaio-devel           ########################################### [100%][root@Ptyjkweb Packages]# rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH})\n" | grep libaiolibaio-0.3.107.10.el6 (x86_64)libaio-devel-0.3.107.10.el6 (x86_64)libaio-0.3.107.10.el6 (i686)libaio-devel-0.3.107.10.el6 (i686)[oracle@Ptyjkweb ~]$ ldd `which sqlplus`linux-gate.so.1 =>  (0x00747000)libsqlplus.so => /oracle/client_1/libsqlplus.so (0x002c0000)libclntsh.so.11.1 => /oracle/client_1/libclntsh.so.11.1 (0xf5a31000)libnnz11.so => /oracle/client_1/libnnz11.so (0x00c35000)libdl.so.2 => /lib/libdl.so.2 (0x00f51000)libm.so.6 => /lib/libm.so.6 (0x00110000)libpthread.so.0 => /lib/libpthread.so.0 (0x0013a000)libnsl.so.1 => /lib/libnsl.so.1 (0x00a62000)libc.so.6 => /lib/libc.so.6 (0x00498000)libaio.so.1 => /lib/libaio.so.1 (0x009b0000)/lib/ld-linux.so.2 (0x00476000)[oracle@Ptyjkweb client_1]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 8 13:53:30 2015
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
ERROR:ORA-12162: TNS:net service name is incorrectly specified

Enter user-name: 
這是由於還未配置tnsnames.ora,使用/nolog登陸就不會報錯
[oracle@Ptyjkweb client_1]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 8 13:56:19 2015
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
SQL> 
至此,Oracle 11g用戶端順利安裝完畢,整個過程可以發現,出現的一些問題主要還是由於缺少安裝包造成的,當然,環境變數配置不當也是一部分原因。



著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

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.