程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle數據庫基礎 >> 紅帽linux5安裝Oracle 9i enterprise

紅帽linux5安裝Oracle 9i enterprise

編輯:Oracle數據庫基礎

如果你在紅帽Linux5上安裝Oracle 9i enterprise遇到了問題,不防看一看下面的文章,希望能幫你解決有關Oracle 9i enterprise實際應用的問題。具體安裝步驟如下:
環境: Red Hat Enterprise Linux 5 (RHEL5), Oracle9i (9.2.0.4.0)
RHEL5 安裝可參考 [url=http://ox0spy.googlepages.com/rhel5install.txt]Red Hat Enterprise Linux 5 (RHEL5) 安裝說明
下面以 $ 開頭的命令都是由Oracle執行的
# 開頭的命令都是由root執行的

[color=DarkGreen][size=4]文章中提到的包都給出了獲取方法,請認真閱讀文章[/size][/color]
1. 創建用戶和組
-------------------------添加安裝過程中需要用到的用戶和組
$ su -
# groupadd oinstall
# groupadd dba
# useradd -g oinstall -G dba Oracle
# passwd Oracle

2. 創建目錄
--------------------------
我們將把所有東西都安裝到在 /opt/Oracle 目錄下:
# mkdir -p /opt/app/Oracle/9.2.0
# chown -R oracle.oinstall /opt/app/Oracle

3. 系統配置
--------------------------
a) 設置內核參數
編輯/etc/sysctl.conf
kernel.shmmax = 536870912 這裡設置為物理內存的一半 1G內存的話為:512×1024×1024
kernel.shmmni = 4096 2G 內存的話為:1024×1024×1024
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128 其他的值都不用動
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

sem 4個參數依次為 SEMMSL(每個用戶擁有信號量最大數);
SEMMNS(系統信號量最大數);
SEMOPM(每次semopm系統調用操作數);
SEMMNI(系統辛苦量集數最大數).
Shmmax 最大共享內存2GB 物理內存如果小的話可以設置成 536870912.
Shmmni 最小共享內存 4096KB.
Shmall 所有內存大小.

執行sysctl以反映修改 使內核參數立刻生效,重啟也可以
# sysctl –p

也可以在運行時通過執行下列命令更改內核參數:
#echo 250 32000 100 128 > /proc/sys/kernel/sem
#echo 268435456 > /proc/sys/kernel/shmmax  # 1/2 * mem_size(M) * 1024 *1024
#echo 4096 > /proc/sys/kernel/shmmni
#echo 524288 > /proc/sys/kernel/shmall # mem_size(M) * 1024
#echo 65536  > /proc/sys/fs/file-max
#echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range

b) 設置Oracle對文件的要求
修改文件:/etc/security/limits.conf 
#echo Oracle soft nofile 65536 >> /etc/security/limits.conf
#echo Oracle hard nofile 65536 >> /etc/security/limits.conf
#echo Oracle soft nproc 16384 >> /etc/security/limits.conf
#echo Oracle hard nproc 16384 >> /etc/security/limits.conf

c) 設置環境變量
在/home/Oracle/.bash_profile 中添加如下行:
export Oracle_SID=zhang
export ORACLE_BASE=/opt/app/Oracle
export ORACLE_HOME=/opt/app/Oracle/9.2.0
export LD_LIBRARY_PATH=/opt/app/Oracle/9.2.0/lib:/lib:/usr
/lib:/usr/local/lib:/usr/X11R6/lib
export TNS_ADMIN=/opt/app/Oracle/9.2.0/network/admin
export ORA_NLS33=/opt/app/Oracle/9.2.0/ocommon/nls/admin/data
export ORACLE_OWNER=Oracle
export Oracle_TERM=xterm
export PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local
/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/
opt/app/Oracle/9.2.0/bin

