下載
總下載頁(yè)面:https://www.oracle.com/downloads/index.html
11g速成版(不支持rman) :https://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html
解壓文件
$ 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 <Enter> 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 已經(jīng)安裝
到此安裝完成。
配置和訪問(wèn)
數(shù)據(jù)庫(kù)目錄:/u01/app/oracle/product/11.2.0/xe/dbs/
配置系統(tǒng)變量:
[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
連接驗(yàn)證
系統(tǒng)默認(rèn)用戶SYSTEM,密碼是上面你自己設(shè)置的。
[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.
請(qǐng)輸入用戶名: SYSTEM
輸入口令:
連接到:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL>
創(chuàng)建一個(gè)表
SQL> create table test(a int);
表已創(chuàng)建。
SQL> insert into test values(1);
已創(chuàng)建 1 行率寡。
SQL> select * from test;
A
----------
1
SQL>