建議:安裝Oracle通過本機上的監視器的x window安裝,或者通過遠程登錄的方式安裝。Oracle默認會有圖形化界面的選擇。通過ssh沒有圖形化界面,
Oracle 9i 在Linux 下的安裝
系統要求:
以下的系統要求適用於典型的Oracle安裝和創建簡單數據庫的方式。
內存:
安裝Oralce 9i軟件至少需要512M內存,用以下命令可以查看機子的內存大小:
grep MemTotal /proc/meminfo
MemTotal: 900252 kB
900252kB就是你系統的內存大小。
交換區:
交換區的大小一般要求是內存的兩倍,至少要求達到400M以上,當然是越大越好,用以下的命令可以查看系統交換區的大小:
/sbin/swapon -s
Filename Type Size Used Priority
/dev/sda6 partition 105221 686976 -1
其中105221就是系統交換區的大小。
http://www.itpub.Net/thread-931003-1-1.Html
http://www.cnblogs.com/chinareny2k/archive/2010/01/05/1639468.Html
范例:
zip命令可以用來將文件壓縮成為常用的zip格式。unzip命令則用來解壓縮zip文件。
1. 我想把一個文件abc.txt和一個目錄dir1壓縮成為yasuo.zip:
# zip -r yasuo.zip abc.txt dir1
2.我下載了一個yasuo.zip文件,想解壓縮:
# unzip yasuo.zip
3.我當前目錄下有abc1.zip,abc2.zip和abc3.zip,我想一起解壓縮它們:
# unzip abc\?.zip
注釋:?表示一個字符,如果用*表示任意多個字符。
4.我有一個很大的壓縮文件large.zip,我不想解壓縮,只想看看它裡面有什麼:
# unzip -v large.zip
5.我下載了一個壓縮文件large.zip,想驗證一下這個壓縮文件是否下載完全了
# unzip -t large.zip
6.我用-v選項發現music.zip壓縮文件裡面有很多目錄和子目錄,並且子目錄中其實都是歌曲mp3文件,我想把這些文件都下載到第一級目錄,而不是一層一層建目錄:
# unzip -j music.zip
我的安裝包下的東西:
-rwxrwx--- 1 oracle Oracle 3172244 Nov 29 21:17 compat-gcc-32-3.2.3-47.3.i386.rpm
-rwxrwx--- 1 oracle Oracle 3863472 Nov 29 21:17 compat-gcc-32-c++-3.2.3-47.3.i386.rpm
-rwxrwx--- 1 oracle Oracle 4058 Nov 29 21:17 compat-libcwait-2.1-1.i386.rpm
drwxrwxr-x 2 oracle Oracle 4096 Nov 29 21:22 OraInstall RPMs
-rwxrwx--- 1 oracle Oracle 1440 Nov 29 21:17 p3006854_9204_Linux.zip
-rwxrwx--- 1 oracle Oracle 659577856 Nov 29 21:18 ship_9204_Linux_disk1.cpio
-rwxrwx--- 1 oracle Oracle 646914048 Nov 29 21:19 ship_9204_Linux_disk2.cpio
-rwxrwx--- 1 oracle Oracle 299722752 Nov 29 21:19 ship_9204_Linux_disk3.cpio
[Oracle@localhost install]$ cd OraInstall\ RPMs/
[Oracle@localhost OraInstall RPMs]$ ll
total 13620
-rw-rw-r-- 1 oracle Oracle 3172865 Nov 29 21:21 binutils-2.15.92.0.2-15.0.0.0.2.x86_64.rpm
-rw-rw-r-- 1 oracle Oracle 3376726 Nov 29 21:21 compat-gcc-32-3.2.3-47.3.x86_64.rpm
-rw-rw-r-- 1 oracle Oracle 4905485 Nov 29 21:22 compat-gcc-32-c++-3.2.3-47.3.x86_64.rpm
-rw-rw-r-- 1 oracle Oracle 228988 Nov 29 21:21 compat-libstdc++-33-3.2.3-47.3.x86_64.rpm
-rw-rw-r-- 1 oracle Oracle 2021167 Nov 29 21:21 glibc-devel-2.3.4-2.13.i386.rpm
-rw-rw-r-- 1 oracle Oracle 18757 Nov 29 21:21 libaio-0.3.103-3.x86_64.rpm
-rw-rw-r-- 1 oracle Oracle 10270 Nov 29 21:21 libaio-devel-0.3.103-3.x86_64.rpm
-rw-rw-r-- 1 oracle Oracle 47917 Nov 29 21:22 libao-0.8.5-2.EL.0.x86_64.rpm
-rw-rw-r-- 1 oracle Oracle 115823 Nov 29 21:22 sysstat-5.0.5-1.x86_64.rpm
第一步:按照gcc和c++編譯器
需要root帳號才可以安裝。非root帳號安裝出現如下錯誤:
[Oracle@localhost install]$ rpm -ivh compat-gcc-32-3.2.3-47.3.i386.rpm
warning: compat-gcc-32-3.2.3-47.3.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
error: can't create transaction lock on /var/lib/rpm/__db.000
su到root帳號:分別執行rpm -ivh compat-gcc-32-3.2.3-47.3.i386.rpm 和rpm -ivh compat-gcc-32-c++-3.2.3-47.3.i386.rpm和rpm -ivh compat-libcwait-2.1-1.i386.rpm
[Oracle@localhost install]$ su
PassWord:
[root@localhost install]# rpm -ivh compat-gcc-32-3.2.3-47.3.i386.rpm
warning: compat-gcc-32-3.2.3-47.3.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:compat-gcc-32 ########################################### [100%]
[root@localhost install]# rpm -ivh compat-gcc-32-c++-3.2.3-47.3.i386.rpm
warning: compat-gcc-32-c++-3.2.3-47.3.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:compat-gcc-32-c++ ########################################### [100%]
[root@localhost install]# rpm -ivh compat-libcwait-2.1-1.i386.rpm
Preparing... ########################################### [100%]
cat: /etc/ld.so.preload: No such file or directory
1:compat-libcwait ########################################### [100%]
第二步:設置環境變量
# Set the LD_ASSUME_KERNEL environment variable only for Red Hat 9,
# RHEL AS 3, and RHEL AS 4 !!
# Use the "Linuxthreads with floating stacks" implementation instead of NPTL:
#export LD_ASSUME_KERNEL=2.4.1 # for RH 9 and RHEL AS 3
#export LD_ASSUME_KERNEL=2.4.19 # for RHEL AS 4
#export LD_ASSUME_KERNEL=2.4.1
export ORACLE_BASE=/home/Oracle
export ORACLE_HOME=$Oracle_BASE/product/9.2.0
export Oracle_SID=udb
#export Oracle_TERM=xterm
export ORA_NLS33=$Oracle_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$Oracle_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
# Set shell search paths
export PATH=$PATH:$Oracle_HOME/bin
DISPLAY=local_host:0.0
export DISPLAY
第三步:
安裝ora9需要打補丁:p3006854_9204_Linux.zip,可以去網上下載
打補丁:[root@localhost 3006854]# ./rhel3_pre_install.sh
Patch has already been applIEd
[Oracle@localhost Disk1]$ ./runInstaller
[Oracle@localhost Disk1]$ Initializing Java Virtual Machine from /tmp/OraInstall2010-11-29_11-33-06PM/jre/bin/Java. Please wait...
/tmp/OraInstall2010-11-29_11-33-06PM/jre/bin/i386/native_threads/Java: error while loading shared librarIEs: libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory
解決:
cd /usr/lib
只用執行如下操作 ln -s libstdc++-libc6.2-2.so.3 libstdc++-libc6.1-1.so.2
注意:因為安裝的是Oracle9i 故libstdc++-libc6.1-1.so.2應指向libstdc++-2-libc6.1-1-2.9.0.so,而不是libstdc++-3-libc6.2-2-2.10.0.so,改lib在/usr/lib/目錄下。
以root身份登錄
[root@localhost ~]# su - Oracle
[Oracle@localhost ~]$ ll
ls: error while loading shared librarIEs: librt.so.1: cannot open shared object file: No such file or directory
解決:變量LD_ASSUME_KERNEL environment variable設的有問題,版本是2.6.18,設置成了2.4.19
查看該數值使用命令more /proc/version
Linux version 2.6.18-164.el5 () (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Tue Aug
18 15:51:54 EDT 2009
[Oracle@localhost Disk1]$ ./runInstaller
[Oracle@localhost Disk1]$ Initializing Java Virtual Machine from /tmp/OraInstall2010-11-30_12-53-53AM/jre/bin/Java. Please wait...
Exception in thread "main" Java.lang.UnsatisfIEdLinkError: /tmp/OraInstall2010-11-30_12-53-53AM/jre/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(ClassLoader.Java:1419)
at java.lang.ClassLoader.loadLibrary(ClassLoader.Java:1335)
at java.lang.Runtime.loadLibrary0(Runtime.Java:749)
at java.lang.System.loadLibrary(System.Java:820)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.Java:53)
at Java.security.AccessController.doPrivileged(Native Method)
at sun.awt.NativeLibLoader.loadLibrarIEs(NativeLibLoader.Java:41)
at sun.awt.DebugHelper.<clinit>(DebugHelper.Java:29)
at java.awt.Component.<clinit>(Component.Java:356)
at Oracle.sysman.oii.oiic.OiicInstaller.main(OiicInstaller.Java:593)
解決:
打開Linux 安裝盤, server 找到 libXp-1.0.0-8.1.el5.i386.rpm 安裝。。。
這個是OEL5的Linux.
RHEL 5 也安裝libXP就對了
[Oracle@localhost Disk1]$ ./runInstaller
[Oracle@localhost Disk1]$ Initializing Java Virtual Machine from /tmp/OraInstall2010-11-30_02-18-41AM/jre/bin/Java. Please wait...
_X11TransSocketINETConnect() can't get address for local_host:6000: Temporary failure in name resolution
Exception in thread "main" Java.lang.InternalError: Can't connect to X11 window server using 'local_host:0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(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.<init>(Window.Java:188)
at java.awt.Frame.<init>(Frame.Java:315)
at java.awt.Frame.<init>(Frame.Java:262)
at Oracle.sysman.oii.oiic.OiicInstaller.main(OiicInstaller.Java:593)
解決:去本機裝或者安裝遠程桌面(注:開始我是遠程用ssh安裝運行的,出現上面的錯誤,到本機的圖形界面用term運行./runinstaller,就出現了安裝選擇界面,按步驟安裝即可)
在本機圖形界面安裝需要去掉.bash_profile中設置的DISPLAY=local_host:0.0
export DISPLAY
因為本機安裝時,默認設置是
DISPLAY=:0.0
export DISPLAY
在RHAS3上成功安裝Oracle9204
/home/Oracle/OraHome/jre/1.1.8/bin/../lib/i686/native_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
沒有設置without setting the LD_ASSUME_KERNEL environment variable.
因為沒有設置LD_ASSUME_KERNEL導致下列安裝失敗:
Oracle net configuration assistant
Oracle database configuration assistant
agent configuration assistant
stating http server
enterprise manager configuration assistant
具體錯誤提示如下:
oracle net configuration assistant failed:/home/Oracle/OraHome/jre/1.1.8/bin/../lib/i686/native_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
oracle database configuration assistant failed:/home/Oracle/OraHome/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)
agent configuration assistant:/home/Oracle/OraHome/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)
stating http server failed:/home/Oracle/OraHome/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)
enterprise manager configuration assistant failed:/home/Oracle/OraHome/jre/1.1.8/bin/../lib/i686/native_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
問:Oracle for Linux 的安裝盤裡是cpio的包,請問如何解壓縮,並進行安裝。
答:cpio -idmv < ship_9204_Linux_disk1.cpio
問:安裝Oracle9i時提示DISPLAY not set
答:執行 echo $DISPLAY ,如果沒有任何輸出設置DISPLAY=:0.0