4. 打補丁、安裝需要的包, 至於為什麼要做這些工作,後面有個Tips,給出了安裝中出現的錯誤及其Solution
--------------------------------------------------------------------------------------------------
a) 補丁說明:
p3006854_9204_Linux.zip 安裝前就要打好的補丁
p2617419_210_GENERIC.zip 安裝後要打的(這只是一個伴隨補丁,只要設置它的
環境變量)
p3238244_9204_Linux.zip 安裝後要打的9204的補丁,修復agent錯誤的補丁.
http://www.opennet.ru/soft/ora_inst/

compat-libcwait-2.0-2.i386.rpm Linux AS 4 的補丁在安裝前就要打
compat-Oracle-rhel4-1.0-5.i386.rpm Linux AS 4 的補丁在安裝前就要打,但我沒安裝它
http://oss.oracle.com/projects/compat-Oracle/files/RedHat/

b) 打p3006854_9204_Linux.zip
# unzip p3006854_9204_Linux.zip
# chmod +x 3006854/rhel3_pre_install.sh
# 3006854/rhel3_pre_install.sh

c) 安裝 compat-libcwait-2.1-1.i386.rpm
# rpm -ivh compat-libcwait-2.1-1.i386.rpm

d) 一些需要的包,這些包可以從系統盤中找到
# rpm -ivh compat-db-4.2.52-5.1.i386.rpm 
# rpm -ivh libXp-1.0.0-8.i386.rpm 
# rpm -ivh libXp-devel-1.0.0-8.i386.rpm
# rpm -ivh openmotif-2.3.0-0.3.el5.i386.rpm
# rpm -ivh openmotif-devel-2.3.0-0.3.el5.i386.rpm

d) gnome-libs-1.4.2-7.rhel5.i386.rpm 和 一些依賴包
這些包網上都可以找到,也可以從 http://ox0spy.googlepages.com/download.zip 下載
# rpm -ivh giflib-4.1.3-8.i386.rpm 
# rpm -ivh glib-1.2.10-26.fc7.i386.rpm 
# rpm -ivh libpng10-1.0.18-2.i386.rpm 
# rpm -ivh ORBit-0.5.17-22.rhel5.i386.rpm 
# rpm -ivh gtk+-1.2.10-57.fc7.i386.rpm 
# rpm -ivh imlib-1.9.15-2.fc7.i386.rpm 
# rpm -ivh gnome-libs-1.4.2-7.rhel5.i386.rpm 

e) 創建鏈接
# ln -s /usr/lib/libstdc++-libc6.2-2.so.3 /usr/lib/libstdc++-libc6.1-1.so.2

到這你可以能會說前面的兩個補丁還沒打,請別著急,後面會用到它們的
好,我們繼續...

5. 開始安裝Oracle
----------------------------------------------------------------------------------
1) 准備工作
download Oracle 9i
http://www.oracle.com/technology/software/products/Oracle9i/htdocs/Linuxsoft.Html

解壓
$ zcat ship_9204_Linux_disk1.cpio.gz | cpio -idmv
$ zcat ship_9204_Linux_disk2.cpio.gz | cpio -idmv
$ zcat ship_9204_Linux_disk3.cpio.gz | cpio -idmv

2) 請重啟X然後用Oracle登陸系統, 否則會出現一些列的錯誤,如:xhost +、環境變量、etc
$ Disk1/runInstaller
沒有特別說明的均按默認設置,根據界面提示,然後點 Next 或 OK即可.
Oracle install group : oinstall
Global Database Name : ox0spy.org (可根據你的情況填寫)
這個過程中還會出現兩次提示,讓你運行指定目錄下的腳本,根據提示做就可以了

