Redhat6.4 64位安裝Oracle10.2.0.5 64位資料庫血淚記錄

迷倪小魏發表於2017-07-12

實驗環境:

作業系統:Redhat 6.4 64

資料庫:Oracle10.2.0.1 64位安裝包 + Oracle10.2.0.5 64位升級包


一、安裝前環境準備

1、安裝Redhat6.4作業系統

作業系統的具體安裝在這裡我就不再說了


2、安裝介質的準備

Oracle10.2.0.1的安裝包:10201_database_linux_x86_64.cpio.gz

Oracle10.2.0.5的升級包:p8202632_10205_Linux-x86-64.zip


3、軟硬體環境檢查

1)記憶體和交換空間檢查

[root@seiang10g ~]# grep MemTotal /proc/meminfo

MemTotal:        2726460 kB

[root@seiang10g ~]# grep SwapTotal /proc/meminfo

SwapTotal:       2736120 kB

[root@seiang10g ~]# free -m

             total       used       free     shared    buffers     cached

Mem:      2662        1753        909       0      19         1510

-/+ buffers/cache:        222       2440

Swap:         2671          0       2671


2)磁碟空間檢查

[root@seiang10g ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/vg_seiang10g-lv_root

                       47G  4.2G   40G  10% /

tmpfs                 1.4G   72K  1.4G   1% /dev/shm

/dev/sda1             485M   37M  423M   9% /boot

/dev/sr0              3.5G  3.5G     0 100% /mnt/dvd


3CPU及系統架構檢查

[root@seiang10g ~]# grep "model name" /proc/cpuinfo

model name      : Intel(R) Xeon(R) CPU           X3430  @ 2.40GHz

[root@seiang10g ~]# uname -a

Linux seiang10g.comsys.com 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux


4)必須安裝包的檢查

[root@ seiang10g database]# firefox welcome.html 


官方文件要求如下:



從文件中可以看出Oracle 10g只支援到Red Hat Enterprise Linux 4.0,並沒有明確表示支援Red Hat Enterprise Linux 6.0以上的版本. 這是因為Oracle官方並沒有在4以後的版本測試過Oracle 10g。根據要求,安裝相應的安裝包。

[root@seiang10g ~]# yum install binutils* compat* control-center* gcc* glibc* gnome-libs* libstdc* make* sysstat* xscreensaver* unixODBC* lib*


4、環境準備

1)建立組和使用者

[root@seiang10g ~]# groupadd oinstall

[root@seiang10g ~]# groupadd dba

[root@seiang10g ~]# useradd -g oinstall -G dba oracle

[root@seiang10g ~]# passwd oracle

Changing password for user oracle.

New password:

BAD PASSWORD: it is based on a dictionary word

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully


2)建立相關目錄

[root@seiang10g ~]# mkdir -p /u01/app/oracle

[root@seiang10g ~]# chown -R oracle:oinstall /u01/app/oracle

[root@seiang10g ~]# chmod -R 775 /u01/app/oracle

 

3)配置Linux核心引數及環境限制

[root@seiang10g ~]# vim /etc/sysctl.conf

kernel.shmall = 4294967296

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 262144

net.core.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144


[root@seiang10g ~]# vim /etc/security/limits.conf

oracle           soft    nproc   2047

oracle           hard    nproc   16384

oracle           soft    nofile  1024

oracle           hard    nofile  65536


[root@seiang10g ~]# vi /etc/pam.d/login

session    required     /lib/security/pam_limits.so

session    required     pam_limits.so


4)修改Oracle使用者環境變數

[oracle@seiang10g ~]$ vim .bash_profile

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH


export ORACLE_SID=seiang

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.2/dbhome_1

export ORACLE_OWNER=oracle

export PATH=$ORACLE_HOME/bin:$PATH

umask 022

5)禁用SELinux和關閉防火牆

[root@seiang10g ~]# vim /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted


[root@seiang10g ~]# service iptables stop

iptables: Flushing firewall rules:                         [  OK  ]

