Centos7 安装Oracle11g Express Edition

Centos7 安装Oracle11g Express Edition

下载地址:https://download.oracle.com/otn/linux/oracle11g/xe/

一、安装相关依赖包:
yum -y install binutils* compat-libcap1* compat-libstdc++* gcc* gcc-c++* glibc* glibc-devel* ksh* libaio* libaio-devel* libgcc* libstdc++* libstdc++-devel* libXi* libXtst* make* sysstat* elfutils* unixODBC*
yum -y install bc

二、安装
rpm -i oracle-xe-11.2.0-1.0.x86_64.rpm
/etc/init.d/oracle-xe configure # 配置 ,设置端口、sys用户密码等

安装后的数据库目录:/u01/app/oracle/product/11.2.0/xe/dbs/

三、环境变量
vim /etc/profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`

source /etc/profile

四、登录
sqlplus

注意: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 2042 MB
of swap space.  Configure more swap space on the system and retry the 
installation. 这中报错是swap空间不够

以下的操作都要在root用户下进行,首先先建立一个分区,采用dd命令比如

dd if=/dev/zero of=/home/swap bs=1024 count=512000

这样就会创建/home/swap这么一个分区文件。文件的大小是512000个block,一般情况下1个block为1K,所以这里空间是512M。接着再把这个分区变成swap分区。

/sbin/mkswap /home/swap

再接着使用这个swap分区。使其成为有效状态。

/sbin/swapon /home/swap

现在再用free -m命令查看一下内存和swap分区大小,就发现增加了512M的空间了。不过当计算机重启了以后,发现swap还是原来那么大,新的swap没有自动启动,还要手动启动。那我们需要修改/etc/fstab文件,增加如下一行

/home/swap              swap                    swap    defaults        0 0

你就会发现你的机器自动启动以后swap空间也增大了。

原文地址:https://www.cnblogs.com/jnba/p/10647984.html