Ubuntu 12.04下安裝Oracle Express 11gR2

我新安裝的Linux Mint 13 「Maya」 Xfce RC,但由於是基於Xubuntu 12.04,因此對於XUbuntu與Ubuntu的12.04都應該能夠適用html

一、下載oracle express的安裝介質

http://www.oracle.com/technetwork/products/express-edition/downloads/index.htmlweb

Oracle Database Express Edition 11g Release 2 for Linux x64shell

 

二、轉換爲deb包

因爲下載的是rpm包ubuntu沒法直接使用因此須要alien來轉換express

sudo apt-get install alien
sudo alien -d --scripts oracle-xe-11.2.0-1.0.x86_64.rpm

成功轉換後獲得oracle-xe_11.2.0-2_amd64.deb安裝文件ubuntu

 

三、安裝deb

雙擊deb安裝這個包,這時包安裝成功可是咱們會獲得一個錯誤說/sbin/chkconfig不存在。oracle

咱們要修改/var/lib/dpkg/info/oracle-xe.postinst腳本app

if [ -f /etc/SuSE-release ]
then
	cp -f /u01/app/oracle/product/11.2.0/xe/config/scripts/oracle-xe.sles /etc/init.d/oracle-xe
	/usr/lib/lsb/install_initd /etc/init.d/oracle-xe > /dev/null 2>&1
	/sbin/insserv /etc/init.d/oracle-xe > /dev/null 2>&1
	/sbin/SuSEconfig > /dev/null 2>&1
#else
#        /sbin/chkconfig --add oracle-xe
fi

把else與/sbin/chkconfig --add oracle-xe註釋掉,而後再執行

sudo /var/lib/dpkg/info/oracle-xe.postinst

會提示你運行/etc/init.d/oracle-xe configure進行配置。但別急,咱們還須要一些步驟再執行。ide

 

四、安裝依賴包

sudo apt-get install libaio1

 

五、解決ORA-00845: MEMORY_TARGET問題

因爲oracle查找的是/dev/shm,而Ubuntu已經換爲/run/shm(雖然有連接仍是有問題),在初始化時會出現ORA-00845問題,解決方法以下:

用root登陸post

sudo su -

粘貼下載的代碼到命令行,來建立oracle-shm

cat > /etc/init.d/oracle-shm <<-EOF
#! /bin/sh
# /etc/init.d/oracle-shm
#
#
case "\$1" in
  start)
    echo "Starting script /etc/init.d/oracle-shm"
    # Run only once at system startup
    if [ -e /dev/shm/.oracle-shm ]; then
      echo "/dev/shm is already mounted, nothing to do"
    else
      rm -f /dev/shm
      mkdir /dev/shm
      #mount -B /run/shm /dev/shm
      mount -t tmpfs shmfs -o size=2048m /dev/shm
      touch /dev/shm/.oracle-shm
    fi
    ;;
  stop)
    echo "Stopping script /etc/init.d/oracle-shm"
    echo "Nothing to do"
    ;;
  *)
    echo "Usage: /etc/init.d/oracle-shm {start|stop}"
    exit 1
    ;;
esac
#
### BEGIN INIT INFO
# Provides:          oracle-shm
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6 
# Short-Description: Bind /run/shm to /dev/shm at system startup.
# Description:       Fix to allow Oracle 11g use AMM.
### END INIT INFO
EOF

安裝oracle-shm

chmod 755 /etc/init.d/oracle-shm
update-rc.d oracle-shm defaults 01 99

重啓

reboot

 

六、配置oracle xe

sudo /etc/init.d/oracle-xe configure

選擇web管理端口默認8080

選擇監聽端口默認1521ui

輸入管理員密碼與確認密碼(sys密碼)

最後詢問你是否自動啓動默認y

 

七、進行web管理臺

從菜單中選擇Other->Get Started with Oracle Database 11g Express Edition

相關文章
相關標籤/搜索