linux ubuntu系统安装及卸载oracle xe11.2.0
生活随笔
收集整理的這篇文章主要介紹了
linux ubuntu系统安装及卸载oracle xe11.2.0
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
最近公司對盜版很忌諱,所以都換上免費的了,培訓中心的操作系統(tǒng)選擇ubuntu,oracle換成xe版的了,對于oracle xe在ubuntu 12.0.4上的安裝也是小折騰了一把,畢竟oracle對ubuntu 12.04在原則上是不支持的。下面安裝不算正規(guī),但也總算裝上了,有需要的可以參考。 1,建立oracle用戶及屬主 addgroup oinstall addgroup dba adduser oracle usermod –g oinstall –G dba oracle id oracle id nobody 2,建立軟鏈接 #ln -s /usr/bin/awk /bin/awk #ln -s /usr/bin/rpm /bin/rpm #ln -s /usr/bin/basename /bin/basename 3,檢查包的依賴性(需要連網(wǎng)環(huán)境) #apt-get update #apt-get install alien #apt-get install libaio1 4,準備安裝文件 一般下載得到的是zip文件,需要先unzip解壓 unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip 將解壓出來的rpm文件轉(zhuǎn)換成deb格式 alien -d --scripts oracle-xe-11.2.0-1.0.x86_64.rpm 這里如果alien沒有安裝,需要先安裝alien。 5,安裝oracle軟件 oracle xe需要使用root用戶進行 #dpkg -i oracle-xe-11.2.0-1.0.x86_64.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 將上面粗體部分注釋掉,然后再執(zhí)行 #/var/lib/dpkg/info/oracle-xe.postinst 這時就不再報這個錯了。 6,安裝oracle-shm 這部分的安裝主要是為了避免ORA-00845: MEMORY_TARGET問題,將下面一段拷貝到命令行,回車即可: 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 # EOF 下面接著配置一下oracle-shm #chmod 755 /etc/init.d/oracle-shm #update-rc.d oracle-shm defaults 01 99 #reboot 這時需要重啟一下電腦 7,配置oracle,建庫等操作 先建個目錄(由于ubuntu下面無此目錄,為防止安裝oracle xe時報錯): #mkdir /var/lock/subsys #/etc/init.d/oracle-xe configure 選擇web管理端口默認8080 選擇監(jiān)聽端口默認1521 輸入管理員密碼與確認密碼(sys密碼) 最后詢問你是否自動啟動默認y 8,檢查安裝 切換到oracle用戶檢查環(huán)境變量,查看/home/oracle/.profile, 如果沒有添加oracle的環(huán)境變量則需要手工寫入。 su – oracle env |grep ORA sqlplus /nolog conn /as sysdba /etc/init.d/oracle-xe start /etc/init.d/oracle-xe stop ps –ef|grep oracle 9,卸載oracle-xe #apt-get remove --purge ?oracle-xe #rm /etc/default/oracle-xe #rm –rf /u01 note:如果想通過sqlplus啟動關閉數(shù)據(jù)庫,還要設置oracle用戶的環(huán)境變量,這里就不再設置了。
轉(zhuǎn)載于:https://www.cnblogs.com/huapox/archive/2013/03/01/3299880.html
總結(jié)
以上是生活随笔為你收集整理的linux ubuntu系统安装及卸载oracle xe11.2.0的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: GdiPlus[47]: IGPMatr
- 下一篇: Linux 系统添加静态路由的方法