天天看點

CentOS6.5安裝Oracle Express Edition(快捷版本)

Oracle Express Edition是給個人學習、熟悉Oracle的簡化版。此版本大小隻有301M,分為windows和linux兩個版本,有32為和64的。

1、下載下傳:

到官網下載下傳軟體包,要先注冊一個帳号,下載下傳完是一個壓縮包,解壓出oracle-xe-11.2.0-1.0.x86_64.rpm。Linux下隻有64位版本。下載下傳位址:http://www.oracle.com/technetwork/cn/database/database-technologies/express-edition/downloads/index.html

2、安裝依賴包:

yum install libaio libaio-devel bc -y      

3、安裝:

使用root使用者

1)解壓、檢測:

unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
cd Disk1
rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm      

安裝時會對系統進行檢測,最好記憶體有1G,SWAP要求是記憶體的2倍。

[root@server01 Disk1]# rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm 

Preparing...                ########################################### [100%]

   1:oracle-xe              ########################################### [100%]

Executing post-install steps...

You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

3)将tmpfs擴充為2G:

如果tmpfs小于2G,在下一步執行設定指令會報錯:

Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details

A、修改/etc/fstab檔案

vim /etc/fstab

将:

tmpfs        /dev/shm        tmpfs   defaults      0 0

改為:

tmpfs        /dev/shm        tmpfs   defaults,size=2048M      0 0

B、重新加載tmpfs

umount /dev/shm

mount /dev/shm

C、檢查

df -h /dev/shm

Filesystem      Size  Used Avail Use% Mounted on

none            2.0G  243M  1.8G  12% /dev/shm

4)按照提示進行安裝:(使用root使用者)

/etc/init.d/oracle-xe configure

[root@server01 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]:8081

Specify a port that will be used for the database listener [1521]: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:

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.

輸入的四項内容是:http通路時的端口、資料庫的監聽端口、SYS和SYSTEM使用者的密碼、是否開機啟動(并沒有開機啟動,可能還有地方要設定)。

安裝完成後,會自動建立一個名為oracle的使用者,家目錄/u01/app/oracle。

會建立dba組,oracle使用者屬于這個組。

會自動生成一個資料庫執行個體,名為XE。/u01/app/oracle/product/11.2.0/xe/dbs/spfileXE.ora

HTTP管理位址:

​​​ http://伺服器IP:8081/​​ 用SYS或SYSTEM使用者登入。

5)設定oracle的環境變量

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`

設定後登出使用者,使用oracle使用者重新登入,就可以用sqlplus了。