centos服务器上(腾讯云)安装oracleXE

参考别人的方法:

oracleXE安装

不过安装的过程发现出错:

  1. Preparing...                ########################################### [100%]  
  2.   
  3.   
  4. This system does not meet the minimum requirements for swap space.  Based on  
  5. the amount of physical memory available on the system, Oracle Database 11g  
  6. Express Edition requires 2048 MB of swap space. This system has 1023 MB  
  7. of swap space.  Configure more swap space on the system and retry the  
  8. installation.  
  9.   
  10.   
  11. error: %pre(oracle-xe-11.2.0-1.0.x86_64) scriptlet failed, exit status 1  
  12. error:   install: %pre scriptlet failed (2), skipping oracle-xe-11.2.0-1.0  
发现没有设置交换空间,所以

  1. su - root  
  2. dd if=/dev/zero of=/swapfile bs=2048 count=1048576  
  3. mkswap /swapfile  
  4. swapon /swapfile  
  5. cp /etc/fstab /etc/fstab.backup_$(date +%N)  
  6. echo '/swapfile swap swap defaults 0 0' >> /etc/fstab  
  7.   
  8. chown root:root /swapfile  
  9. chmod 0600 /swapfile  
  10. swapon -a  
  11. 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命令行
成功!


你可能感兴趣的:(linux)