iptables: Setting chains to policy ACCEPT: filter          [  OK  ]

iptables: Unloading modules:                               [  OK  ]

[root@seiang10g ~]# service iptables status

iptables: Firewall is not running.

[root@seiang10g ~]# chkconfig iptables off

[root@seiang10g ~]# chkconfig iptables --list

iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off


6)修改/etc/hosts檔案

[root@seiang10g ~]# vim /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

10.1.1.47       seiang10g.comsys.com   seiang10g


二、安裝Oracle軟體

1、解壓安裝包

[root@seiang10g software]# gunzip 10201_database_linux_x86_64.cpio.gz

[root@seiang10g software]# cpio -idmv < 10201_database_linux_x86_64.cpio

[root@seiang10g software]# unzip p8202632_10205_Linux-x86-64.zip

解壓出來的目錄為database和Disk1

[oracle@seiang10g ~]$ cd /u01/software/database/

[oracle@seiang10g database]$ ll

total 36

drwxrwxr-x 9 94110 42424  4096 Oct 20  2005 doc

drwxr-xr-x 5 94110 42424  4096 Oct 23  2005 install

drwxr-xr-x 2 94110 42424  4096 Oct 23  2005 response

-rwxr-xr-x 1 94110 42424  1326 Oct 23  2005 runInstaller

drwxrwxr-x 9 94110 42424 12288 Oct 23  2005 stage

-rw-rw-r-- 1 94110 42424  5416 Oct 20  2005 welcome.html


2、執行./runInstaller

[oracle@seiang10g database]$ export DISPLAY=10.1.1.123:0.0


報錯資訊1

[oracle@seiang10g database]$ ./runInstaller

Starting Oracle Universal Installer...


Checking installer requirements...


Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, redhat-5, redhat-6, UnitedLinux-1.0, asianux-1, asianux-2, asianux-3, enterprise-4, enterprise-5 or SuSE-11

                                      Passed


All installer requirements met.


Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-07-11_10-49-36AM. Please wait ...[oracle@seiang10g Disk1]$ Oracle Universal Installer, Version 10.2.0.5.0 Production

Copyright (C) 1999, 2010, Oracle. All rights reserved.


Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2017-07-11_10-49-36AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory occurred..

java.lang.UnsatisfiedLinkError: /tmp/OraInstall2017-07-11_10-49-36AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory

        at java.lang.ClassLoader$NativeLibrary.load(Native Method)

        at java.lang.ClassLoader.loadLibrary0(Unknown Source)

        at java.lang.ClassLoader.loadLibrary(Unknown Source)

        at java.lang.Runtime.loadLibrary0(Unknown Source)

        at java.lang.System.loadLibrary(Unknown Source)

        at sun.security.action.LoadLibraryAction.run(Unknown Source)

        at java.security.AccessController.doPrivileged(Native Method)

        at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)


錯誤原因:

一般是卻少libXp的包

解決辦法:

[root@seiang10g Packages]# rpm -qa libXp*

[root@seiang10g Packages]# yum install libXp*


報錯資訊2

[oracle@seiang10g database]$ ./runInstaller

Starting Oracle Universal Installer...


Checking installer requirements...


Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, redhat-5, redhat-6, UnitedLinux-1.0, asianux-1, asianux-2, asianux-3, enterprise-4, enterprise-5 or SuSE-11

                                      Passed


All installer requirements met.


Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-07-11_10-57-11AM. Please wait ...[oracle@seiang10g Disk1]$ Oracle Universal Installer, Version 10.2.0.5.0 Production

Copyright (C) 1999, 2010, Oracle. All rights reserved.


Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2017-07-11_10-57-11AM/jre/1.4.2/lib/i386/libawt.so: libXtst.so.6: cannot open shared object file: No such file or directory occurred..

