2.解压你的压缩文件
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
swap分配空间, 如果这里不分配, 后续安装会失败. 也可创建虚机时就扩大swap分区
dd if=/dev/zero of=/swapfile bs=1024 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
- 进入刚才解压好的文件夹 Disk1中, 执行安装
cd Disk1/
rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm
4.安装成功之后, 按照提示进行配置下一步下一步即可
/etc/init.d/oracle-xe configure
5.添加oralce 环境变量
vim /etc/profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/xe; export ORACLE_HOME
ORACLE_SID=XE; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
TNS_ADMIN=$ORACLE_HOME/network/admin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
总结安装完后的问题配置
oracle-xe 解决切换oracle用户是-bash4.1问题
[root@server1 ~]$su oracle
[oracle@server1 root]$cd ~
[oracle@server1 ~]$ls
admin diag fast_recovery_area oradata oradiag_oracle product
[oracle@server1 ~]$echo "export PS1=\"[\u@\h \W]\$\"" >> .bash_profile
[oracle@server1 ~]$exit
[root@server1 ~]$su - oracle
[oracle@server1 ~]$ls
admin diag fast_recovery_area oradata oradiag_oracle product
添加oracle最大连接数
vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle hard stack 10240
添加scott用户测试表
[oracle@server1 admin]$sqlplus system
SQL> @/u01/app/oracle/product/11.2.0/xe/rdbms/admin/utlsampl.sql
[oracle@server1 admin]$sqlplus scott 验证默认密码tiger
SQL> desc emp;
Name Null? Type
----------------------------------------- -------- ----------------------------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
安装rlwrap包解决oracle SQL终端中不能上下翻页
安装完添加环境变量即可
vim /etc/profile
alias sqlplus=‘rlwrap sqlplus‘
alias rman=‘rlwrap rman‘