标签:
一、 安装ubuntu 13.04 server 64位版本(最简安装即可),然后安装以下全部附件
#apt-get update
#apt-get dist-upgrade
#apt-get install automake autotools-dev binutils bzip2 doxygen elfutils expat gawk unzip
#apt-get install gcc gcc-multilib g++-multilib ia32-libs ksh less lesstif2 lesstif2-dev
#apt-get install lib32z1 libaio1 libaio-dev libc6-dev libc6-dev-i386 libc6-i386
#apt-get install libelf-dev libltdl-dev libmotif4 libodbcinstq4-1 libodbcinstq4-1:i386
#apt-get install libpth-dev libpthread-stubs0 libpthread-stubs0-dev libstdc++5 zlibc
#apt-get install lsb-cxx make pdksh rlwrap rpm openssh-server
#apt-get install sysstat unixodbc unixodbc-dev x11-utils
二、下载 Oracle XE 11g ,小弟下载存放于 /home 目录下
Download Oracle Database Express Edition 11g R2
三、 开始安装 Oracle
#cd /home
#unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
#cd Disk1
#alien --scripts oracle-xe-11.2.0-1.0.x86_64.rpm
创建 /sbin/chkconfig
#vi /sbin/chkconfig
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
echo >> $file
echo ‘### BEGIN INIT INFO‘ >> $file
echo ‘# Provides: OracleXE‘ >> $file
echo ‘# Required-Start: $remote_fs $syslog‘ >> $file
echo ‘# Required-Stop: $remote_fs $syslog‘ >> $file
echo ‘# Default-Start: 2 3 4 5‘ >> $file
echo ‘# Default-Stop: 0 1 6‘ >> $file
echo ‘# Short-Description: Oracle 11g Express Edition‘ >> $file
echo ‘### END INIT INFO‘ >> $file
fi
update-rc.d oracle-xe defaults 80 01
更改可运行权限
#chmod 755 /sbin/chkconfig
创建 /etc/sysctl.d/60-oracle.conf
#vi /etc/sysctl.d/60-oracle.conf
# Oracle 11g XE kernel parameters
fs.file-max=6815744
kernel.sem=250 32000 100 128
kernel.shmmax=1073741824
net.ipv4.ip_local_port_range=9000 65000
启动 procps 服务
#service procps start
#ln -s /usr/bin/awk /bin/awk
#mkdir /var/lock/subsys
#touch /var/lock/subsys/listener
#rm -rf /dev/shm
#mkdir /dev/shm
#mount -t tmpfs shmfs -o size=2048m /dev/shm
创建 /etc/rc2.d/S01shm_load
#vi /etc/rc2.d/S01shm_load
#!/bin/sh
case "$1" in
start) mkdir /var/lock/subsys 2>/dev/null
touch /var/lock/subsys/listener
rm /dev/shm 2>/dev/null
mkdir /dev/shm 2>/dev/null
mount -t tmpfs shmfs -o size=2048m /dev/shm ;;
*) echo error
exit 1 ;;
esac
更改可运行权限
#chmod 755 /etc/rc2.d/S01shm_load
安装Oracle包
#dpkg --install oracle-xe_11.2.0-2_amd64.deb
加环境变量
#vi ~/.bashrc 在文件最后面加入以下代码
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
#source ~/.bashrc
执行 Oracle 配置
#/etc/init.d/oracle-xe configure
--- 以下为删除 oracle ---
sudo -s
/etc/init.d/oracle-xe stop
ps -ef | grep oracle | grep -v grep | awk ‘{print $2}‘ | xargs kill
dpkg --purge oracle-xe
rm -r /u01
rm /etc/default/oracle-xe
update-rc.d -f oracle-xe remove
ubuntu 13.04 server安装Oracle XE 11G R2
标签:
原文地址:http://www.cnblogs.com/hui1107464497/p/4502033.html