Ubuntu 12.04下安裝Oracle Express 11gR2

來源:互聯網
上載者:User

我新安裝的Linux Mint 13 “Maya” Xfce RC,但因為是基於XUbuntu 12.04,所以對於XUbuntu與Ubuntu的12.04都應該可以適用

1、點擊這裡下載Oracle express的安裝介質

Oracle Database Express Edition 11g Release 2 for Linux x64

2、轉換為deb包
由於下載的是rpm包ubuntu無法直接使用所以需要alien來轉換

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安裝檔案

3、安裝deb
雙擊deb安裝這個包,這時包安裝成功但是我們會得到一個錯誤說/sbin/chkconfig不存在。

我們要修改/var/lib/dpkg/info/oracle-xe.postinst指令碼

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進行配置。但別急,我們還需要一些步驟再執行。

4、安裝依賴包
sudo apt-get install libaio1

5、解決ORA-00845: MEMORY_TARGET問題
由於oracle尋找的是/dev/shm,而Ubuntu已經換為/run/shm(雖然有連結還是有問題),在初始化時會出現ORA-00845問題,解決方案如下:

用root登入


sudo su -

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

cat &gt; /etc/init.d/oracle-shm <&lt;-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

6、配置oracle xe

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

選擇web管理連接埠預設8080

選擇監聽連接埠預設1521

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

最後詢問你是否自動啟動預設y

7、進行web管理台
從菜單中選擇Other->Get Started with Oracle Database 11g Express Edition

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.