CentOS 6.5 安装 Oracle XE 11.2

分类:DataBase

最近在CentOS 6.5系统上尝试安装Oracle XE 11.2用于测试之用, 这里做一个记录. 首先查看官方给出的 Packages Requirements 依赖包:

* glibc should be greater than or equal to 2.3.4-2.41
* make should be greater than or equal to 3.80
* binutils should be greater than or equal to 2.16.91.0.5
* gcc should be greater than or equal to 4.1.2
* libaio should be greater than or equal to 0.3.104

安装前的准备

连接到Centos6.5服务器

安装依赖

yum install libaio bc flex

下载Oracle XE

前往Oracle官网下载Oracle XE, linux 64位版本(需要登录) , 拷贝至服务器

正式安装

# 解压rpm包
unzip -q oracle-xe-11.2.0-1.0.x86_64.rpm.zip
cd Disk1
# 安装rpm包
rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm 
# 配置Oracle xe
/etc/init.d/oracle-xe configure
# 应用端口从8080改为8888,监听端口默认1521,设置sys/system账户的密码
会自动在 /u01/app 创建oracle用户

配置环境变量

cd /u01/app/oracle/product/11.2.0/xe/bin/ 
cp oracle_env.csh /etc/profile.d/ 
cp oracle_env.sh /etc/profile.d/ 
source /etc/profile

数据库远程连接设置

# 切换到oracle用户
su oracle
# 进入sqlplus命令行
sqlplus /nolog
# 以sys登录
conn / as sys dba
# 如果想远程通过PL/SQL Developer或Navicat等工具以system登录,需要执行
EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
# 创建表空间
create tablespace mytable datafile '/u01/app/oracle/oradata/mytable.dbf' size 32M autoextend on next 32M maxsize 20480M;
# 创建用户并分配表空间
create user username identified by passwd default tablespace mytable;
# 给用户授权
grant connect,resource to username;

参考文章