java.lang.UnsatisfiedLinkError: /tmp/OraInstall2017-07-11_10-57-11AM/jre/1.4.2/lib/i386/libawt.so: libXtst.so.6: cannot open shared object file: No such file or directory

        at java.lang.ClassLoader$NativeLibrary.load(Native Method)

        at java.lang.ClassLoader.loadLibrary0(Unknown Source)

        at java.lang.ClassLoader.loadLibrary(Unknown Source)

        at java.lang.Runtime.loadLibrary0(Unknown Source)

        at java.lang.System.loadLibrary(Unknown Source)


錯誤原因:

一般是卻少libXtst的包

解決辦法:

[root@seiang10g Packages]# rpm -qa libXtst*

[root@seiang10g Packages]# yum install libXtst*


報錯資訊3

[oracle@seiang10g database]$ ./runInstaller

Starting Oracle Universal Installer...


Checking installer requirements...


Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, redhat-5, redhat-6, UnitedLinux-1.0, asianux-1, asianux-2, asianux-3, enterprise-4, enterprise-5 or SuSE-11

                                      Passed


All installer requirements met.


Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-07-11_11-00-09AM. Please wait ...[oracle@seiang10g Disk1]$ Oracle Universal Installer, Version 10.2.0.5.0 Production

Copyright (C) 1999, 2010, Oracle. All rights reserved.


Can't connect to X11 window server using '10.1.1.123:0.0' as the value of the DISPLAY variable.

10.1.1.123:0.0

10.1.1.123:0.0

OUI-10025:Unable to start an interactive install session because of the following error:Can't connect to X11 window server using '10.1.1.123:0.0' as the value of the DISPLAY variable. The DISPLAY environment variable should be set to :, where the is usually '0.0'.

OUI-10026:Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:

- For csh:                      % setenv DISPLAY 192.168.1.128:0.0

- For sh, ksh and bash:         $ DISPLAY=192.168.1.128:0.0; export DISPLAY

Use the following command to see what shell is being used:

        echo $SHELL

Use the following command to view the current DISPLAY environment variable setting:

        echo $DISPLAY

- Make sure that client users are authorized to connect to the X Server.

OUI-10027:To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:

% xhost +

To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as 'xclock':

        %

If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.

Typical path for 'xclock': '/usr/X11R6/bin/xclock'


出現這個錯誤是由於當前使用者不是oracle或者環境變數設定的不正確導致的,因為每次都是用oracle使用者解壓,安裝,沒有遇到這個問題,所以也沒有仔細研究過這個錯誤。經過在網上查詢相關的資料找到了出錯的原因:

可以參考一下http://blog.sina.com.cn/s/blog_73582d750100ppto.html(連結內容如下:)

cause:
X-Windows emulation is not yet correctly configured or is being mis-used.
solution:
1.Make sure that "DISPLAY” is set properly as either:
     :0.0
          or
     :0.0
note:In this example, ip_address/hostnameis the host name or IP address of the system that you want to use to display Oracle Universal Installer (your workstation or PC).
eg.[root@rac1 ~]# xhost +
access control disabled, clients can connect from any host
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ export DISPLAY=192.16.2.98:0.0
[oracle@rac1 ~]$ cd database/
[oracle@rac1 database]$ ./runInstaller
Starting Oracle Universal Installer... 
Checking installer requirements... 
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed 
All installer requirements met. 
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-03-05_03-36-28PM. Please wait ...[oracle@rac1 database]$ Oracle Universal Installer, Version 10.2.0.1.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.

2. Oracle Customer Support has seen instances where use of the UNIX/Linux “su” command, even “su - oracle” has caused this “Can't connect to X11 window server” error. Therefore, please be sure that you are LOGGED ON as the oracle account. Log directly into the install session. Do not use any variety of “su”.
     use oracle log on , not "su - oracle"
eg. [oracle@rac1 database]$ ./runInstaller

3.Oracle Customer Support has seen instances where the incorrect “ulimit” setting for number of files (aka “-n”, aka “nofiles”) has caused this “Can't connect to X11 window server” error. Therefore, please be sure that your values for “nofiles” in the output of “ulimit -a” is at least 65536.