3) 現在應該安裝到Configuration Tools了,如果在這出現錯誤,提示Configuration Tools安裝失敗,
不要著急,我們還有兩個補丁沒打呢. 其實准確的說是一個補丁, p2617419_210_GENERIC.zip只是
一個伴隨補丁, 我這不需要,手動完成就好
解決Agent Configuration Assistant安裝失敗
$ unzip p3238244_9204_Linux.zip
$ cp 3238244/files/lib/stubs/* $Oracle_HOME/lib/stubs/
$ cd $Oracle_HOME/network/lib/
$ make -f ins_oemagent.mk install

解決 Oracle Net Configuration Assistant, Oracle Database Configuration Assistant 安裝失敗
$ rm $Oracle_HOME/JRE
$ ln -s $ORACLE_BASE/jre/1.3.1/  $Oracle_HOME/JRE
$ ln -s $Oracle_HOME/JRE/bin/Java $Oracle_HOME/JRE/bin/jre
$ ln -s $Oracle_HOME/JRE/bin/i386/native_threads/Java $Oracle_HOME/JRE/bin/i386/native_threads/jre

OK,現在Retry,你就可以成功安裝Configuration Tools了,安裝也就結束了...

==================================================
*Tips: (這是我安裝過程中出現的問題及其解決方法)
==================================================

1. error while loading shared librarIEs: libstdc++-libc6.1-1.so.2:
cannot open shared object file: No such file or directory - after
./runInstaller execution.
==================================================================
Solution:
su -
# cd /usr/lib
# ln -s libstdc++-3-libc6.2-2-2.10.0.so libstdc++-libc6.1-1.so.2

2. Oracle 9i Patch
==========================
p2617419_220_GENERIC.zip
p3006854_9204_Linux.zip
p3238244_9204_Linux.zip
http://www.opennet.ru/soft/ora_inst/

compat-libcwait-2.0-2.i386.rpm
compat-Oracle-rhel4-1.0-5.i386.rpm
http://oss.oracle.com/projects/compat-Oracle/files/RedHat/

3. 幾個需要的包所在的路徑
===========================
compat-db -- AS5 disk 3
compat-gcc-34 -- 2
compat-gcc-34-c++ -- 2
compat-libgcc -- 3
openmotif -- 3

4. Exception in thread "main" Java.lang.UnsatisfIEdLinkError:
/tmp/OraInstall2007-12-06_07-00-08PM/jre/lib/i386/libawt.so: libXp.so.6:
cannot open shared object file: No such file or directory
========================================================================
Solution: install the follow RPMs
libXpm -- 1
libXpm-devel -- 2
libXp -- 2
libXp-devel -- 2

5. Exception in thread "main" Java.lang.InternalError: Can't connect to
X11 window server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at
sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.Java:59)
at Java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.Java:120)
at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.Java:58)
at Java.awt.Window.(Window.Java:188)
at Java.awt.Frame.(Frame.Java:315)
at Java.awt.Frame.(Frame.Java:262)
at Oracle.sysman.oii.oiic.OiicInstaller.main(OiicInstaller.Java:593)
======================================================================================
Solution: (xhost +的問題 )
1. 用Oracle用戶登錄x-window
或者
2.用root用戶運行
# xhost +

6. Fatal: Stack size too small. Use 'ulimit -s' to increase default
stack size.
==========================
第二次運行就正常了

7. $ dbca   // 無法啟動dbca,提示錯誤如下:
/opt/Oracle/jre/1.1.8/bin/../lib/i686/green_threads/libzip.so: symbol
errno, version GLIBC_2.0 not defined in file libc.so.6 with link time
reference (libzip.so)
Unable to initialize threads: cannot find class Java/lang/Thread
Could not create Java VM
==========================
Solution: (參考 冷風的Fedora 7最新安裝Oracle9204手記)
$ cd /opt/app/Oracle/product/9.2.0
$ ls -l JRE
lrwxrwxrwx 1 oracle oinstall 25 Dec 7 10:11 JRE -> /opt/app/Oracle/jre/1.1.8
$ rm JRE
$ ln -s /opt/app/Oracle/jre/1.3.1 JRE
$ su -
# cd /opt/app/Oracle/product/9.2.0/JRE/bin/
# ln -s Java jre
# cd i386/native_threads/
# ln -s Java jre

8. 快裝完的時候有:
parameter "orahome"=/home/Oracle/product/9.2.0
parameter "nodeinfo"=NO_value
提示失敗。
=======================================================
Solution:
打上安裝補丁p3238244_9204_Linux.zip
unzip p3238244_9204_Linux.zip
cd 3238244
手工將3238244/files/lib/stubs目錄下的所有文件復制到
/Oracle/product/9.2.0/lib/stubs/目錄下也可以,如下:
cp files/lib/stubs/* $Oracle_HOME/lib/stubs/
重新連接編譯"Agent"相關程序
cd $Oracle_HOME/network/lib/
make -f ins_oemagent.mk install
耐心等待成功編譯。
再點擊前面Oracle安裝程序中的"Agent Configuration Assistant",並點擊
"Retry"重新運行配置工具程序,過一會應該會成功,退出安裝

9. /opt/app/Oracle/9.2.0/Apache/Apache/bin/apachectl startssl: httpd
could not be started
/opt/app/Oracle/9.2.0/Apache/apache/bin/httpd: error while loading
shared librarIEs: libdb.so.2: cannot open shared object file: No such
file or directory
=======================================================
Solution:
安裝 gnome-libs-1.4.2-7.rhel5.i386.rpm 及其依賴的包
giflib-4.1.3-8.i386.rpm
libpng10-1.0.18-2.i386.rpm
glib-1.2.10-26.fc7.i386.rpm
ORBit-0.5.17-22.rhel5.i386.rpm
gnome-libs-1.4.2-7.rhel5.i386.rpm
rpmdb-redhat-4-0.20071031.src.rpm
imlib-1.9.15-2.fc7.i386.rpm
gtk+-1.2.10-57.fc7.i386.rpm


寫在最後,為了更加容易安裝,我寫了三個簡單的腳本
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 為了使安裝更加容易,我寫了3個簡單的腳本:
+ [url=http://ox0spy.googlepages.com/beforeInstallOracle.sh]beforeInstallOracle.sh,
+ [url=http://ox0spy.googlepages.com/patch_before_install.sh]patch_before_install.sh,
+ [url=http://ox0spy.googlepages.com/patch_configuration_tools.sh]patch_configuration_tools.sh 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++
+ patch目錄結構如下:
++++++++++++++++++++
C:\>tree /f D:\patch
卷 PROGRAM 的文件夾 PATH 列表
卷序列號碼為 0006EE50 D662:9A5F
D:\PATCH
│  beforeInstallOracle.sh
│  p3006854_9204_Linux.zip
│  p3238244_9204_Linux.zip
│  patch_configuration_tools.sh
│  compat-libcwait-2.1-1.i386.rpm
│  patch_before_install.sh

└─rpm
│  libXp-1.0.0-8.i386.rpm
│  openmotif-2.3.0-0.3.el5.i386.rpm
│  compat-db-4.2.52-5.1.i386.rpm
│  libXp-devel-1.0.0-8.i386.rpm
│  compat-gcc-34-c++-3.4.6-4.i386.rpm
│  openmotif-devel-2.3.0-0.3.el5.i386.rpm
│  compat-gcc-34-3.4.6-4.i386.rpm
│  libXpm-3.5.5-3.i386.rpm
│  compat-libgcc-296-2.96-138.i386.rpm
│  libXpm-devel-3.5.5-3.i386.rpm

└─download
gnome-libs-1.4.2-7.rhel5.i386.rpm
ORBit-0.5.17-22.rhel5.i386.rpm
libpng10-1.0.18-2.i386.rpm
gtk+-1.2.10-57.fc7.i386.rpm
gnome-libs-devel-1.4.2-7.rhel5.i386.rpm
glib-1.2.10-26.fc7.i386.rpm
imlib-1.9.15-2.fc7.i386.rpm
giflib-4.1.3-8.i386.rpm
rpmdb-redhat-4-0.20071031.src.rpm

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved