参考别人的方法:
不过安装的过程发现出错:
- Preparing... ########################################### [100%]
- This system does not meet the minimum requirements for swap space. Based on
- the amount of physical memory available on the system, Oracle Database 11g
- Express Edition requires 2048 MB of swap space. This system has 1023 MB
- of swap space. Configure more swap space on the system and retry the
- installation.
- error: %pre(oracle-xe-11.2.0-1.0.x86_64) scriptlet failed, exit status 1
- error: install: %pre scriptlet failed (2), skipping oracle-xe-11.2.0-1.0
- su - root
- dd if=/dev/zero of=/swapfile bs=2048 count=1048576
- mkswap /swapfile
- swapon /swapfile
- cp /etc/fstab /etc/fstab.backup_$(date +%N)
- echo '/swapfile swap swap defaults 0 0' >> /etc/fstab
- chown root:root /swapfile
- chmod 0600 /swapfile
- swapon -a
- swapon -s
装好后切换到oracle用户
su oracle
回到根目录
cd
ls -la
修改.bash_profile文件
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=dbserver; export ORACLE_HOSTNAME
ORACLE_UNQNAME=ORADB; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/xe; export ORACLE_HOME
ORACLE_SID=ORADB; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
source .bash_profile
测试
echo $ORACLE_BASE
sqlplus / as sysdba #查看是否可以进入sql命令行
成功!