備註:前2個辦法只需要滿足其中一個就可以避免這個錯誤了:直接用oracle登陸,不能su - oracle  or 設定display=ip_address_that you want to use to display Oracle Universal Installer:0.0

 

通過直接使用oracle使用者登入解決了上面所產生的問題;

下面開始oracle10.2.0.1;


 [oracle@seiang10g database]$ ./runInstaller



在安裝到83%的時候報如下錯誤


在安裝到83%的時候,報如上錯誤:進入持續執行狀態之後,在link步驟Oracle終止操作,報錯說link失敗,然後檢視安裝的所產生的日誌資訊:


[root@seiang10g ~]# tail -60 /u01/app/oraInventory/logs/installActions2017-07-11_04-01-22PM.log

INFO: mv ctxlc /u01/app/oracle/product/10.2.0/dbhome_1/bin/ctxlc


INFO: chmod 751 /u01/app/oracle/product/10.2.0/dbhome_1/bin/ctxlc


INFO: gcc -m32 -o ctxhx -L/u01/app/oracle/product/10.2.0/dbhome_1/ctx//lib32/ -L/u01/app/oracle/product/10.2.0/dbhome_1/lib32/ -L/u01/app/oracle/product/10.2.0/dbhome_1/lib32/stubs/  /u01/app/oracle/product/10.2.0/dbhome_1/ctx/lib/ctxhx.o -L/u01/app/oracle/product/10.2.0/dbhome_1/ctx/lib/ -ldl -lm -lctxhx -Wl,-rpath,/u01/app/oracle/product/10.2.0/dbhome_1/ctx/lib -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10  `cat /u01/app/oracle/

INFO: product/10.2.0/dbhome_1/lib/sysliblist`


INFO: /usr/bin/ld: crt1.o: No such file: No such file or directory

collect2: ld returned 1 exit status


INFO: make: *** [ctxhx] Error 1


INFO: End output from spawned process.

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

INFO: Exception thrown from action: make

Exception Name: MakefileException

Exception String: Error in invoking target 'install' of makefile '/u01/app/oracle/product/10.2.0/dbhome_1/ctx/lib/ins_ctx.mk'.

See '/u01/app/oraInventory/logs/installActions2017-07-11_04-01-22PM.log' for details.

Exception Severity: 1


報錯原因:

查詢後,發現是安裝依賴包的問題glibc-devel。在32bit環境下,我們使用rpm直接安裝或者yum安裝時,只安裝32bit版本就可以了。但是在64bit環境下,是需要將兩個版本的均進行安裝。這個過程中是需要嚴格遵守文件對安裝包的要求。


解決方法:

[root@seiang10g Packages]# yum install glibc*


Retry之後又出現上面的報錯資訊,然後檢視相關安裝日誌:

INFO: make[1]: Leaving directory `/u01/app/oracle/product/10.2.0/dbhome_1/sysman/lib'


INFO: make[1]: *** [/u01/app/oracle/product/10.2.0/dbhome_1/sysman/lib/libnmemso.so] Error 1

make: *** [libnmemso] Error 2


INFO: End output from spawned process.

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

INFO: Exception thrown from action: make

Exception Name: MakefileException

Exception String: Error in invoking target 'agent nmo nmb' of makefile '/u01/app/oracle/product/10.2.0/dbhome_1/sysman/lib/ins_sysman.mk'.

See '/u01/app/oraInventory/logs/installActions2017-07-11_04-01-22PM.log' for details.

Exception Severity: 1


點選continue;


INFO: make[1]: Leaving directory `/u01/app/oracle/product/10.2.0/dbhome_1/rdbms/lib'


INFO: make[1]: *** [/u01/app/oracle/product/10.2.0/dbhome_1/rdbms/lib/extproc32] Error 1

make: *** [extproc32] Error 2


INFO: End output from spawned process.

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

INFO: Exception thrown from action: make

Exception Name: MakefileException

Exception String: Error in invoking target 'all_no_orcl' of makefile '/u01/app/oracle/product/10.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'.

See '/u01/app/oraInventory/logs/installActions2017-07-11_04-01-22PM.log' for details.

Exception Severity: 1


點選continue;


INFO: make[1]: Leaving directory `/u01/app/oracle/product/10.2.0/dbhome_1/sysman/lib'


