from http://blog.chinaunix.net/u3/114361/showart_2227746.html (有修改)
安裝步驟: 第一步: 在 終端輸入: xhost +127.0.0.1 第二步: 安裝必要的個工具: 終端輸入:sudo apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm(要在軟體源裡勾上有著作權與合法性問題限制的軟體,還有裝置的專有驅動) 第三步: 修改一些Ubuntu的/bin/sh的預設串連: 終端輸入: root@zhanghc-Ubuntu:~# cd /bin root@zhanghc-Ubuntu:/bin# ls -l /bin/sh lrwxrwxrwx 1 root root 4 2008-04-28 19:59 /bin/sh -> dash root@zhanghc-Ubuntu:/bin# ln -sf bash /bin/sh root@zhanghc-Ubuntu:/bin# ls -l /bin/sh lrwxrwxrwx 1 root root 4 2008-05-01 22:51 /bin/sh -> bash 第四步: 增加使用者和組: 終端輸入: root@zhanghc-Ubuntu:/bin# cd /root root@zhanghc-Ubuntu:~# addgroup oinstall root@zhanghc-Ubuntu:~# addgroup dba root@zhanghc-Ubuntu:~# addgroup nobody root@zhanghc-Ubuntu:~# usermod -g nobody nobody root@zhanghc-Ubuntu:~# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle root@zhanghc-Ubuntu:~# mkdir /home/oracle root@zhanghc-Ubuntu:~# chown -R oracle:dba /home/oracle root@zhanghc-Ubuntu:~# ln -s /usr/bin/awk /bin/awk root@zhanghc-Ubuntu:~# ln -s /usr/bin/rpm /bin/rpm root@zhanghc-Ubuntu:~# ln -s /usr/bin/basename /bin/basename root@zhanghc-Ubuntu:~# mkdir /etc/rc.d root@zhanghc-Ubuntu:~# for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done root@zhanghc-Ubuntu:~# mkdir -p /u01/app/oracle root@zhanghc-Ubuntu:~# chown -R oracle:dba /u01 第八步: 系統預設值: (1)增加下面這些到/etc/sysctl.conf檔案的末尾: fs.file-max = 65535 kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 1024 65535 net.core.rmem_default = 1048576 net.core.rmem_max = 1048576 net.core.wmem_default = 262144 net.core.wmem_max = 262144 (2)增加下面這些到/etc/security/limits.conf檔案末尾: oracle soft nproc 2047 oracle hard nproc 16383 oracle soft nofile 1023 oracle hard nofile 65535 (3)增加下面這些到/etc/pam.d/login檔案末尾: session required /lib/security/pam_limits.so session required pam_limits.so 增加完成後執行下面的命令:sysctl -p 第九步: (1)解壓源檔案:oracle11g的安裝包解壓到/home/oracle/install/目錄 (2)更改許可權:chown -R oracle:dba install (3) 設定DISPLAY參數:export DISPLAY=127.0.0.1:0.0 (這裡我設定成:0.0,因為網上說這樣可以自動尋找合適的,安裝介面可以啟動,但是切換使用者到oracle就不能啟動了,出現說顏色設定不正常,估計是 某些環境為設定,沒辦法,我只好使用使用者oracle登入gdm,可以使用命令gdmflexserver來額外啟動一個gdm案頭,然後再安裝出現安裝 介面了),可以不執行 第十步:
重啟,進入oracle使用者。
(1)終端輸入:./runInstaller -jreLoc /usr/lib/jvm/java-6-sun/jre/ 。。。。。。 (2)圖形安裝介面出現 。。。。。 (3)忽略預檢中的錯誤和警告 。。。。。 (4)選"Create a Database"來安裝資料庫。(原文是通過netca建立監聽,dbca建庫,我第一次也是這樣做的,dbca建庫時會報錯,因為ubutunbu 不支援RPM包)。 。。。。。。。 安裝過程中出現了一個makefile的錯誤,某個庫檔案沒有編譯過去,但是還可以繼續安裝,估計以後使用會出問題;另外在安裝的最後會有個配置環節等很久,只有一個廣告框,不要以為出問題了 (5)完成後。 su wangjian (這是我的有sudo 許可權的使用者,你自己裝視情況而定) 終端輸入:/u01/app/oracle/product/11.2.0/dbhome_1/root.sh 退出OUI 第十一步: 修改設定檔:/etc/profile export ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1 export PATH=$PATH:$ORACLE_HOME/bin 第十二步: (1)建立啟動指令碼: 在/u01/app/oracle/product/11.2.0/dbhome_1/bin下建立檔案:oracledb,內容: #!/bin/bash # # /etc/init.d/oracledb # # Run-level Startup script for the Oracle Listener and Instances # It relies on the information on /etc/oratab export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME= u01/app/oracle/product/11.2.0/dbhome_1 export ORACLE_OWNR=oracle export PATH=$PATH:$ORACLE_HOME/bin if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ] then echo "Oracle startup: cannot start" exit 1 fi case "$1" in start) # Oracle listener and instance startup echo -n "Starting Oracle: " su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start" su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" touch /var/lock/oracle echo "OK" ;; stop) # Oracle listener and instance shutdown echo -n "Shutdown Oracle: " su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop" su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" rm -f /var/lock/oracle echo "OK" ;; reload|restart) $0 stop $0 start