Centos7 安装Oracle11g Express Edition

下载

总下载页面:https://www.oracle.com/downloads/index.html

11g速成版(不支持rman) :https://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html

Centos7 安装Oracle11g Express Edition_第1张图片

解压文件

$ unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

安装依赖

$ 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*

安装

  • 到解压后的目录:
[wangwei@localhost ~]$ cd Disk1/
[wangwei@localhost Disk1]$ pwd
/home/wangwei/Disk1
  • 配置
[root@localhost Disk1]# /etc/init.d/oracle-xe configure
Oracle Database 11g Express Edition Configuration
-------------------------------------------------
This will configure on-boot properties of Oracle Database 11g Express 
Edition.  The following questions will determine whether the database should 
be starting upon system boot, the ports it will use, and the passwords that 
will be used for database accounts.  Press  to accept the defaults. 
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:

Specify a port that will be used for the database listener [1521]:

Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of 
different passwords for each database account.  This can be done after 
initial configuration:
Password can't be null. Enter password:
Confirm the password:

Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:y

Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.

到此初始化完成。

[root@localhost Disk1]# rpm -i oracle-xe-11.2.0-1.0.x86_64.rpm 
        软件包 oracle-xe-11.2.0-1.0.x86_64 已经安装

到此安装完成。

配置和访问

数据库目录:/u01/app/oracle/product/11.2.0/xe/dbs/
配置系统变量:

[root@localhost ~]# 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`

让配置生效:

[root@localhost ~]# source /etc/profile

连接验证

系统默认用户SYSTEM,密码是上面你自己设置的。

[root@localhost ~]# sqlplus

SQL*Plus: Release 11.2.0.2.0 Production on 星期二 8月 7 18:11:38 2018

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

请输入用户名:  SYSTEM
输入口令: 

连接到: 
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> 

创建一个表

SQL> create table test(a int);   

表已创建。

SQL> insert into test values(1);

已创建 1 行。

SQL> select * from test;

         A
----------
         1

SQL> 

你可能感兴趣的:(Centos7 安装Oracle11g Express Edition)