INFO: make[1]: *** [/u01/app/oracle/product/10.2.0/dbhome_1/sysman/lib/nmccollector] Error 1

make: *** [nmccollector] Error 2


INFO: End output from spawned process.

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

INFO: Exception thrown from action: make

Exception Name: MakefileException

Exception String: Error in invoking target 'collector' of makefile '/u01/app/oracle/product/10.2.0/dbhome_1/sysman/lib/ins_emdb.mk'.

See '/u01/app/oraInventory/logs/installActions2017-07-11_04-01-22PM.log' for details.

Exception Severity: 1

 

這個問題是比較複雜的,筆者查詢了很多資料也沒有一個確切的回應。最後在網路上檢索到一位前輩的解決之道。

首先點選ignore跳過步驟,後面就可以直接完成runInstaller指令碼執行。在$ORACLE_HOME/bin目錄下,修改oracle檔案為oracle.bin

建立檔案oracle在相同目錄,內容如下:

#!/bin/bash

export DISABLE_HUGETLBFS=1

exec $ORACLE_HOME/bin/oracle.bin $@

EOF

儲存後使用chmod a+x oracle命令對檔案進行許可權修改。經過這種策略修改之後,Oracle後續的dbca過程建立資料庫執行正常。



[root@seiang10g ~]# /u01/app/oracle/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oracle/oraInventory to 770.

Changing groupname of /u01/app/oracle/oraInventory to oinstall.

The execution of the script is complete


[root@seiang10g ~]# /u01/app/oracle/product/10.2.0/dbhome_1/root.sh

Running Oracle10 root.sh script...


The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/10.2.0/dbhome_1


Enter the full pathname of the local bin directory: [/usr/local/bin]:

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.



 

 

三、安裝Oracle10.2.0.5.0

安裝升級Oracle10.2.0.5是為了後面資料庫執行的穩定,避免出現諸多的bug

 

 

如果在環境檢查的時候出現這個問題,如下所示:


 

環境檢查中具體的報錯資訊如下所示:

Checking for Oracle Home incompatibilities ...

 

Actual Result: NEW_HOME

Check complete. The overall result of this check is: Failed <<<<

Problem: This software can only be installed into an existing Oracle Database 10g Oracle Home.

Recommendation: Choose an existing Oracle Database 10g Oracle Home for installing this software.


原因是由於oracle10.2.0.5是升級包,必須要在已有的資料庫前提下進行安裝,報錯的原因是沒有已經存在的資料庫



正確的情況下:


 

安裝進度完成後也需要執行一個指令碼,注意這裡執行的時候設計到覆蓋重寫的問題,全部選擇YES

[root@seiang10g ~]# /u01/app/oracle/product/10.2.0/dbhome_1/root.sh

Running Oracle 10g root.sh script...


The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/10.2.0/dbhome_1


Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying dbhome to /usr/local/bin ...

The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying oraenv to /usr/local/bin ...

The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying coraenv to /usr/local/bin ...


Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.

 


 


 

四、建立資料庫

至此,Oracle10.2.0.5全部安裝完成!!!歷經好多的問題,最終還是安裝成功了,可喜可賀!!!

 

作者:SEian.G(苦練七十二變,笑對八十一難)

◇本文在ITPUB:http://blog.itpub.net/31015730/

           51CTO:http://seiang.blog.51cto.com/上有同步更新

◇本文itpub地址:http://blog.itpub.net/31015730/viewspace-2141989/

◇本文51CTO地址:http://seiang.blog.51cto.com/10819863/1946087

 


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31015730/viewspace-2141989/,如需轉載,請註明出處,否則將追究法律責任。

相關文章